0.6.0 • Published 1 year ago

@foundationcomponentrepo/calendar-date-picker v0.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@foundationcomponentrepo/calendar-date-picker

Base Calendar Date Picker component for foundation

Props

availableSlots: object

The availableSlots prop is used to pass the information regarding the dates available for selection

The object structure is as follows:

availableSlots = {
    [year: number]: {
      [month: number]: Array<number>;
    };
};

startDate?: string

The startDate prop is to set a lower limit for calendar navigation. The string can be of any format that can be accepted by the Date constructor.

endDate?: string

The endDate prop is to set a upper limit for calendar navigation. The string can be of any format that can be accepted by the Date constructor.

onClick: (e: any) => void

The onClick can be used to pass a function to retrieve the date string of the date on which the user clicks.

onChange: (month: number, year: number) => void

The onChange can be used to pass a function to retrieve the month and year of the current calendar being displayed. This function gets triggered everytime the user goes to the next or previous month.

Install

npm install --save @foundationcomponentrepo/calendar-date-picker

License

MIT © unplatforms