@data-fair/lib-vue 1.10.2 → 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.
- package/locale-dayjs-global.d.ts +1 -1
- package/locale-dayjs.d.ts +3 -3
- package/locale-dayjs.js +6 -4
- package/package.json +1 -1
package/locale-dayjs-global.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const locale: string, dayjs:
|
|
1
|
+
export declare const locale: string, dayjs: typeof import("dayjs");
|
package/locale-dayjs.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { App } from 'vue';
|
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import 'dayjs/locale/fr';
|
|
4
4
|
import 'dayjs/locale/en';
|
|
5
|
-
import
|
|
5
|
+
import { CreateDurationType } from 'dayjs/plugin/duration.js';
|
|
6
6
|
export type { ConfigType as DayjsConfigType } from 'dayjs';
|
|
7
7
|
declare module 'dayjs' {
|
|
8
8
|
interface Dayjs {
|
|
@@ -14,8 +14,8 @@ declare module 'dayjs' {
|
|
|
14
14
|
}
|
|
15
15
|
export declare function getLocaleDayjs(locale?: string): {
|
|
16
16
|
locale: string;
|
|
17
|
-
duration:
|
|
18
|
-
dayjs:
|
|
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: (
|
|
18
|
-
|
|
17
|
+
duration: () => {
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
return dayjs.duration.apply(null, arguments).locale(locale)
|
|
19
20
|
},
|
|
20
|
-
dayjs: (
|
|
21
|
-
|
|
21
|
+
dayjs: () => {
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
return dayjs.apply(null, arguments).locale(locale)
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
}
|