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
ChangeMonthEnable the ChangeMonth dropdown in the datepicker popup (default true)
ChangeYearEnable the ChangeYear dropdown in the datepicker popup (default true)
ClearBtnClear button
CssClassCss class
DateFormatSet the date format
DayFuncJS function that determines if the date is disabled
DefaultDateSet the date to highlight on first opening if the field is blank
EnabledEnabled
FieldAttrHtml attributes for the field element
InlineCalendarShow inline calendar
InputAttrHtml attributes for the input element
IsRtlWhether the current language is drawn from right to left
MaxDateThe maximum selectable date
MinDateThe minimum selectable date
NameThe 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
NumberOfMonthsNumber of months to show
PlaceholderEditor input placeholder
PrefixSet Prefix for the html id (use to achieve unique ids for elements with same name)
ReadonlyInputMake the text input readonly
SelectRangeSelect a date range
ValueThe 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.
YearRangeThe 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
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our cookie policy and privacy policy .