Skip to main content
Version: 9.14.0

Class: CalendarDay

Defined in: src/classes/CalendarDay.ts:10

Represents a day displayed in the calendar.

In DayPicker, a CalendarDay is a wrapper around a Date object that provides additional information about the day, such as whether it belongs to the displayed month.

Constructors​

Constructor​

new CalendarDay(date, displayMonth, dateLib?): CalendarDay

Defined in: src/classes/CalendarDay.ts:11

Parameters​

Returns​

CalendarDay

Methods​

isEqualTo()​

isEqualTo(day): boolean

Defined in: src/classes/CalendarDay.ts:82

Checks if this day is equal to another CalendarDay, considering both the date and the displayed month.

Parameters​

Returns​

boolean

true if the days are equal, otherwise false.

Properties​

date​

readonly date: Date

Defined in: src/classes/CalendarDay.ts:52

The date represented by this day.


dateMonthId​

readonly dateMonthId: string

Defined in: src/classes/CalendarDay.ts:73

Stable yyyy-MM representation of the date's actual month.

Since​

V9.11.2


displayMonth​

readonly displayMonth: Date

Defined in: src/classes/CalendarDay.ts:49

The month that is currently displayed in the calendar.

This property is useful for determining if the day belongs to the same month as the displayed month, especially when showOutsideDays is enabled.


displayMonthId​

readonly displayMonthId: string

Defined in: src/classes/CalendarDay.ts:66

Stable yyyy-MM representation of the displayed month.

Since​

V9.11.2


isoDate​

readonly isoDate: string

Defined in: src/classes/CalendarDay.ts:59

Stable yyyy-MM-dd representation for reuse in keys/data attrs.

Since​

V9.11.2


outside​

readonly outside: boolean

Defined in: src/classes/CalendarDay.ts:40

Indicates whether the day does not belong to the displayed month.

If outside is true, use displayMonth to determine the month to which the day belongs.