summaryrefslogtreecommitdiff
path: root/node_modules/liquidjs/dist/util/liquid-date.d.ts
blob: 88097e998dc56356ad34fafcf22c524c9017fd8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
 * A date implementation with timezone info, just like Ruby date
 *
 * Implementation:
 * - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods
 * - rewrite getTimezoneOffset() to trick strftime
 */
export declare class LiquidDate {
    private locale;
    private timezoneOffset;
    private timezoneName;
    private date;
    private displayDate;
    private DateTimeFormat;
    timezoneFixed: boolean;
    constructor(init: string | number | Date, locale: string, timezone?: number | string);
    getTime(): number;
    getMilliseconds(): number;
    getSeconds(): number;
    getMinutes(): number;
    getHours(): number;
    getDay(): number;
    getDate(): number;
    getMonth(): number;
    getFullYear(): number;
    toLocaleString(locale?: string, init?: any): string;
    toLocaleTimeString(locale?: string): string;
    toLocaleDateString(locale?: string): string;
    getTimezoneOffset(): number;
    getTimeZoneName(): string | undefined;
    getLongMonthName(): string;
    getShortMonthName(): string;
    getLongWeekdayName(): string;
    getShortWeekdayName(): string;
    valid(): boolean;
    private format;
    /**
     * Create a Date object fixed to it's declared Timezone. Both
     * - 2021-08-06T02:29:00.000Z and
     * - 2021-08-06T02:29:00.000+08:00
     * will always be displayed as
     * - 2021-08-06 02:29:00
     * regardless timezoneOffset in JavaScript realm
     *
     * The implementation hack:
     * Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`,
     * we create a different Date to trick strftime, it's both simpler and more performant.
     * Given that a template is expected to be parsed fewer times than rendered.
     */
    static createDateFixedToTimezone(dateString: string, locale: string): LiquidDate;
    private static getTimezoneOffset;
}