Simple Calendar Documentation

website·Indexed 31 days ago

https://simplecalendar.info/

Documentation for Simple Calendar, including user guides for managing calendars, notes, and themes, as well as developer API references for namespaces like SimpleCalendar.api and SimpleCalendar.Hooks. Covers versions 2.4.x and Next.

Tokens
243K
Snippets
752
Records
2.1K
Agent score
32%

What's inside Simple Calendar

  1. Overview of the SimpleCalendar namespace

    The SimpleCalendar namespace serves as the primary entry point for all functionality that external modules, systems, and macros use to interact with the Simple Calendar module. It contains specialized namespaces for Hooks and API access, as well as a wide array of interfaces for calendar, date, and time data.
  2. Overview of Simple Calendar for FoundryVTT

    Simple Calendar is a timekeeping module for FoundryVTT compatible with all game systems. It allows for complete customization of a world's calendar, including custom months, years, weekdays, leap year rules, seasons, moons, and time units (hours, minutes, seconds). It also supports adding repeating notes and events with configurable visibility permissions.
  3. Style Headings using CSS variables

    Customize the bottom borders of headings using these variables:

    • --heading-border-color: Color of the bottom border for general headings.
    • --about-heading-border-color: Color of the bottom border for the main heading in the configuration 'About' section.
  4. SimpleCalendar.MoonData Interface Reference

    The SimpleCalendar.MoonData interface provides all necessary information about a moon, including its visual properties, cycle calculations, and phase data. It inherits from IDataItemBase.
    interface MoonData extends IDataItemBase {
      color: string;
      cycleDayAdjust: number;
      cycleLength: number;
      firstNewMoon: FirstNewMoonDate;
      phases: MoonPhase[];
      currentPhase?: MoonPhase;
      abbreviation?: string;
      description?: string;
      numericRepresentation?: number;
      showAdvanced?: boolean;
    }
  5. Use the SimpleCalendar.MoonPhase interface

    The SimpleCalendar.MoonPhase interface is used to define information about a moon phase. It contains the following properties:

    • icon: An icon associated with the moon phase (of type SimpleCalendar.api.Icons).
    • length: A number representing how many days of the cycle this phase occupies.
    • name: A string representing the name of the phase.
    • singleDay: A boolean indicating whether this phase should only occur on a single day.
  6. Retrieve season information via Simple Calendar API

    The Simple Calendar API provides two functions to retrieve season data: SimpleCalendar.api.getCurrentSeason() returns details about the season for the current date, and SimpleCalendar.api.getAllSeasons() returns details for every configured season.
  7. Retrieve season information via Simple Calendar API

    Simple Calendar provides API functions to retrieve details about configured seasons for the current date or all available seasons.
    // Get details about the season for the current date
    SimpleCalendar.api.getCurrentSeason();
    
    // Get details for every configured season
    SimpleCalendar.api.getAllSeasons();
  8. Use SimpleCalendar.Hooks.Season properties

    The SimpleCalendar.Hooks.Season interface provides information about a calendar season. It contains the following properties:

    • color (string): The hex color representation of the season.
    • name (string): The name of the season.

    Deprecation Warning: This interface/property is deprecated. Developers should migrate to using the DateChangeResponse.date property, as this will be removed when Foundry v10 stable is released.

    interface Season {
      color: string;
      name: string;
    }
  9. Use the DateData interface for date and time information

    The DateData interface is an object containing all information about a specific date and time. It can represent the current date/time or a date/time calculated from a timestamp. It includes properties for calendar calculations, time tracking, and display formatting.
    interface DateData {
      currentSeason: SeasonData;
      day: number;
      dayOfTheWeek: number;
      dayOffset: number;
      display: DateDisplayData;
      hour: number;
      isLeapYear: boolean;
      midday: number;
      minute: number;
      month: number;
      second: number;
      showWeekdayHeadings: boolean;
      sunrise: number;
      sunset: number;
      weekdays: string[];
      year: number;
      yearZero: number;
    }