Skip to content

Instantly share code, notes, and snippets.

@cacheflow
Last active June 16, 2019 21:01
Show Gist options
  • Save cacheflow/1697d452762eedec6f3b09dadd970124 to your computer and use it in GitHub Desktop.
Save cacheflow/1697d452762eedec6f3b09dadd970124 to your computer and use it in GitHub Desktop.
const { Scheduler } = require('@ssense/sscheduler');
let scheduler = new Scheduler();
let availability = scheduler.getAvailability({
from: '2017-02-01',
to: '2017-02-02',
duration: 30,
interval: 30,
schedule: {
weekdays: {
from: '09:00', to: '17:00',
unavailability: [
{ from: '12:00', to: '13:00' }
]
},
unavailability: [
// two different types of unavailability structure
{ from: '2017-02-20 00:00', to: '2017-02-27 00:00' },
{ date: '2017-02-15', from: '12:00', to: '13:00' }
],
allocated: [
{ from: '2017-02-01 13:00' , duration: 60 },
{ from: '2017-02-01 14:00' , duration: 60 }
]
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment