public static string GetTimeStatusMessage(SunStudyData sunStudyData)
        {
            var time = SunStudyUIController.GetFormattedMinuteOfDay(sunStudyData.timeOfDay);
            var day  = SunStudyUIController.GetFormattedDayOfYear(DateTime.Now.Year, sunStudyData.timeOfYear);

            return($"{day},  " + time);
        }
        public static float GetFloatFromMin(int timeOfDay)
        {
            (int hour, int min) = SunStudyUIController.GetHourMinute(timeOfDay);
            float floatval = hour + (float)min / 60;

            return(floatval);
        }
        // Get Time of Day from dial's float value
        public static int GetMinFromFloat(float value)
        {
            int   hour       = (int)value;
            float percentage = value - hour;
            int   min        = (int)Math.Round(60 * percentage);

            return(SunStudyUIController.GetMinuteOfDay(hour, min));
        }
        public static float GetFloatFromDay(int dayOfYear)
        {
            (int month, int day) = SunStudyUIController.GetMonthDay(DateTime.Now.Year, dayOfYear);
            int   numDays  = DateTime.DaysInMonth(DateTime.Now.Year, month);
            float floatval = month + (float)(day - 1) / numDays;

            return(floatval);
        }
        // Get Day of Year from the dial's float value
        public static int GetDayFromFloat(float value)
        {
            int   month      = (int)Mathf.Clamp(value, 1, 12);
            int   numDays    = DateTime.DaysInMonth(DateTime.Now.Year, month);
            float percentage = value - month;
            int   day        = (int)Math.Round(numDays * percentage);

            return(SunStudyUIController.GetDayOfYear(DateTime.Now.Year, month, day));
        }
        void Start()
        {
            m_HourDialControl.onSelectedValueChanged.AddListener(OnHourDialValueChanged);
            m_MonthDialControl.onSelectedValueChanged.AddListener(OnMonthDialValueChanged);
            m_ResetButton.onClick.AddListener(OnResetButtonClicked);

            m_MainButton.onClick.AddListener(OnMainButtonClicked);
            m_SecondaryButton.onClick.AddListener(OnSecondaryButtonClicked);

            int min, day;

            (m_DefaultHour, min)             = SunStudyUIController.GetHourMinute(UIStateManager.current.stateData.sunStudyData.timeOfDay);
            (m_DefaultMonth, day)            = SunStudyUIController.GetMonthDay(DateTime.Now.Year, UIStateManager.current.stateData.sunStudyData.timeOfYear);
            m_HourDialControl.selectedValue  = m_DefaultHour;
            m_MonthDialControl.selectedValue = m_DefaultMonth;
        }
 string ILabelConverter.ConvertSelectedValLabel(float value, bool isInt)
 {
     return(SunStudyUIController.NameOfMonth((int)value)); // Just display month name of current month
 }
 public string ConvertTickLabels(float value)
 {
     return(SunStudyUIController.NameOfMonth((int)value));
 }