UNPKG

1.3 kBTypeScriptView Raw
1import type { DateLib } from "../types/index.js";
2/**
3 * Represent the day displayed in the calendar.
4 *
5 * In DayPicker, a `Day` is a `Date` that can be displayed in the calendar. It
6 * is used as extension of the native `Date` object to provide additional
7 * information about the day.
8 */
9export declare class CalendarDay {
10 constructor(date: Date, displayMonth: Date,
11 /** @ignore */
12 dateLib?: DateLib);
13 /**
14 * The utility functions to manipulate dates.
15 *
16 * @private
17 */
18 readonly dateLib: DateLib;
19 /**
20 * Whether the day is not belonging to the displayed month.
21 *
22 * When `outside` is `true`, use `displayMonth` to know to which month the day
23 * belongs.
24 */
25 readonly outside: boolean;
26 /**
27 * The months where the day is displayed.
28 *
29 * In DayPicker, days can fall out the displayed months (e.g. when
30 * `showOutsideDays` is `true`). This property is useful to know if the day is
31 * in the same month of the displayed month.
32 */
33 readonly displayMonth: Date;
34 /** The date represented by this day. */
35 readonly date: Date;
36 /**
37 * Check if the day is the same as the given day: considering if it is in the
38 * same display month.
39 */
40 isEqualTo(day: CalendarDay): boolean;
41}