diff options
| author | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
|---|---|---|
| committer | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
| commit | 7a52ddeba2a68388b544f529d2d92104420f77b0 (patch) | |
| tree | 15ddd47457a2cb4a96060747437d36474e4f6b4e /node_modules/liquidjs/dist/util/liquid-date.d.ts | |
| parent | 53d6ae2b5568437afa5e4995580a3fb679b7b91b (diff) | |
Changed from static to 11ty!
Diffstat (limited to 'node_modules/liquidjs/dist/util/liquid-date.d.ts')
| -rw-r--r-- | node_modules/liquidjs/dist/util/liquid-date.d.ts | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/node_modules/liquidjs/dist/util/liquid-date.d.ts b/node_modules/liquidjs/dist/util/liquid-date.d.ts new file mode 100644 index 0000000..88097e9 --- /dev/null +++ b/node_modules/liquidjs/dist/util/liquid-date.d.ts @@ -0,0 +1,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;
+}
|
