mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 22:10:41 -07:00
@@ -1,6 +0,0 @@
|
||||
export class DateWithTimezone extends Date {
|
||||
constructor (init: string, timezone: number) {
|
||||
super(init)
|
||||
this.getTimezoneOffset = () => timezone
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { LiquidDate } from '../../src/util'
|
||||
|
||||
const locale = Intl.DateTimeFormat().resolvedOptions().locale
|
||||
|
||||
export class DateWithTimezone extends LiquidDate {
|
||||
constructor (init: string, timezone: number) {
|
||||
super(init, locale)
|
||||
this.getTimezoneOffset = () => timezone
|
||||
}
|
||||
}
|
||||
|
||||
export class TestDate extends LiquidDate {
|
||||
constructor (v: any) {
|
||||
super(v, locale)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export function disableIntl () {
|
||||
let intl: typeof Intl
|
||||
beforeEach(() => {
|
||||
intl = Intl
|
||||
delete (global as any).Intl
|
||||
})
|
||||
afterEach(() => {
|
||||
(global as any).Intl = intl
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user