# Touch Calendar (Open-Source JavaScript Event Calendar) | DayPilot Lite for JavaScript Demo

> Tap an empty slot to select it. Press and hold to move a booking or select a longer time range. Drag a booking’s lower handle to change its end time. See the [Calendar touch guide](https://doc.daypilot.org/calendar/touch-devices/).

## Links

- Canonical HTML: /demo/lite/calendar/touch.html
- Source HTML folder: /demo/lite/calendar/
- Catalog root: /demo/lite/
- Catalog: /demo/lite/llms.txt

## Source

### Inline demo script 1

```javascript
(() => {
            const date = "2026-12-02";
            const studios = [
                {id: "studio-a", name: "Studio A"},
                {id: "studio-b", name: "Studio B"},
                {id: "studio-c", name: "Studio C"}
            ];
            const bookings = [
                {id: 1, resource: "studio-a", text: "Team planning", start: "09:00", end: "10:00", color: "lavender"},
                {id: 2, resource: "studio-a", text: "Client workshop", start: "11:00", end: "12:30", color: "green"},
                {id: 3, resource: "studio-b", text: "Planning", start: "10:00", end: "11:00", color: "blue"},
                {id: 4, resource: "studio-c", text: "Studio booking", start: "09:30", end: "10:30", color: "sand"},
                {id: 5, resource: "studio-c", text: "Project review", start: "11:30", end: "12:30", color: "lavender"}
            ];
            const palette = {
                lavender: {fill: "#f2eefb", border: "#b9a7df", accent: "#8b69bf"},
                green: {fill: "#eaf6ef", border: "#a2c6af", accent: "#4b9466"},
                blue: {fill: "#e7f0ff", border: "#a3bde5", accent: "#3776d1"},
                sand: {fill: "#fcf3e5", border: "#d9bf92", accent: "#b17a2f"}
            };

            const calendar = new DayPilot.Calendar("dp", {
                viewType: "Resources",
                startDate: date,
                columns: studios,
                headerHeight: 34,
                heightSpec: "BusinessHoursNoScroll",
                businessBeginsHour: 9,
                businessEndsHour: 13,
                cellHeight: 34,
                eventBorderRadius: 6,
                timeFormat: "Clock24Hours",
                events: bookings.map(booking => ({
                    ...booking,
                    start: date + "T" + booking.start + ":00",
                    end: date + "T" + booking.end + ":00"
                })),
                onBeforeEventRender(args) {
                    const colors = palette[args.data.color];
                    args.data.backColor = colors.fill;
                    args.data.borderColor = colors.border;
                    args.data.barColor = colors.accent;
                    args.data.fontColor = "#203143";
                    args.data.areas = [{
                        right: 6, bottom: 4, width: 32, height: 24, padding: 4,
                        symbol: "../icons/daypilot.svg#resize-bottom",
                        toolTip: "Resize event end",
                        borderRadius: 4,
                        backColor: "#f8fbff",
                        fontColor: "#244a7e",
                        action: "ResizeEnd",
                        visibility: "TouchVisible"
                    }];
                }
            });
            calendar.init();
        })();
```

