Skip to content

Weekly Mode

Create a recurring weekly schedule template where events repeat every week on specific weekdays, without specific dates.

Use weekly: true to create a template schedule:

<html>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/style.min.css" />
<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='schedule' style="height: 600px;"></div>

<script>
const { Schedule } = calendarjs;

const weeklyEvents = [
    {
        guid: '1',
        title: 'Team Standup',
        weekday: 1, // Monday
        start: '09:00',
        end: '09:30',
        color: '#3498db'
    },
    {
        guid: '2',
        title: 'Client Meetings',
        weekday: 3, // Wednesday
        start: '14:00',
        end: '16:00',
        color: '#e74c3c'
    },
    {
        guid: '3',
        title: 'Sprint Review',
        weekday: 5, // Friday
        start: '15:00',
        end: '16:00',
        color: '#2ecc71'
    }
];

Schedule(document.getElementById('schedule'), {
    type: 'weekdays',
    weekly: true,
    data: weeklyEvents
});
</script>
</html>

Use validRange to limit the visible hours. This example shows only business hours (7:00 - 18:00):

<html>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/style.min.css" />
<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='schedule' style="height: 600px;"></div>

<script>
const { Schedule } = calendarjs;

Schedule(document.getElementById('schedule'), {
    type: 'weekdays',
    weekly: true,
    validRange: ['07:00', '18:00'],
    data: [
        { guid: '1', title: 'Morning Meeting', weekday: 1, start: '08:00', end: '09:00', color: '#3498db' },
        { guid: '2', title: 'Lunch Break', weekday: 1, start: '12:00', end: '13:00', color: '#95a5a6' },
        { guid: '3', title: 'Project Work', weekday: 2, start: '09:00', end: '12:00', color: '#2ecc71' }
    ]
});
</script>
</html>
DayValue
Sunday0
Monday1
Tuesday2
Wednesday3
Thursday4
Friday5
Saturday6

Weekly Mode (weekly: true):

  • Uses weekday property (0-6)
  • No specific dates
  • Events repeat every week
  • Perfect for templates and recurring schedules

Regular Mode (weekly: false):

  • Uses date property (YYYY-MM-DD)
  • Specific calendar dates
  • One-time or irregular events
  • Class schedules (schools, universities)
  • Office hours templates
  • Recurring meeting schedules
  • Business hours
  • Shift templates
  • Workout routines
  • Meal planning