Пример #1
0
    void SetDayToggle(DayToggle dayToggle, DateTime toggleDate)
    {
        dayToggle.interactable = ((!ForwardPickOnly || (ForwardPickOnly && !toggleDate.IsPast())) && toggleDate.IsSameYearMonth(m_DisplayDate));
        dayToggle.name         = String.Format("Day Toggle ({0} {1})", toggleDate.ToString("MMM"), toggleDate.Day);
        dayToggle.SetText(toggleDate.Day.ToString());
        dayToggle.dateTime = toggleDate;

        dayToggle.isOn = (SelectedDate != null) && ((DateTime)SelectedDate).IsSameDate(toggleDate);
    }
Пример #2
0
        void SetDayToggle(DayToggle dayToggle, DateTime toggleDate)
        {
            dayToggle.onDateSelected.RemoveListener(OnDaySelected);

            dayToggle.interactable = ((!ForwardPickOnly || (ForwardPickOnly && !toggleDate.IsPast())) && toggleDate.IsSameYearMonth(m_DisplayDate));
            dayToggle.name         = String.Format("Day Toggle ({0} {1})", toggleDate.ToString("MMM"), toggleDate.Day);
            dayToggle.SetText(toggleDate.Day.ToString());
            dayToggle.dateTime = toggleDate;
            dayToggle.isOn     = SelectedDate.IsSameDate(toggleDate);

            dayToggle.onDateSelected.AddListener(OnDaySelected);
        }