search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Year View

Asked by Dimitris
7 months ago.

Hello! I am searching for a scheduler control providing a “Year View”. This view must have days of month on the horizontal axis and months on the vertical axis. Does your scheduler control provide such a view and if yes, where can i test it before i buy the product?

Thank you very much!

Answer posted by Dan Letecky [DayPilot]
7 months ago.

Yes, this is possible.

You can use the same technique that is used in the yearly calendar tutorial (which displays months as columns) - define rows with custom start, one per month:

<div id="dp"></div>

<script>

    const dp = new DayPilot.Scheduler("dp", {
        days: 31,
        scale: "Day",
        cellWidthSpec: "Auto",
        timeHeaders: [
            {groupBy: "Day", format: "d"}
        ],
        heightSpec: "Full",
    });

    dp.init();

    const app = {
        loadData() {
            const resources = [];

            const startDate = DayPilot.Date.today().firstDayOfYear();
            for (let i = 0; i < 12; i++) {
                const start = startDate.addMonths(i);
                resources.push({
                    name: start.toString("MMMM yyyy"),
                    start: start
                });
            }

            dp.update({resources, startDate});
        },
    };

    app.loadData();


</script>

You will need the latest build (2024.2.5924 or higher) for this use case.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.