v7.3.0

YearPlanner
Widget

A calendar view which represents a full year of events as a series of month rows with weeks aligned in columns. Each row displays one month with days aligned vertically across all months for easy comparison.

This type of view is specifically designed for larger displays and is not recommended to be offered on tablet or phone devices.

Usage as a Calendar Mode

This is normally used as the 'yearplanner'mode of a Calendar:

const calendar = new Calendar({
    modes : {
        yearplanner : {
            // YearPlanner-specific config
            eventHeight : 18,
            dayNameFormat : 'd1'
        }
    },
    mode : 'yearplanner',
    date : new Date(2024, 0, 1)
});

Standalone Usage

It may also be used standalone as a regular Widget:

const yearPlanner = new YearPlanner({
    appendTo : 'container',
    date     : new Date(2024, 0, 1),
    year     : 2024,

eventStore : new EventStore({ data : [{ id : 1, name : 'Company Meeting', startDate : '2024-03-15', endDate : '2024-03-15' }] }) });

As a standalone widget, it will lack the capabilities of the Calendar class, such as keyboard-based event to event navigation.

Month Filtering

The YearPlanner includes a built-in toolbar with a month filter combo that allows users to show/hide specific months:

const yearPlanner = new YearPlanner({
    tbar : {
        items : {
            monthFilter : {
                // Start with only Q1 months visible
                value : [0, 1, 2]  // January, February, March
            }
        }
    }
});

Users can select/deselect months in the filter to dynamically adjust which months are displayed. This is useful for focusing on specific time periods or comparing seasonal patterns.

Key Features

  • Week Alignment: Days are aligned vertically across all months for easy visual comparison
  • Month Filtering: Built-in combo to show/hide specific months
  • Expandable Rows: Click month row header to expand and see all events when overflow occurs
  • Responsive: Automatically adjusts day name format based on available width
  • Custom Styling: Each month row can be styled individually using CSS

Useful configs

Config Description
year The year to display
eventHeight Height of event bars in pixels
view Config for child month row views
dayNameFormat Format for day name column headers
monthNameFormat Format for month name row headers

See also

  • Calendar — The main Calendar that hosts this view
  • CalendarRow — The month row widget used to render each month's events
  • YearView — Alternative year view with event dot indicators
No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • A date which specifies the year to display. All types of calendar view have a date config which they use to set their visible date range according to their configuration and type.

  • The height of event bars in this view. This can be a numeric value in pixels or a CSS unit measure such as '2em'.

  • The year to display.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isYearPlanner : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of YearPlanner class, or subclass thereof.

Functions

Functions are methods available for calling on the class
    • next( )

      Navigates to the next year by incrementing the year. Updates the date to one year later, which triggers a refresh of all month rows to display the new year.

    • Navigates to the previous year by decrementing the year. Updates the date to one year earlier, which triggers a refresh of all month rows to display the new year.

    CSS variables

    CSS variables that can be set to adjust appearance
    Name Description
    --b-year-planner-background Background color for the year planner.
    --b-year-planner-border-color Border color used for year planner grid borders.
    --b-year-planner-day-header-background Background color for the shared day header.
    --b-year-planner-day-header-color Color for the shared day header.
    --b-year-planner-day-header-font-size Font size for the shared day header.
    --b-year-planner-month-label-background Background color for the month labels.
    --b-year-planner-month-label-color Color for the month labels.
    --b-year-planner-month-label-font-size Font size for the month labels.
    --b-year-planner-other-month-background-color Background color for days that are outside the current month.
    --b-year-planner-other-month-border-color Border color for days that are outside the current month. Set to transparent by default.
    --b-year-planner-row-gap Gap between month rows in the year planner.
    --b-year-planner-weekend-background-color Background color for weekends
    --year-planner-header-border-bottom-width Border bottom width for the day header cells. There is no bottom border by default, but this can be set to e.g. "1px" to visually separate the day header from the month rows.
    type: yearplanner

    Source path

    Calendar/widget/YearPlanner.js

    Contents