@data-fair/lib-vue 1.10.1 → 1.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1 @@
1
- export declare const locale: string, dayjs: (date?: string | number | import("dayjs").Dayjs | Date | null | undefined) => Omit<import("dayjs").Dayjs, "add" | "subtract"> & {
2
- fromNow(withoutSuffix?: boolean): string;
3
- from(compared: import("dayjs").ConfigType, withoutSuffix?: boolean): string;
4
- toNow(withoutSuffix?: boolean): string;
5
- to(compared: import("dayjs").ConfigType, withoutSuffix?: boolean): string;
6
- add(duration: import("dayjs/plugin/duration.js").Duration): Omit<import("dayjs").Dayjs, "add" | "subtract"> & any;
7
- subtract(duration: import("dayjs/plugin/duration.js").Duration): Omit<import("dayjs").Dayjs, "add" | "subtract"> & any;
8
- };
1
+ export declare const locale: string, dayjs: typeof import("dayjs");
package/locale-dayjs.d.ts CHANGED
@@ -1,21 +1,21 @@
1
1
  import type { App } from 'vue';
2
- import dayjs, { type Dayjs, ConfigType } from 'dayjs';
2
+ import dayjs from 'dayjs';
3
3
  import 'dayjs/locale/fr';
4
4
  import 'dayjs/locale/en';
5
- import duration, { type Duration } from 'dayjs/plugin/duration.js';
5
+ import { CreateDurationType } from 'dayjs/plugin/duration.js';
6
6
  export type { ConfigType as DayjsConfigType } from 'dayjs';
7
- type RelativeDayjs = Omit<Dayjs, 'add' | 'subtract'> & {
8
- fromNow(withoutSuffix?: boolean): string;
9
- from(compared: ConfigType, withoutSuffix?: boolean): string;
10
- toNow(withoutSuffix?: boolean): string;
11
- to(compared: ConfigType, withoutSuffix?: boolean): string;
12
- add(duration: Duration): RelativeDayjs;
13
- subtract(duration: Duration): RelativeDayjs;
14
- };
7
+ declare module 'dayjs' {
8
+ interface Dayjs {
9
+ fromNow(withoutSuffix?: boolean): string;
10
+ from(compared: ConfigType, withoutSuffix?: boolean): string;
11
+ toNow(withoutSuffix?: boolean): string;
12
+ to(compared: ConfigType, withoutSuffix?: boolean): string;
13
+ }
14
+ }
15
15
  export declare function getLocaleDayjs(locale?: string): {
16
16
  locale: string;
17
- duration: (dur: duration.DurationUnitsObjectType) => duration.Duration;
18
- dayjs: (date?: string | number | dayjs.Dayjs | Date | null | undefined) => RelativeDayjs;
17
+ duration: CreateDurationType;
18
+ dayjs: typeof dayjs;
19
19
  };
20
20
  export declare const localeDayjsKey: unique symbol;
21
21
  export declare function createLocaleDayjs(locale?: string): {
package/locale-dayjs.js CHANGED
@@ -14,11 +14,13 @@ export function getLocaleDayjs (locale) {
14
14
  locale = locale ?? 'fr'
15
15
  return {
16
16
  locale,
17
- duration: (dur) => {
18
- return dayjs.duration(dur).locale(locale)
17
+ duration: () => {
18
+ // @ts-ignore
19
+ return dayjs.duration.apply(null, arguments).locale(locale)
19
20
  },
20
- dayjs: (date) => {
21
- return dayjs(date).locale(locale)
21
+ dayjs: () => {
22
+ // @ts-ignore
23
+ return dayjs.apply(null, arguments).locale(locale)
22
24
  }
23
25
  }
24
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vue",
3
- "version": "1.10.1",
3
+ "version": "1.10.3",
4
4
  "description": "Composables and other utilities for Vue applications in the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [