availability-scheduler
v3.0.200
Published
Availability Scheduler - React Component
Downloads
767
Maintainers
Keywords
Readme
availability-scheduler
Wix availability representation
{
"periods": [
{
"openDay": "SUNDAY", // uppercase day
"openTime": "00:20", // time HH:mm
"closeDay": "SUNDAY",
"closeTime": "00:30"
}
],
"specialHourPeriods": [
{
"startDate": "2020-09-09T08:48:04.337Z", // date object
"endDate": "2020-10-09T08:48:04.337Z", // date object
"isClosed": true,
"comment": "foo"
}
]
}
Restaurants availability representation
{
"weekly": [
{
"minuteOfWeek": 20, // week minutes are between 0 - 10080
"durationMins": 10 // duration in minutes
}
],
"exceptions": [
{
"available": false,
"comment": {
"en_US": "foo"
},
"start": {
"year": 2020,
"month": 9,
"day": 9,
"hour": 9,
"minute": 48
},
"end": {
"year": 2020,
"month": 10,
"day": 9,
"hour": 9,
"minute": 48
}
}
]
}
A React component for editing availability time schedules
Installation
$ npm i availability-scheduler
Instantiation
import { AvailabilityEditor } from 'availability-scheduler';
<AvailabilityEditor
timezone='Europe/London'
availability={availability}
onAccept={availability => console.log('accepted', availability)}
language="en"
businessLocale="en_US"
/>