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

DateTimePicker incorrect parsing when user types in date

Repro steps:
  1. use day-month-year format
  2. user types in date for April 2 2021, as 02-04-21, but no time
  3. blur element
Expected: DateTimePicker should keep date as April 2, and fill in time as midnight.

Actual results: DateTimePicker flips month and day, and thus the date becomes February 4.

Sandbox sample:  https://stackblitz.com/edit/angular-d6vodg-w55dsy?file=app.component.ts



3 Replies 1 reply marked as answer

BN Bill Naples April 12, 2021 09:39 AM UTC

Hi do you have an update on this bug? Thanks.


JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team April 14, 2021 10:16 AM UTC

Hello Bill, 

Sorry for the inconvenience caused. 

We are validating the reported issue. We will check and update the further details in two business days (15/04/2021). 

We appreciate your patience until then. 

Thanks, 
Jeyanth. 



JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team April 15, 2021 02:47 PM UTC

Hello Bill, 

Thanks for the patience. 

We validated the reported issue. We would like to know you that we parse the input element value in to date and convert those value in to desired format based on the format provided. Since provided format includes the time format and the entered value does not contain the same (input element value will only contain date value not time value in this case), default format parsing for date (mm/dd/yyyy) will be considered. Therefore, month and date gets swapped. We also tried to handle this scenario. As we have multiple formats for date and time, we need to handle this generically and it breaks the existing behaviour. We deeply regret for this inconvenience caused. However, we already planned to provide mask support for DateTimepicker control. If this is implemented, user has to enter the date and time based on the format. This feature will be implemented and will be included in any of the upcoming releases. You can track the status of the feature using the below feedback link. 


We value your patience. 

Regards, 
Jeyanth. 


Marked as answer
Loader.
Up arrow icon