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