Install the package
Through NPM
npm install cronus-calendar
Through Yarn
yarn add cronus--calendar
Add css and js builds in your HTML
Add the cronus element in your html
API
-
ondateselected
: Provided callback for when a date has been selectedlet cal = document;// Date selected// Called when a date is clickedcal {console;console;} -
onmonthchange
: Provided callback for when the next / prev button has been clickedlet cal = document;// Month change event// Called when next / prev button has been changedcal {console;console} -
ongeneratedots
: Provided callback for when the calendar is rendering the dates. Here you have do option to populate some dots in the date. This callback provides a date and expects astring[]
to be returned
let cal = document; // Callback that listens to when the calendar is populating dates // Expects an array of strings containing colors // Can provide hex or a standard color value cal { hasEvent = ...; hasMeeting = ...; if hasEvent dots; if hasMeeting dots; return dots; }
init(date?: Date | string)
: Initializes the Calendarselect(date?: Date | string)
: Selects a date, also triggersondateselected