Schedule
A Google Calendar–style grid for day, week and weekday views. Drag events to move them, drag their edges to resize, or drag across empty slots to create one.
<html>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/style.min.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<script src="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/index.min.js"></script>
<div id="root" style="height: 520px;"></div>
<script>
const { Schedule } = calendarjs;
// Dates relative to today, so the week is never empty.
const day = function(offset) {
const d = new Date();
d.setDate(d.getDate() + offset);
return d.toLocaleDateString('en-CA');
};
Schedule(document.getElementById('root'), {
type: 'week',
value: day(0),
validRange: ['08:00', '19:00'],
data: [
{ guid: '1', title: 'Team standup', date: day(0), start: '09:00', end: '09:30', color: '#a159ff' },
{ guid: '2', title: 'Design review', date: day(1), start: '11:00', end: '12:30', color: '#3164cb' },
{ guid: '3', title: 'Lunch with client', date: day(-1), start: '12:30', end: '13:30', color: '#33b679' },
{ guid: '4', title: 'Release', date: day(2), start: '15:00', end: '16:00', color: '#e67c73' }
],
onchangeevent: function(self, event, oldValue, newValue) {
console.log('Updated:', event.title, newValue);
}
});
</script>
</html>import { Schedule } from '@calendarjs/ce';
import '@calendarjs/ce/dist/style.css';
const day = (offset) => {
const d = new Date();
d.setDate(d.getDate() + offset);
return d.toLocaleDateString('en-CA');
};
Schedule(document.getElementById('root'), {
type: 'week',
value: day(0),
validRange: ['08:00', '19:00'],
data: [
{ guid: '1', title: 'Team standup', date: day(0), start: '09:00', end: '09:30', color: '#a159ff' },
{ guid: '2', title: 'Design review', date: day(1), start: '11:00', end: '12:30', color: '#3164cb' },
{ guid: '3', title: 'Lunch with client', date: day(-1), start: '12:30', end: '13:30', color: '#33b679' },
{ guid: '4', title: 'Release', date: day(2), start: '15:00', end: '16:00', color: '#e67c73' }
],
onchangeevent: (self, event, oldValue, newValue) => {
console.log('Updated:', event.title, newValue);
}
});import { useState } from 'react';
import { Schedule } from '@calendarjs/ce/dist/react';
import '@calendarjs/ce/dist/style.css';
const day = (offset) => {
const d = new Date();
d.setDate(d.getDate() + offset);
return d.toLocaleDateString('en-CA');
};
export default function App() {
const [events] = useState([
{ guid: '1', title: 'Team standup', date: day(0), start: '09:00', end: '09:30', color: '#a159ff' },
{ guid: '2', title: 'Design review', date: day(1), start: '11:00', end: '12:30', color: '#3164cb' },
{ guid: '3', title: 'Lunch with client', date: day(-1), start: '12:30', end: '13:30', color: '#33b679' },
{ guid: '4', title: 'Release', date: day(2), start: '15:00', end: '16:00', color: '#e67c73' }
]);
return (
<Schedule
type="week"
value={day(0)}
validRange={['08:00', '19:00']}
data={events}
onchangeevent={(self, event, oldValue, newValue) => console.log('Updated:', event.title, newValue)}
style={{ height: '520px' }}
/>
);
}<template>
<Schedule
type="week"
:value="today"
:validRange="['08:00', '19:00']"
:data="events"
:onchangeevent="onUpdate"
style="height: 520px"
/>
</template>
<script>
import { Schedule } from '@calendarjs/ce/dist/vue';
import '@calendarjs/ce/dist/style.css';
const day = (offset) => {
const d = new Date();
d.setDate(d.getDate() + offset);
return d.toLocaleDateString('en-CA');
};
export default {
components: { Schedule },
data() {
return {
today: day(0),
events: [
{ guid: '1', title: 'Team standup', date: day(0), start: '09:00', end: '09:30', color: '#a159ff' },
{ guid: '2', title: 'Design review', date: day(1), start: '11:00', end: '12:30', color: '#3164cb' },
{ guid: '3', title: 'Lunch with client', date: day(-1), start: '12:30', end: '13:30', color: '#33b679' },
{ guid: '4', title: 'Release', date: day(2), start: '15:00', end: '16:00', color: '#e67c73' }
]
};
},
methods: {
onUpdate(self, event, oldValue, newValue) {
console.log('Updated:', event.title, newValue);
}
}
}
</script>Features
Section titled “Features”- Day, week and weekdays views with previous/next/today navigation
- Drag and drop: move events between days and times
- Resize events by dragging their edges
- Create events by dragging across empty slots
- Time configuration: grid interval, visible hours and read-only ranges
- Weekly mode for recurring timetables (weekday instead of date)
- Undo / redo and a full event API (
addEvents,updateEvent,deleteEvents) - Callbacks:
oncreate,onchangeevent,ondelete,oneditionand more
Use Cases
Section titled “Use Cases”- Team scheduling and shared calendars
- Appointment and medical booking
- Meeting and resource room booking
- Class and course timetables
- Content and editorial calendars