Skip to content

Releases: wrick17/calendar-plugin

v1.4.0

10 Jan 12:01
Compare
Choose a tag to compare

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

17 Dec 15:37
Compare
Choose a tag to compare

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 or alternateDayMap and it should return a string 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

31 Aug 06:09
Compare
Choose a tag to compare

Bugfix for Safari.

v1.2

28 Jul 11:33
Compare
Choose a tag to compare

Feature:

  • getSelectedDate - get the current selected date

Bugfix

  • Fix bug on wrong dates when startOnMonday is true

v1.1

31 Mar 10:51
a006331
Compare
Choose a tag to compare

Added the startOnMonday flag. This allows you to start the month on Monday instead of Sunday.

v1.0

30 Mar 10:39
ffac0a1
Compare
Choose a tag to compare

First stable release