new mw.widgets.CalendarWidget(configopt)
#
Creates an mw.widgets.CalendarWidget object.
You will most likely want to use mw.widgets.DateInputWidget instead of CalendarWidget directly.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
<optional> |
Configuration options Properties
|
Extends
Properties
flippedPositions :Object.<string, string>static
#
Positions to flip to if there isn't room in the container for the menu in a specific direction.
Type:
- Object.<string, string>
Positions to flip to if there isn't room in the container for the menu in a specific direction.
Methods
getDate() → {string|null
}
#
null
}
#
Get current date, in the format 'YYYY-MM-DD' or 'YYYY-MM', depending on precision. Digits will not be localised.
Returns:
Date string
- Type
-
string
|
null
resetUI()
#
Reset the user interface of this widget to reflect selected date.
setDate(dateopt)
#
Set the date.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
date |
string
|
null
|
<optional> |
null | Day or month date, in the format 'YYYY-MM-DD' or 'YYYY-MM'. When null, the calendar will show today's date, but not select it. When invalid, the date is not changed. |
setMoment(mom)
#
Set the date that is shown in the calendar, but not the selected date.
Parameters:
Name | Type | Description |
---|---|---|
mom |
Object | Moment object |
toggle()
#
Events
change(date)
#
A change event is emitted when the chosen date changes.
Parameters:
Name | Type | Description |
---|---|---|
date |
string | Day or month date, in the format 'YYYY-MM-DD' or 'YYYY-MM' |