Skip to content
ConsoleMonster
Class

Calendar

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

A Gregorian month or year with dated outcomes, ISO weeks and a status legend. Never reads input.

Inheritance

  • object
  • Calendar

Usage

Explore 20 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 10

Constructors

Calendar 2 overloads
public Calendar(int year, int month, IEnumerable<CalendarMark>? marks = null) #

Creates a calendar for an explicit month and a snapshot of its marked days.

Parameters

year int required
month int required
marks System.Collections.Generic.IEnumerable<ConsoleMonster.Dates.CalendarMark>? = null optional
public Calendar(int year, int month, CalendarData data) #

Creates a display over a shared date model, suitable for reuse by a picker.

Parameters

year int required
month int required
data ConsoleMonster.Dates.CalendarData required

Methods

public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public int Year { get; } #

The Gregorian year.

public int Month { get; } #

The month used in Month view.

public CalendarView View { get; set; } #

Month or year presentation.

public CalendarData Data { get; } #

The immutable grouped date model.

public DayOfWeek? FirstDayOfWeek { get; set; } #

Override for the culture's first day of week.

public CultureInfo? Culture { get; set; } #

Explicit display culture; null uses the render context. Arithmetic and displayed years remain Gregorian.

public bool ShowLegend { get; set; } #

Whether the legend follows the displayed period. Defaults to true.

public DateTime? Today { get; set; } #

The civil date to emphasize as today; null leaves all dates neutral.

Extension Methods

public static Calendar WithCulture(Calendar calendar, CultureInfo? value) #

Sets Calendar.Culture: Explicit display culture; null uses the render context. Arithmetic and displayed years remain Gregorian.

Parameters

calendar ConsoleMonster.Widgets.Calendar required
The instance.
value System.Globalization.CultureInfo? required
The value.

Returns

Calendar The same instance.
public static Calendar WithFirstDayOfWeek(Calendar calendar, DayOfWeek? value) #

Sets Calendar.FirstDayOfWeek: Override for the culture's first day of week.

Parameters

calendar ConsoleMonster.Widgets.Calendar required
The instance.
value System.DayOfWeek? required
The value.

Returns

Calendar The same instance.
public static Calendar WithShowLegend(Calendar calendar, bool value = true) #

Sets Calendar.ShowLegend: Whether the legend follows the displayed period. Defaults to true.

Parameters

calendar ConsoleMonster.Widgets.Calendar required
The instance.
value bool = true optional
The value (default true).

Returns

Calendar The same instance.
public static Calendar WithToday(Calendar calendar, DateTime? value) #

Sets Calendar.Today: The civil date to emphasize as today; null leaves all dates neutral.

Parameters

calendar ConsoleMonster.Widgets.Calendar required
The instance.
value System.DateTime? required
The value.

Returns

Calendar The same instance.
public static Calendar WithView(Calendar calendar, CalendarView value) #

Sets Calendar.View: Month or year presentation.

Parameters

calendar ConsoleMonster.Widgets.Calendar required
The instance.
value ConsoleMonster.Widgets.CalendarView required
The value.

Returns

Calendar The same instance.