What Changed
We changed the format of dates shown in the Scheduler's Date Navigator. In previous versions, when the Date Navigator showed a date range, the start date had a short format. For example, it did not display the month/year if both the dates in the range had the same month/year: "d - MMMM d, yyyy". However, this algorithm did not work properly for all cultures.
Starting from v24.1, both the dates in the range have the standard .NET format.
We also introduced the DateNavigatorTextTemplate template that allows you to customize text in the Date Navigator. You can use this template to specify the date range's format for certain cultures.
Reasons for Change
In previous versions, the component header may display the incorrect date string in the button for some cultures.
Impact on Existing Apps
This change may affect the appearance of your application if you used views where the Date Navigator displays a date range: Week, Work Week, Timeline, or Day/Month with several units.
How to Update Existing Apps
The new behavior is available out of the box.
If you need to apply custom format to dates for certain cultures, use the DateNavigatorTextTemplate template.
Razor<DateNavigatorTextTemplate>
@if (context.ActiveViewType == SchedulerViewType.Month) {
<div>@context.VisibleTimeRange.Start.ToString("MMM yyyy")</div>
}
else {
<div>@(context.VisibleTimeRange.Start.ToString("dd") + " ~ " + context.VisibleTimeRange.End.ToString("dd MMM yyyy"))</div>
}
</DateNavigatorTextTemplate>