-
Notifications
You must be signed in to change notification settings - Fork 0
Home
MatsMaker edited this page Aug 15, 2017
·
2 revisions
const shedule = {
week: [
{
indexOfday: 0, // Index of day
from: 28800, // Start of work day this is number seconds from start the day
to: 63000, // End of work day this is number seconds from start the day
isActive: true // Toggler - active or not active this day. Possibly will need when schedule will be editing and need show some time
}, {
indexOfday: 1,
from: 28800,
to: 63000,
isActive: true
}, {
indexOfday: 2,
from: 28800,
to: 63000,
isActive: true
}, {
indexOfday: 3,
from: 28800,
to: 63000,
isActive: true
}, {
indexOfday: 4,
from: 28800,
to: 63000,
isActive: true
}, {
indexOfday: 5,
from: null,
to: null,
isActive: false
}, {
indexOfday: 6,
from: null,
to: null,
isActive: false
}
],
exceptions: [] // also you can set exceptions
};
const timetable = new Timetable(shedule);
const startTimeDuration = 1492437600 // 2017-04-17T14:00:00
const endTimeDuration = 1492448400 // 2017-04-17T20:00:00
const result = timetable.timeOfDuration(1492437600, 1492448400)); // 12600 this is 3:30 work's time by shedule