I have a datepicker control used with a textbox to show calendar dates.
@Html.TextBoxFor(x => x.CheckDate, new
{
@class = "text_dropdown_corner text-forty-seven-percent",
data_datepicker = "true",
size = 11,
data_min_date = DateTime.Today
})
In js file , i read this value as :
dateFormat(this.metaData.getDateElementValue().val(), "mm/dd/yyyy HH:MM:ss")
data_min_date is used since dates are to be restricted in the calendar. dateFormat is used since i send this date as json to the controller.
Even if no value is selected for calendar control , the dateFormat returns value as DateTime.Today. If no value is selected, i need to show null or empty value as date. Any solution for this?