Breaking Change T1256580
Visible to All Users

Scheduler for Blazor - A format for date ranges was changed in the Date Navigator element

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.

Clipboard-File-3.png

Starting from v24.1, both the dates in the range have the standard .NET format.

Clipboard-File-4.png

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>

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.