Releases: wrick17/calendar-plugin
v1.4.0
Added the following options
customDateProps
- Function
This function can be used to pass custom classes and data attributes to the date elements. The date is passed as a parameter to the function as a javascript javascript Date object and it should return an object with custom classes and data attributes as following.
{
classes: 'custom-class',
data: {
custom: 'custom-data,
}
}
Example for customDateProps
function
customDateProps: (date) => ({
classes: 'date-element date-element-custom',
data: {
type: 'date',
form: 'date-object'
}
})
customDateHeaderProps
- Function
This function can be used to pass custom classes and data attributes to the week day header elements. The week day number is passed as a parameter to the function as a
Number
and it should return an object with custom classes and data attributes as following.
{
classes: 'custom-class',
data: {
custom: 'custom-data,
}
}
Example for customDateHeaderProps
function
customDateHeaderProps: (weekDay) => ({
classes: 'date-header-element date-header-element-custom',
data: {
type: 'date-header',
form: 'date-header-element'
}
})
customWeekProps
- Function
This function can be used to pass custom classes and data attributes to the week elements. The week number is passed as a parameter to the function as a
Number
and it should return an object with custom classes and data attributes as following.
{
classes: 'custom-class',
data: {
custom: 'custom-data,
}
}
Example for customWeekProps
function
customWeekProps: (weekNo) => ({
classes: 'week-day-element week-day-element-custom',
data: {
type: 'week-day',
form: 'week-day-element'
}
})
v1.3.0
Added some features:
formatWeekDay
- function
This function can be used to pass a custom function to format the week day. The week day is passed as a parameter to the function as a javascript number to according to the
dayMap
oralternateDayMap
and it should return astring
to be shown in the calender's week header.
formatDate
- function
This function can be used to pass a custom function to format date. The date is passed as a parameter to the function as a javascript javascript Date object and it should return the date
string
to be shown in the calendar.
monthMap
- Object
This object is used to map the month number to a string. Very useful for translations. The default is as follows
{
1: "january",
2: "february",
3: "march",
4: "april",
5: "may",
6: "june",
7: "july",
8: "august",
9: "september",
10: "october",
11: "november",
12: "december",
}
dayMap
- Object
This object is used to map the week number to a string. Very useful for translations. The default is as follows
{
0: "sunday",
1: "monday",
2: "tuesday",
3: "wednesday",
4: "thursday",
5: "friday",
6: "saturday",
}
alternateDayMap
- Object
This object is used to map the week number to a string when monday is the start of the week. Very useful for translations. The default is as follows
{
1: "monday",
2: "tuesday",
3: "wednesday",
4: "thursday",
5: "friday",
6: "saturday",
7: "sunday",
}
v1.2.1
v1.2
Feature:
getSelectedDate
- get the current selected date
Bugfix
- Fix bug on wrong dates when
startOnMonday
istrue