Mask in DatePicker when the value is null

Hi folks.
Working with the DatePicker component I saw there is no option to see the mask based on the format date required when the initial value is null. I mean when I enter a valid date but without - or / character to separate the M/d/yyyy the values are not formatted automatically.
As a workaround, I tried to get the correct Date typed by the user(without characters to separate the date I mean if the Date should be 10/4/1997 the user enters 1041997) to Parse it to a valid Date and show in the DatePicker input the value with the character separation, but when getting the args with the ValueChange event I get the min DateValue and no 1041997 value. I am setting the TValue as DateTime? 

I think using the <input id="datepicker" /> <SfMaskedTextBox> is not a workaround since is like building a new component and missing Properties that SfDatePicker has.
Do you have any another suggestion?
I saw there is already a validation to implement the mask in the DatePicker component but not scheduled.

Thnaks for your help in advance

1 Reply

SN Sevvandhi Nagulan Syncfusion Team May 25, 2021 10:48 AM UTC

Hi Adriana, 


Greetings from Syncfusion support. 


We checked your query. If you enter a date without using “/”, then it will be considered as invalid date. So, the component resets the value to null. Hence null value will be received in the change event argument. The reported requirement can be achieved if we provide the mask support to the component. It will be implemented in any one of the upcoming releases before that we will prioritize this feature based on the demands of each release. Also, to make it count, please cast your vote in this feedback. We appreciate your patience until then. 



Regards, 
Sevvandhi N 


Loader.
Up arrow icon