DaySpan
A date & schedule library to use for advanced calendars in TypeScript and JS.
TypeScript Example
let cal = Calendar.months<string>();
cal.addSchedule({
event: 'Weekly Meeting',
schedule: new Schedule({
dayOfWeek: [Weekday.MONDAY],
times: [9],
duration: 30,
durationUnit: 'minutes'
})
});
cal.addSchedule({
event: 'Dr. Appointment',
schedule: new Schedule({
on: Day.build(2018, Month.APRIL, 1)
})
});
cal.addSchedule({
event: "Mother's Day",
schedule: new Schedule({
weekspanOfMonth: [1],
dayOfWeek: [Weekday.SUNDAY],
month: [Month.MAY]
})
});
cal.days;
cal.next();
cal.select(Day.build(2018, Month.APRIL, 12));
cal.removeSchedule('Weekly Meeting');
Calendar.weeks<MyEvent>();
Calendar.days<string>(3);
Calendar.days<string>(3, Day.build(2018, Month.JUNE, 15), 0);
JS Example
You just need to append ds
to the beginning of the classes:
var cal = ds.Calendar.months();
cal.addSchedule({
event: 'Weekly Meeting',
schedule: new ds.Schedule({
dayOfWeek: [ds.Weekday.MONDAY],
times: [9],
duration: 30,
durationUnit: 'minutes'
})
});
cal.addSchedule({
event: 'Dr. Appointment',
schedule: new ds.Schedule({
on: ds.Day.build(2018, ds.Month.APRIL, 1)
})
});
Google Calendar Clone Preview
Month View
Week View
Schedule an Event
Custom Schedule
Year View