119 references to DateTimeHelper
PresentationFramework (119)
src\Framework\System\Windows\Automation\Peers\CalendarAutomationPeer.cs (2)
191
if (owner.SelectedDate.HasValue &&
DateTimeHelper
.CompareYearMonth(owner.SelectedDate.Value, owner.DisplayDateInternal) == 0)
532
DateTimeFormatInfo format =
DateTimeHelper
.GetCurrentDateFormat();
src\Framework\System\Windows\Automation\Peers\DateTimeAutomationPeer.cs (9)
251
string dateString =
DateTimeHelper
.ToLongDateString(Date,
DateTimeHelper
.GetCulture(OwningCalendar));
254
return string.Format(
DateTimeHelper
.GetCurrentDateFormat(), SR.Get(SRID.CalendarAutomationPeer_BlackoutDayHelpText), dateString);
332
dateString =
DateTimeHelper
.ToLongDateString(Date,
DateTimeHelper
.GetCulture(OwningCalendar));
335
dateString =
DateTimeHelper
.ToYearMonthPatternString(Date,
DateTimeHelper
.GetCulture(OwningCalendar));
338
dateString =
DateTimeHelper
.ToYearString(Date,
DateTimeHelper
.GetCulture(OwningCalendar));
src\Framework\System\Windows\Controls\Calendar.cs (43)
216
c.DisplayDateInternal =
DateTimeHelper
.DiscardDayTime((DateTime)e.NewValue);
447
new FrameworkPropertyMetadata(
DateTimeHelper
.GetCurrentDateFormat().FirstDayOfWeek,
494
int i =
DateTimeHelper
.CompareYearMonth(c.DisplayDateInternal, DateTime.Today);
510
c.SetCurrentValueInternal(FirstDayOfWeekProperty,
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(c)).FirstDayOfWeek);
726
return
DateTimeHelper
.DiscardDayTime(DisplayDate);
778
return this.SelectedDate.Value.ToString(
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(this)));
864
if (
DateTimeHelper
.CompareDays((DateTime)b.DataContext, day) == 0)
906
if (
DateTimeHelper
.CompareYearMonth(selectedDate, this.DisplayDateInternal) != 0)
936
newDate =
DateTimeHelper
.SetYearMonth(this.DisplayDate, d);
943
newDate =
DateTimeHelper
.SetYear(this.DisplayDate, d.Year);
972
result =
DateTimeHelper
.AddMonths(date, offset);
978
result =
DateTimeHelper
.AddYears(date, offset);
984
result =
DateTimeHelper
.AddYears(this.DisplayDate, offset * YEARS_PER_DECADE);
1005
this.SetCurrentValueInternal(DisplayDateProperty,
DateTimeHelper
.DiscardDayTime(d));
1035
MoveDisplayTo(
DateTimeHelper
.DiscardDayTime(nextDate.Value));
1044
MoveDisplayTo(
DateTimeHelper
.DiscardDayTime(nextDate.Value));
1239
if (c.SelectedDate.HasValue &&
DateTimeHelper
.CompareYearMonth(c.SelectedDate.Value, c.DisplayDateInternal) == 0)
1260
if (
DateTimeHelper
.CompareYearMonth(this.CurrentDate, this.DisplayDateInternal) != 0 && currentDayButton != null && !currentDayButton.IsInactive)
1337
DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(
DateTimeHelper
.AddDays(this.CurrentDate, COLS), 1);
1353
DateTime? selectedMonth =
DateTimeHelper
.AddMonths(this.DisplayDate, YEAR_COLS);
1369
DateTime? selectedYear =
DateTimeHelper
.AddYears(this.DisplayDate, YEAR_COLS);
1388
if (
DateTimeHelper
.CompareYearMonth(DateTime.MaxValue, selectedDate.Value) > 0)
1391
selectedDate =
DateTimeHelper
.AddMonths(selectedDate.Value, 1).Value;
1392
selectedDate =
DateTimeHelper
.AddDays(selectedDate.Value, -1).Value;
1414
DateTime? selectedYear = new DateTime(
DateTimeHelper
.EndOfDecade(this.DisplayDate), 1, 1);
1464
DateTime? selectedYear = new DateTime(
DateTimeHelper
.DecadeOfDate(this.DisplayDate), 1, 1);
1478
DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(
DateTimeHelper
.AddDays(this.CurrentDate, moveAmmount), moveAmmount);
1485
DateTime? selectedMonth =
DateTimeHelper
.AddMonths(this.DisplayDate, moveAmmount);
1492
DateTime? selectedYear =
DateTimeHelper
.AddYears(this.DisplayDate, moveAmmount);
1505
DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(
DateTimeHelper
.AddMonths(this.CurrentDate, 1), 1);
1512
DateTime? selectedMonth =
DateTimeHelper
.AddYears(this.DisplayDate, 1);
1519
DateTime? selectedYear =
DateTimeHelper
.AddYears(this.DisplayDate, 10 );
1532
DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(
DateTimeHelper
.AddMonths(this.CurrentDate, -1), -1);
1539
DateTime? selectedMonth =
DateTimeHelper
.AddYears(this.DisplayDate, -1);
1546
DateTime? selectedYear =
DateTimeHelper
.AddYears(this.DisplayDate, -10);
1560
DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(
DateTimeHelper
.AddDays(this.CurrentDate, moveAmmount), moveAmmount);
1567
DateTime? selectedMonth =
DateTimeHelper
.AddMonths(this.DisplayDate, moveAmmount);
1574
DateTime? selectedYear =
DateTimeHelper
.AddYears(this.DisplayDate, moveAmmount);
1673
DateTime? selectedDate = this._blackoutDates.GetNonBlackoutDate(
DateTimeHelper
.AddDays(this.CurrentDate, -COLS), -1);
1689
DateTime? selectedMonth =
DateTimeHelper
.AddMonths(this.DisplayDate, -YEAR_COLS);
1700
DateTime? selectedYear =
DateTimeHelper
.AddYears(this.DisplayDate, -YEAR_COLS);
src\Framework\System\Windows\Controls\CalendarBlackoutDatesCollection.cs (8)
70
rangeStart =
DateTimeHelper
.DiscardTime(start).Value;
71
rangeEnd =
DateTimeHelper
.DiscardTime(end).Value;
75
rangeStart =
DateTimeHelper
.DiscardTime(end).Value;
76
rangeEnd =
DateTimeHelper
.DiscardTime(start).Value;
137
currentDate =
DateTimeHelper
.AddDays(range.End, dayInterval );
143
currentDate =
DateTimeHelper
.AddDays(range.Start, dayInterval );
334
if (
DateTimeHelper
.InRange(day.Value, start, end))
360
if (
DateTimeHelper
.InRange(date, this[i]))
src\Framework\System\Windows\Controls\DatePicker.cs (9)
107
this.SetCurrentValueInternal(FirstDayOfWeekProperty,
DateTimeHelper
.GetCurrentDateFormat().FirstDayOfWeek);
737
return this.SelectedDate.Value.ToString(
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(this)));
992
DateTimeFormatInfo dtfi =
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(this));
1113
newSelectedDate = DateTime.Parse(text,
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(this)));
1274
DateTimeFormatInfo dtfi =
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(this));
src\Framework\System\Windows\Controls\DateTimeHelper.cs (4)
56
return
DateTimeHelper
.AddYears(date, year - date.Year);
64
target =
DateTimeHelper
.AddMonths(target.Value, yearMonth.Month - date.Month);
210
DateTimeFormatInfo format =
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(fe));
src\Framework\System\Windows\Controls\Primitives\CalendarItem.cs (39)
385
if (
DateTimeHelper
.CompareDays(date, (DateTime)b.DataContext) == 0)
405
if (
DateTimeHelper
.CompareYearMonth(date, (DateTime)b.DataContext) == 0)
486
int decade =
DateTimeHelper
.DecadeOfDate(selectedYear);
1024
string[] shortestDayNames =
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(this)).ShortestDayNames;
1038
daytitle.DataContext = shortestDayNames[(childIndex + (int)
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(this)).FirstDayOfWeek) % shortestDayNames.Length];
1047
DateTime firstDayOfMonth =
DateTimeHelper
.DiscardDayTime(DisplayDate);
1050
bool isMinMonth =
DateTimeHelper
.CompareYearMonth(firstDayOfMonth, DateTime.MinValue) <= 0;
1051
bool isMaxMonth =
DateTimeHelper
.CompareYearMonth(firstDayOfMonth, DateTime.MaxValue) >= 0;
1053
CultureInfo culture =
DateTimeHelper
.GetCulture(this);
1068
childButton.SetContentInternal(
DateTimeHelper
.ToDayString(dateToAdd, culture));
1074
childButton.SetContentInternal(
DateTimeHelper
.ToDayString(null, culture));
1088
if (
DateTimeHelper
.CompareDays(dateToAdd.Value, this.Owner.DisplayDateStartInternal) < 0 ||
DateTimeHelper
.CompareDays(dateToAdd.Value, this.Owner.DisplayDateEndInternal) > 0)
1105
DateTimeHelper
.CompareYearMonth(dateToAdd.Value, this.Owner.DisplayDateInternal) != 0);
1108
if (
DateTimeHelper
.CompareDays(dateToAdd.Value, DateTime.Today) == 0)
1126
isSelected |= (
DateTimeHelper
.CompareDays(dateToAdd.Value, item) == 0);
1157
int daysToHighlight =
DateTimeHelper
.CompareDays(owner.HoverEnd.Value, owner.HoverStart.Value);
1177
(daysToHighlight != 0) &&
DateTimeHelper
.InRange(date, hStart, hEnd));
1201
this._headerButton.Content =
DateTimeHelper
.ToYearMonthPatternString(DisplayDate,
DateTimeHelper
.GetCulture(this));
1214
DateTime firstDayOfMonth =
DateTimeHelper
.DiscardDayTime(DisplayDate);
1217
if (
DateTimeHelper
.CompareYearMonth(firstDayOfMonth, DateTime.MaxValue) == 0)
1226
_nextButton.IsEnabled = (
DateTimeHelper
.CompareDays(this.Owner.DisplayDateEndInternal, firstDayOfNextMonth) > -1);
1235
DateTime firstDayOfMonth =
DateTimeHelper
.DiscardDayTime(DisplayDate);
1236
_previousButton.IsEnabled = (
DateTimeHelper
.CompareDays(this.Owner.DisplayDateStartInternal, firstDayOfMonth) < 0);
1259
childButton.SetContentInternal(
DateTimeHelper
.ToYearString(day,
DateTimeHelper
.GetCulture(this)));
1303
childButton.SetContentInternal(
DateTimeHelper
.ToAbbreviatedMonthString(day,
DateTimeHelper
.GetCulture(this)));
1309
childButton.HasSelectedDays = (
DateTimeHelper
.CompareYearMonth(day, this.Owner.DisplayDateInternal) == 0);
1311
if (
DateTimeHelper
.CompareYearMonth(day, this.Owner.DisplayDateStartInternal) < 0 ||
DateTimeHelper
.CompareYearMonth(day, this.Owner.DisplayDateEndInternal) > 0)
1333
this._headerButton.Content =
DateTimeHelper
.ToYearString(DisplayDate,
DateTimeHelper
.GetCulture(this));
1361
this._headerButton.Content =
DateTimeHelper
.ToDecadeRangeString(decade, this);
1396
i = ((day -
DateTimeHelper
.GetDateFormat(
DateTimeHelper
.GetCulture(this)).FirstDayOfWeek + NUMBER_OF_DAYS_IN_WEEK) % NUMBER_OF_DAYS_IN_WEEK);
src\Framework\System\Windows\Controls\SelectedDatesCollection.cs (5)
191
int monthDifference =
DateTimeHelper
.CompareYearMonth(item, this._owner.DisplayDateInternal);
230
int monthDifference =
DateTimeHelper
.CompareYearMonth(this[index], this._owner.DisplayDateInternal);
298
int monthDifference =
DateTimeHelper
.CompareYearMonth(item, this._owner.DisplayDateInternal);
391
if (!this._owner.SelectedDate.HasValue ||
DateTimeHelper
.CompareDays(this._owner.SelectedDate.Value, date) != 0)
508
rangeStart =
DateTimeHelper
.AddDays(rangeStart.Value, increment);