npm.io
0.6.0 • Published 3 years ago

@foundationcomponentrepo/calendar-date-picker

Licence
MIT
Version
0.6.0
Deps
3
Size
315 kB
Vulns
0
Weekly
0

@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