UNPKG

1.94 kBTypeScriptView Raw
1/**
2 * The parameter type passed to the date formatter methods.
3 */
4export interface DateFormatterParams {
5 /**
6 * The date to format.
7 */
8 date: Date;
9 /**
10 * The users preferred locale.
11 */
12 locale?: string;
13 /**
14 * The start day number of the week
15 */
16 weekStartsOn?: number;
17 /**
18 * An array of day indexes (0 = sunday, 1 = monday etc) that will be hidden on the view
19 */
20 excludeDays?: number[];
21 /**
22 * The number of days in a week. Can be used to create a shorter or longer week view.
23 * The first day of the week will always be the `viewDate`
24 */
25 daysInWeek?: number;
26}
27/**
28 * If using a completely custom date formatter then it should implement this interface.
29 */
30export interface CalendarDateFormatterInterface {
31 /**
32 * The month view header week day labels
33 */
34 monthViewColumnHeader({ date: Date }: DateFormatterParams): string;
35 /**
36 * The month view cell day number
37 */
38 monthViewDayNumber({ date: Date }: DateFormatterParams): string;
39 /**
40 * The month view title
41 */
42 monthViewTitle({ date: Date }: DateFormatterParams): string;
43 /**
44 * The week view header week day labels
45 */
46 weekViewColumnHeader({ date: Date }: DateFormatterParams): string;
47 /**
48 * The week view sub header day and month labels
49 */
50 weekViewColumnSubHeader({ date: Date }: DateFormatterParams): string;
51 /**
52 * The week view title
53 */
54 weekViewTitle({ date: Date }: DateFormatterParams): string;
55 /**
56 * The time formatting down the left hand side of the day view
57 */
58 weekViewHour({ date: Date }: DateFormatterParams): string;
59 /**
60 * The time formatting down the left hand side of the day view
61 */
62 dayViewHour({ date: Date }: DateFormatterParams): string;
63 /**
64 * The day view title
65 */
66 dayViewTitle({ date: Date }: DateFormatterParams): string;
67}