DatePicker - Date Only

I have a DateTime property on my model, but I want it to display date only and only allow the date to be selected on the control. I couldn't find a way to do this with the ejDatePicker.

        $("#ReportDate").ejDatePicker({ dateFormat: "dd/MM/yyyy" });


3 Replies 1 reply marked as answer

KR Keerthana Rajendran Syncfusion Team November 6, 2020 12:00 PM UTC

Hi Brad, 
 
Thanks for contacting Syncfusion support. 
 
Based on your update, we suspect that you need to display the selected date alone in ejDatePicker without month and year. If so , then you can set the dateFormat as “dd” as shown below 
 
$("#datepick").ejDatePicker({value: new Date(),dateFormat: "dd" }); 
 
Refer to the sample link below 
 
 
 
If we have misunderstood your requirement, kindly share us some clear details on your requirement to assist you promptly. 
 
Regards, 
Keerthana.  



BS Brad Shannon November 6, 2020 12:45 PM UTC

No, I need to show the date as MM/dd/yyyy. The problem is that the datepicker is showing the time selector as well. I don't want to display the time selector. The property type on the .NET side is DateTime.


MK Muthukrishnan Kandasamy Syncfusion Team November 9, 2020 08:56 AM UTC

 
Hi Brad, 
 
Thanks for the update. 
 
We were unable to predict your requirement with your provided information. We suspect that you are using DateTimePicker component instead of using DatePicker component. Because, we have not provided time selector for DatePicker component. In EJ DatePicker, even if you assign the date with time, it will only not consider the given time for any date, time will always remain as 00:00. Please refer to the below documentations and demos to know more about DatePicker and DateTimePicker component. 
 
DatePicker: 
 
 
 
 
 
DateTimePicker: 
 
 
 
 
 
If we misunderstood your requirement, please share us some additional details. It will be help us to provide you the prompt solution. 
 
  1. Please confirm, whether you are using DatePicker or DateTimePicker control ?
  2. Share us the exact requirement with Syncfusion controls.
  3. Share us the code block of Syncfusion controls.
  4. Share the screenshot of the requirement.
  5. Share us the screen recorded video of your requirement.
 
 
Regards, 
Muthukrishnan K 


Marked as answer
Loader.
Up arrow icon