Table of Contents

Class StandardCalendar

Namespace
Core.Systems
Assembly
Core.dll

ENGINE: Default Earth calendar with real month lengths.

Features:

  • Real month lengths (31/30/28 days)
  • 365 days per year (no leap years for determinism)
  • Standard AD/BC era formatting
  • English month names (GAME layer can override with localized names)

For simplified 360-day calendar, use SimplifiedCalendar instead.

public class StandardCalendar : ICalendar
Inheritance
object
StandardCalendar
Implements

Properties

DaysPerYear

Total days in a year (for year-based calculations)

public int DaysPerYear { get; }

Property Value

int

HoursPerDay

Hours per day (typically 24)

public int HoursPerDay { get; }

Property Value

int

MonthsPerYear

Number of months in a year

public int MonthsPerYear { get; }

Property Value

int

Methods

ClampToValidDate(int, int, int, int)

Clamp date to valid range for this calendar. Useful when loading saves or setting dates programmatically.

public GameTime ClampToValidDate(int year, int month, int day, int hour)

Parameters

year int
month int
day int
hour int

Returns

GameTime

FormatDate(GameTime)

Format full date for display. Example: "11 November 1444 AD"

public string FormatDate(GameTime time)

Parameters

time GameTime

Returns

string

FormatDateCompact(GameTime)

Format compact date for limited UI space. Example: "1444.11.11" or "11 Nov 1444"

public string FormatDateCompact(GameTime time)

Parameters

time GameTime

Returns

string

FormatYear(int)

Format year with era designation. Examples: "1444 AD", "753 BC", "AUC 507" Year 0 = 1 BC in standard AD/BC system.

public string FormatYear(int year)

Parameters

year int

Returns

string

GetDaysInMonth(int)

Get days in specified month (1-indexed). Standard calendar returns 30 for all months. Custom calendars can vary (28-31 for realistic, any for fantasy).

public int GetDaysInMonth(int month)

Parameters

month int

Returns

int

GetMonthAbbreviation(int)

Get abbreviated month name for compact UI. Standard calendar returns "M1", "M2", etc. GAME layer provides real abbreviations ("Jan", "Feb", etc.)

public string GetMonthAbbreviation(int month)

Parameters

month int

Returns

string

GetMonthName(int)

Get localized month name. Standard calendar returns "Month 1", "Month 2", etc. GAME layer provides real names ("January", "Ianuarius", etc.)

public string GetMonthName(int month)

Parameters

month int

Returns

string

IsValidDate(int, int, int)

Validate that date components are within calendar bounds. Returns true if month is 1-MonthsPerYear and day is 1-GetDaysInMonth(month).

public bool IsValidDate(int year, int month, int day)

Parameters

year int
month int
day int

Returns

bool