DatePicker
It can be declared using the DatePicker Awe helper extension like this:
@Html.Awe().DatePicker(new DatePickerOpt{ Name = "Date", Value = new DateTime(2017, 11, 1)})
Api
$('#id').data('api') | get datepicker api |
api.getDate() | get datepicker value as Date object |
api.setDate(date) | set datepicker value with a Date type parameter |
awem.formatDate(format, val) | format Date value to string using provided format |
awem.parseDate(format, strval) | parse string value to Date type |
DatePickerOpt
DatePicker options
ChangeMonth | Enable the ChangeMonth dropdown in the datepicker popup (default true) |
ChangeYear | Enable the ChangeYear dropdown in the datepicker popup (default true) |
ClearBtn | Clear button |
CssClass | Css class |
DateFormat | Set the date format |
DayFunc | JS function that determines if the date is disabled |
DefaultDate | Set the date to highlight on first opening if the field is blank |
Enabled | Enabled |
FieldAttr | Html attributes for the field element |
InlineCalendar | Show inline calendar |
InputAttr | Html attributes for the input element |
IsRtl | Whether the current language is drawn from right to left |
MaxDate | The maximum selectable date |
MinDate | The minimum selectable date |
Name | The name of the control,
For editors also the name of the form field and the System.Web.Mvc.ViewDataDictionary key
that is used to look up the value |
NumberOfMonths | Number of months to show |
Placeholder | Editor input placeholder |
Prefix | Set Prefix for the html id (use to achieve unique ids for elements with same name) |
ReadonlyInput | Make the text input readonly |
SelectRange | Select a date range |
Value | The value of the element. If this value is null, the value of
the element is retrieved from the System.Web.Mvc.ViewDataDictionary object.
If no value exists there, the value is retrieved from the System.Web.Mvc.ModelStateDictionary object. |
YearRange | The range of years displayed in the year drop-down: either relative to today's year ("-nn:+nn"),
relative to the currently selected year ("c-nn:c+nn"), absolute ("nnnn:nnnn"), or combinations of these formats ("nnnn:-nn") |
Comments