We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DatePicker - handling various formats typed in by user

Hello


I have a date picker on an edit form setup like this:

  <SfDatePicker id="selected-receipt-date" CssClass="e-outline" StrictMode=true Min="AppStateService.MinEntryDate" Max="AppStateService.MaxEntryDate" Format="@AppStateService.CultureDateFormat" TValue="DateTime" @bind-value="SelectedReceipt.ReceiptDate" Placeholder="Date" FloatLabelType="@FloatLabelType.Auto"></SfDatePicker>

When @AppStateService.CultureDateFormat = "dd/mm/yyyy" then I would like the user to be able to enter any of the following (by typing rather than using the calendar and mouse):

  • 09/12/2023
  • 9/12/2023
  • 9/12/23

Since strict mode is set to true then all but the top example above fail. If I switch strict mode to false then it allows entry but my validation fires. Ideally it would be great if the control would accept any of the above inputs, but automatically changed them to display 09/12/2023.

It's actually quite important for rapid data entry.

Is this possible?


Many thanks







1 Reply

UD UdhayaKumar Duraisamy Syncfusion Team February 6, 2023 03:46 PM UTC

We have already considered the ‘Support for Blazor DatePicker to accept the date value which is in all applicable formats’ as a feature request in our end and this will be available in any of our upcoming future releases. we will consider the feature and implement in a certain release based on the customer request count and priority. You can track the status of the feature from the below link.


Feedback linkhttps://www.syncfusion.com/feedback/30946/support-for-blazor-datepicker-to-accept-the-date-value-which-is-in-all-applicable


Loader.
Live Chat Icon For mobile
Up arrow icon