Agent-readable demo data

Title
AngularJS Event Calendar | DayPilot Pro for JavaScript Demo
Tree
DayPilot JavaScript Demo
Catalog root
Default
Description
Read more about the AngularJS event calendar plugin.

Inline demo script 1

var app = angular.module('main', ['daypilot']).controller('DemoCtrl', function ($scope) {

            $scope.config = {
                startDate: "2026-09-01",
                viewType: "Week"
            };

            $scope.events = [
                {
                    start: new DayPilot.Date("2026-09-01T10:00:00"),
                    end: new DayPilot.Date("2026-09-01T14:00:00"),
                    id: DayPilot.guid(),
                    text: "First Event"
                }
            ];

            $scope.add = function () {
                $scope.events.push(
                    {
                        start: new DayPilot.Date("2026-09-01T10:00:00"),
                        end: new DayPilot.Date("2026-09-01T12:00:00"),
                        id: DayPilot.guid(),
                        text: "Simple Event"
                    }
                );
            };

            $scope.move = function () {
                var event = $scope.events[0];
                event.start = event.start.addDays(1);
                event.end = event.end.addDays(1);
            };

            $scope.rename = function () {
                $scope.events[0].text = "New name";
            };

            $scope.message = function () {
                $scope.dp.message("Hi");
            };

            $scope.day = function () {
                $scope.config.viewType = "Day";
            };

            $scope.week = function () {
                $scope.config.viewType = "Week";
                $scope.dp.update();
            };

        });