InputDateRange allows you to set the date format for displaying the date range in a specified format. You can use Format property to set the standard date format or any other date format of your choice for the InputDateRange control.
The following code showcases the use of Format property to set "dd-MMM-yy" date format for the displayed date range in the control.
Index.cshtml |
Copy Code
|
---|---|
@{ var today = DateTime.Now.Date; var rangeEnd = today.AddDays(4); } @(Html.C1().InputDateRange().Id("demoControl") .Value(today) .RangeEnd(rangeEnd) .Format("dd-MMM-yy") ) |