121 references to DateTimeHelper
PresentationFramework (121)
System\Windows\Automation\Peers\CalendarAutomationPeer.cs (2)
184if (owner.SelectedDate.HasValue && DateTimeHelper.CompareYearMonth(owner.SelectedDate.Value, owner.DisplayDateInternal) == 0) 516DateTimeFormatInfo format = DateTimeHelper.GetCurrentDateFormat();
System\Windows\Automation\Peers\DateTimeAutomationPeer.cs (9)
236string dateString = DateTimeHelper.ToLongDateString(Date, DateTimeHelper.GetCulture(OwningCalendar)); 239return string.Format(DateTimeHelper.GetCurrentDateFormat(), SR.CalendarAutomationPeer_BlackoutDayHelpText, dateString); 317dateString = DateTimeHelper.ToLongDateString(Date, DateTimeHelper.GetCulture(OwningCalendar)); 320dateString = DateTimeHelper.ToYearMonthPatternString(Date, DateTimeHelper.GetCulture(OwningCalendar)); 323dateString = DateTimeHelper.ToYearString(Date, DateTimeHelper.GetCulture(OwningCalendar));
System\Windows\Controls\Calendar.cs (43)
211c.DisplayDateInternal = DateTimeHelper.DiscardDayTime((DateTime)e.NewValue); 442new FrameworkPropertyMetadata(DateTimeHelper.GetCurrentDateFormat().FirstDayOfWeek, 489int i = DateTimeHelper.CompareYearMonth(c.DisplayDateInternal, DateTime.Today); 505c.SetCurrentValueInternal(FirstDayOfWeekProperty, DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(c)).FirstDayOfWeek); 721return DateTimeHelper.DiscardDayTime(DisplayDate); 773return this.SelectedDate.Value.ToString(DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(this))); 859if (DateTimeHelper.CompareDays((DateTime)b.DataContext, day) == 0) 901if (DateTimeHelper.CompareYearMonth(selectedDate, this.DisplayDateInternal) != 0) 931newDate = DateTimeHelper.SetYearMonth(this.DisplayDate, d); 938newDate = DateTimeHelper.SetYear(this.DisplayDate, d.Year); 967result = DateTimeHelper.AddMonths(date, offset); 973result = DateTimeHelper.AddYears(date, offset); 979result = DateTimeHelper.AddYears(this.DisplayDate, offset * YEARS_PER_DECADE); 1000this.SetCurrentValueInternal(DisplayDateProperty, DateTimeHelper.DiscardDayTime(d)); 1030MoveDisplayTo(DateTimeHelper.DiscardDayTime(nextDate.Value)); 1039MoveDisplayTo(DateTimeHelper.DiscardDayTime(nextDate.Value)); 1234if (c.SelectedDate.HasValue && DateTimeHelper.CompareYearMonth(c.SelectedDate.Value, c.DisplayDateInternal) == 0) 1255if (DateTimeHelper.CompareYearMonth(this.CurrentDate, this.DisplayDateInternal) != 0 && currentDayButton != null && !currentDayButton.IsInactive) 1332DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(DateTimeHelper.AddDays(this.CurrentDate, COLS), 1); 1348DateTime? selectedMonth = DateTimeHelper.AddMonths(this.DisplayDate, YEAR_COLS); 1364DateTime? selectedYear = DateTimeHelper.AddYears(this.DisplayDate, YEAR_COLS); 1381if (DateTimeHelper.CompareYearMonth(DateTime.MaxValue, selectedDate.Value) > 0) 1384selectedDate = DateTimeHelper.AddMonths(selectedDate.Value, 1).Value; 1385selectedDate = DateTimeHelper.AddDays(selectedDate.Value, -1).Value; 1406DateTime? selectedYear = new DateTime(DateTimeHelper.EndOfDecade(this.DisplayDate), 1, 1); 1456DateTime? selectedYear = new DateTime(DateTimeHelper.DecadeOfDate(this.DisplayDate), 1, 1); 1470DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(DateTimeHelper.AddDays(this.CurrentDate, moveAmmount), moveAmmount); 1477DateTime? selectedMonth = DateTimeHelper.AddMonths(this.DisplayDate, moveAmmount); 1484DateTime? selectedYear = DateTimeHelper.AddYears(this.DisplayDate, moveAmmount); 1497DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(DateTimeHelper.AddMonths(this.CurrentDate, 1), 1); 1504DateTime? selectedMonth = DateTimeHelper.AddYears(this.DisplayDate, 1); 1511DateTime? selectedYear = DateTimeHelper.AddYears(this.DisplayDate, 10 ); 1524DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(DateTimeHelper.AddMonths(this.CurrentDate, -1), -1); 1531DateTime? selectedMonth = DateTimeHelper.AddYears(this.DisplayDate, -1); 1538DateTime? selectedYear = DateTimeHelper.AddYears(this.DisplayDate, -10); 1552DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(DateTimeHelper.AddDays(this.CurrentDate, moveAmmount), moveAmmount); 1559DateTime? selectedMonth = DateTimeHelper.AddMonths(this.DisplayDate, moveAmmount); 1566DateTime? selectedYear = DateTimeHelper.AddYears(this.DisplayDate, moveAmmount); 1665DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(DateTimeHelper.AddDays(this.CurrentDate, -COLS), -1); 1681DateTime? selectedMonth = DateTimeHelper.AddMonths(this.DisplayDate, -YEAR_COLS); 1692DateTime? selectedYear = DateTimeHelper.AddYears(this.DisplayDate, -YEAR_COLS);
System\Windows\Controls\CalendarBlackoutDatesCollection.cs (8)
67rangeStart = DateTimeHelper.DiscardTime(start).Value; 68rangeEnd = DateTimeHelper.DiscardTime(end).Value; 72rangeStart = DateTimeHelper.DiscardTime(end).Value; 73rangeEnd = DateTimeHelper.DiscardTime(start).Value; 134currentDate = DateTimeHelper.AddDays(range.End, dayInterval ); 139currentDate = DateTimeHelper.AddDays(range.Start, dayInterval ); 329if (DateTimeHelper.InRange(day.Value, start, end)) 352if (DateTimeHelper.InRange(date, this[i]))
System\Windows\Controls\DatePicker.cs (11)
103this.SetCurrentValueInternal(FirstDayOfWeekProperty, DateTimeHelper.GetCurrentDateFormat().FirstDayOfWeek); 399datePicker.SetCurrentValueInternal(FirstDayOfWeekProperty, DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(datePicker)).FirstDayOfWeek); 744return this.SelectedDate.Value.ToString(DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(this))); 999DateTimeFormatInfo dtfi = DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(this)); 1120newSelectedDate = DateTime.Parse(text, DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(this))); 1281DateTimeFormatInfo dtfi = DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(this));
System\Windows\Controls\DateTimeHelper.cs (4)
54return DateTimeHelper.AddYears(date, year - date.Year); 62target = DateTimeHelper.AddMonths(target.Value, yearMonth.Month - date.Month); 208DateTimeFormatInfo format = DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(fe));
System\Windows\Controls\Primitives\CalendarItem.cs (39)
379if (DateTimeHelper.CompareDays(date, (DateTime)b.DataContext) == 0) 399if (DateTimeHelper.CompareYearMonth(date, (DateTime)b.DataContext) == 0) 480int decade = DateTimeHelper.DecadeOfDate(selectedYear); 1016string[] shortestDayNames = DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(this)).ShortestDayNames; 1030daytitle.DataContext = shortestDayNames[(childIndex + (int)DateTimeHelper.GetDateFormat( DateTimeHelper.GetCulture(this)).FirstDayOfWeek) % shortestDayNames.Length]; 1039DateTime firstDayOfMonth = DateTimeHelper.DiscardDayTime(DisplayDate); 1042bool isMinMonth = DateTimeHelper.CompareYearMonth(firstDayOfMonth, DateTime.MinValue) <= 0; 1043bool isMaxMonth = DateTimeHelper.CompareYearMonth(firstDayOfMonth, DateTime.MaxValue) >= 0; 1045CultureInfo culture = DateTimeHelper.GetCulture(this); 1060childButton.SetContentInternal(DateTimeHelper.ToDayString(dateToAdd, culture)); 1066childButton.SetContentInternal(DateTimeHelper.ToDayString(null, culture)); 1080if (DateTimeHelper.CompareDays(dateToAdd.Value, this.Owner.DisplayDateStartInternal) < 0 || DateTimeHelper.CompareDays(dateToAdd.Value, this.Owner.DisplayDateEndInternal) > 0) 1097DateTimeHelper.CompareYearMonth(dateToAdd.Value, this.Owner.DisplayDateInternal) != 0); 1100if (DateTimeHelper.CompareDays(dateToAdd.Value, DateTime.Today) == 0) 1118isSelected |= (DateTimeHelper.CompareDays(dateToAdd.Value, item) == 0); 1149int daysToHighlight = DateTimeHelper.CompareDays(owner.HoverEnd.Value, owner.HoverStart.Value); 1169(daysToHighlight != 0) && DateTimeHelper.InRange(date, hStart, hEnd)); 1193this._headerButton.Content = DateTimeHelper.ToYearMonthPatternString(DisplayDate, DateTimeHelper.GetCulture(this)); 1206DateTime firstDayOfMonth = DateTimeHelper.DiscardDayTime(DisplayDate); 1209if (DateTimeHelper.CompareYearMonth(firstDayOfMonth, DateTime.MaxValue) == 0) 1218_nextButton.IsEnabled = (DateTimeHelper.CompareDays(this.Owner.DisplayDateEndInternal, firstDayOfNextMonth) > -1); 1227DateTime firstDayOfMonth = DateTimeHelper.DiscardDayTime(DisplayDate); 1228_previousButton.IsEnabled = (DateTimeHelper.CompareDays(this.Owner.DisplayDateStartInternal, firstDayOfMonth) < 0); 1251childButton.SetContentInternal(DateTimeHelper.ToYearString(day, DateTimeHelper.GetCulture(this))); 1295childButton.SetContentInternal(DateTimeHelper.ToAbbreviatedMonthString(day, DateTimeHelper.GetCulture(this))); 1300childButton.HasSelectedDays = (DateTimeHelper.CompareYearMonth(day, this.Owner.DisplayDateInternal) == 0); 1302if (DateTimeHelper.CompareYearMonth(day, this.Owner.DisplayDateStartInternal) < 0 || DateTimeHelper.CompareYearMonth(day, this.Owner.DisplayDateEndInternal) > 0) 1324this._headerButton.Content = DateTimeHelper.ToYearString(DisplayDate, DateTimeHelper.GetCulture(this)); 1352this._headerButton.Content = DateTimeHelper.ToDecadeRangeString(decade, this); 1387i = ((day - DateTimeHelper.GetDateFormat(DateTimeHelper.GetCulture(this)).FirstDayOfWeek + NUMBER_OF_DAYS_IN_WEEK) % NUMBER_OF_DAYS_IN_WEEK);
System\Windows\Controls\SelectedDatesCollection.cs (5)
186int monthDifference = DateTimeHelper.CompareYearMonth(item, this._owner.DisplayDateInternal); 225int monthDifference = DateTimeHelper.CompareYearMonth(this[index], this._owner.DisplayDateInternal); 293int monthDifference = DateTimeHelper.CompareYearMonth(item, this._owner.DisplayDateInternal); 386if (!this._owner.SelectedDate.HasValue || DateTimeHelper.CompareDays(this._owner.SelectedDate.Value, date) != 0) 503rangeStart = DateTimeHelper.AddDays(rangeStart.Value, increment);