diff --git a/test/plugin/dayOfYear.d.test.ts b/test/plugin/dayOfYear.d.test.ts new file mode 100644 index 000000000..85173c66e --- /dev/null +++ b/test/plugin/dayOfYear.d.test.ts @@ -0,0 +1,6 @@ +import * as dayjs from 'dayjs' +import * as dayOfYear from 'dayjs/plugin/dayOfYear' + +dayjs.extend(dayOfYear) + +dayjs('2015-01-01T00:00:00.000').dayOfYear() === 1 diff --git a/test/plugin/isSameOrAfter.d.test.ts b/test/plugin/isSameOrAfter.d.test.ts new file mode 100644 index 000000000..b8f257cfd --- /dev/null +++ b/test/plugin/isSameOrAfter.d.test.ts @@ -0,0 +1,6 @@ +import * as dayjs from 'dayjs' +import * as isSameOrAfter from 'dayjs/plugin/isSameOrAfter' + +dayjs.extend(isSameOrAfter) + +dayjs('2010-10-20').isSameOrAfter('2010-10-19', 'year') === true diff --git a/test/plugin/isSameOrBefore.d.test.ts b/test/plugin/isSameOrBefore.d.test.ts new file mode 100644 index 000000000..5dcf966ee --- /dev/null +++ b/test/plugin/isSameOrBefore.d.test.ts @@ -0,0 +1,6 @@ +import * as dayjs from 'dayjs' +import * as isSameOrBefore from 'dayjs/plugin/isSameOrBefore' + +dayjs.extend(isSameOrBefore) + +dayjs('2010-10-20').isSameOrBefore('2010-10-19', 'year') === true diff --git a/test/plugin/quarterOfYear.d.test.ts b/test/plugin/quarterOfYear.d.test.ts new file mode 100644 index 000000000..f3f2b8ae7 --- /dev/null +++ b/test/plugin/quarterOfYear.d.test.ts @@ -0,0 +1,6 @@ +import * as dayjs from 'dayjs' +import * as quarterOfYear from 'dayjs/plugin/quarterOfYear' + +dayjs.extend(quarterOfYear) + +dayjs('2013-01-01T00:00:00.000').quarter() === 1 diff --git a/types/plugin/customParseFormat.ts b/types/plugin/customParseFormat.ts new file mode 100644 index 000000000..30ec75e5d --- /dev/null +++ b/types/plugin/customParseFormat.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin diff --git a/types/plugin/dayOfYear.d.ts b/types/plugin/dayOfYear.d.ts new file mode 100644 index 000000000..028385152 --- /dev/null +++ b/types/plugin/dayOfYear.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + dayOfYear(): number + } +} diff --git a/types/plugin/isSameOrAfter.d.ts b/types/plugin/isSameOrAfter.d.ts new file mode 100644 index 000000000..12d6f889d --- /dev/null +++ b/types/plugin/isSameOrAfter.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isSameOrAfter(date: DateType, unit?: OpUnitType): boolean + } +} diff --git a/types/plugin/isSameOrBefore.d.ts b/types/plugin/isSameOrBefore.d.ts new file mode 100644 index 000000000..3442c69ad --- /dev/null +++ b/types/plugin/isSameOrBefore.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isSameOrBefore(date: DateType, unit?: OpUnitType): boolean + } +} diff --git a/types/plugin/localizedFormat.d.ts b/types/plugin/localizedFormat.d.ts new file mode 100644 index 000000000..30ec75e5d --- /dev/null +++ b/types/plugin/localizedFormat.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin diff --git a/types/plugin/quarterOfYear.d.ts b/types/plugin/quarterOfYear.d.ts new file mode 100644 index 000000000..e8aad14b8 --- /dev/null +++ b/types/plugin/quarterOfYear.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + quarter(): number + } +}