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
Parameter | Type | Default value |
---|---|---|
date | Date | undefined |
displayMonth | Date | undefined |
dateLib | DateLib | defaultDateLib |
Returns
CalendarDay
Methods
isEqualTo()
isEqualTo(
day
):boolean
Defined in: src/classes/CalendarDay.ts:58
Checks if this day is equal to another CalendarDay
, considering both the
date and the displayed month.
Parameters
Parameter | Type | Description |
---|---|---|
day | CalendarDay | The CalendarDay to compare with. |
Returns
boolean
true
if the days are equal, otherwise false
.
Properties
date
readonly
date:Date
Defined in: src/classes/CalendarDay.ts:49
The date represented by this day.
displayMonth
readonly
displayMonth:Date
Defined in: src/classes/CalendarDay.ts:46
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.
outside
readonly
outside:boolean
Defined in: src/classes/CalendarDay.ts:37
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.