# Day View (JavaScript Event Calendar) | DayPilot Pro for JavaScript Demo

> Read more about the calendar [day view](https://doc.daypilot.org/calendar/day-view/) [doc.daypilot.org].

## Links

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

## Source

### Inline demo script 1

```javascript
const dp = new DayPilot.Calendar("dp", {
            startDate: DayPilot.Date.today(),
            days: 1,
        });
        dp.init();

        const app = {
            init() {
                this.loadEventData();
            },
            loadEventData() {
                const events = [
                    {
                        start: DayPilot.Date.today().addHours(11),
                        end: DayPilot.Date.today().addHours(14),
                        id: DayPilot.guid(),
                        text: "Event 1"
                    },
                    {
                        start: DayPilot.Date.today().addHours(15),
                        end: DayPilot.Date.today().addHours(17),
                        id: DayPilot.guid(),
                        text: "Event 2"
                    },
                ];
                dp.update({events});
            }
        };
        app.init();
```

