Methods
info
Here all methods of the MCDatepicker
are described.
#
MCDatepickercreate()
#
Creates a new calendar instance, and adds it to the instance array.
#
PropsProp | Type | Description | Required |
---|---|---|---|
options | Object | Options object | Yes |
#
ReturnReturns a new calendar Instance.
remove()
#
Removes an instance from the instance array.
#
PropsProp | Type | Default | Description | Required |
---|---|---|---|---|
instance | Object | undefined | Instance object | Yes |
open()
#
Opens the calendar UI and applies the settings of instance that are linked to the provided element id
#
PropsProp | Type | Default | Description | Required |
---|---|---|---|---|
id | String | undefined | Element id | Yes |
close()
#
Hides the calendar UI.
#
Instanceopen()
#
Opens the calendar UI and applies the settings of current instance.
close()
#
Hides the calendar UI.
reset()
#
Deletes the value of linked element and sets the picked date to null
.
destroy()
#
Removes the calendar instance from instance array.
getDay()
#
Returns the index of the weekday if a date was picked otherwise returns null
.
getDate()
#
Returns the day of the month if a date was picked otherwise returns null
.
getMonth()
#
Returns the index of the month if a date was picked otherwise returns null
.
getYear()
#
Returns the year if a date was picked otherwise returns null
.
getFullDate()
#
Returns the date object if a date was picked otherwise returns null
.
getFormatedDate()
#
Returns the formated date if a date was picked otherwise it returns null
.
markDatesCustom()
#
Pushes the provided callback to an array.
When the calendar table is updated it passes each date of the calendar table through the callback array and marks the date if at least one callback returns true
.
#
callback propsProp | Type | Required |
---|---|---|
date | Object | No |
setFullDate()
#
This method sets the instance's picket date and updates the linked element's value if the instance has one.
If the instance is active the calendar updates its content based on the new provided date.
Prop | Type | Required |
---|---|---|
date | Date | Yes |
setDate()
#
This method changes the day of the month of the instance's picket date and updates the linked element's value if the instance has one.
If the picked date is null
MCDatepicker creates a new date and uses it as a new picked date.
If the instance is active, the calendar updates its content based on the modified picked date.
Prop | Type | Required |
---|---|---|
date | Number | Yes |
setMonth()
#
This method sets the month for the instance's picked date and updates the linked element's value if the instance has one.
If the picked date is null
MCDatepicker creates a new date and uses it as a new picked date.
If the instance is active, the calendar updates its content based on the modified picked date.
Prop | Type | Required |
---|---|---|
Month | Number | Yes |
setYear()
#
This method sets the year for the instance's picked date and updates the linked element's value if the instance has one.
If the picked date is null
MCDatepicker creates a new date and uses it as a new picked date.
If the instance is active, the calendar updates its content based on the modified picked date.
Prop | Type | Required |
---|---|---|
year | Number | Yes |