Display formatted DateTime in textbox

Hi Team,

We are using ejDateTimePicker in our project and want to display formatted datetime in textbox which is attach to ejDateTimePicker.


dateime format we are using is MM/dd/yyyy h:mm:ss and below is my code


$('#FieldDate1').ejDateTimePicker({
timeDisplayFormat: "h:mm:ss",
dateTimeFormat: "MM/dd/yyyy h:mm:ss",
allowEdit: true,
});

@Html.TextBoxFor(model => model.FieldDate1, "{0:MM/dd/yyyy h:mm:ss}", new { @class = "form-control" })

So how can we display datetime in given format in textbox.

 


1 Reply 1 reply marked as answer

MK Muthukrishnan Kandasamy Syncfusion Team December 16, 2020 11:40 AM UTC

 
Hi Prashant, 
 
Thanks for contacting Syncfusion support. 
 
We have validated your reported problem in EJ DateTimePicker control. But, we were unable to reproduce your reported problem in our end. The DateTimePicker control shows the expected value in textbox. Please refer to the below link for the sample. 
 
 
Please check the output screenshot of the shared sample. 
 
 
 
 
Please check the above sample, if the issue still persists in your application. Please share some additional details it will be help us to provide you the prompt solution. 
 
1.     If you face any script error in console window of the browser, then please share us those error screenshots. 
2.     Share us the issue replicating sample or else replicate your reported issue in the shared sample. 
3.     Share us the screen recorded video with issue replicating steps. 
 
 
Regards, 
Muthukrishnan K 
 


Marked as answer
Loader.
Up arrow icon