tsv2-library 1.0.57 → 1.0.59
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/dist/src/components/v2/Badge/Badge.vue.d.ts +4 -0
- package/dist/src/types/generalSettings.type.d.ts +1 -1
- package/dist/src/utils/date.util.d.ts +27 -2
- package/dist/tsv2-library.es.js +2181 -2034
- package/dist/tsv2-library.umd.js +62 -62
- package/package.json +1 -1
- package/src/components/v2/Badge/Badge.vue.d.ts +4 -0
|
@@ -10,16 +10,41 @@ type User = {
|
|
|
10
10
|
generalSetting: GeneralSetting;
|
|
11
11
|
[key: string]: unknown;
|
|
12
12
|
};
|
|
13
|
+
export type TDateFormat = 'd/m/yy' | 'd/mm/yy' | 'dd/mm/yy' | 'dd/mm/yyyy' | 'dd M yy' | 'dd M yyyy' | 'dd MM yy' | 'dd MM yyyy' | 'D dd M yy' | 'D dd M yyyy' | 'DD dd MM yy' | 'DD dd MM yyyy' | 'D, dd M yy' | 'D, dd M yyyy' | 'DD, dd MM yy' | 'DD, dd MM yyyy';
|
|
14
|
+
export type GoDateLayout = '02/01/06' | '_2/_1/06' | '02 Jan 06' | 'Mon, 02 Jan 06' | 'Mon, 02 Jan 2006';
|
|
15
|
+
export type TTimeFormat = 'HH:mm' | 'HH:mm a' | 'HH:mm:ss' | 'HH:mm:ss a';
|
|
16
|
+
export type GoTimeLayout = '15:04' | '03:04 PM' | '15:04:05' | '03:04:05 PM';
|
|
17
|
+
export type TTimeOptions = {
|
|
18
|
+
/**
|
|
19
|
+
* @default 'en-GB'
|
|
20
|
+
*/
|
|
21
|
+
locale?: string;
|
|
22
|
+
dateFormat?: TDateFormat | GoDateLayout;
|
|
23
|
+
timeFormat?: TTimeFormat | GoTimeLayout;
|
|
24
|
+
/**
|
|
25
|
+
* Show the time in the formatted date.
|
|
26
|
+
*
|
|
27
|
+
* @default true - when timeFormat is provided
|
|
28
|
+
*/
|
|
29
|
+
showTime?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Show the date in the formatted date.
|
|
32
|
+
*
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
showDate?: boolean;
|
|
36
|
+
};
|
|
13
37
|
export declare const getLoggedInUser: () => User;
|
|
14
38
|
export declare const getUserLocale: () => string;
|
|
39
|
+
export declare const formatGoDate: (date: Date, options?: TTimeOptions) => string;
|
|
15
40
|
/**
|
|
16
41
|
* Formats a date according to the user's general settings.
|
|
17
42
|
*
|
|
18
43
|
* @param date - The date to be displayed. Can be a Date object or a string in a recognized date format.
|
|
19
|
-
* @param
|
|
44
|
+
* @param useTimeOrFormat - Whether to include the time in the formatted date string. Defaults to false.
|
|
20
45
|
* @returns The formatted date string.
|
|
21
46
|
*/
|
|
22
|
-
export declare const formatDate: (date: Date | string | null | undefined,
|
|
47
|
+
export declare const formatDate: (date: Date | string | null | undefined, useTimeOrFormat?: boolean | TTimeOptions) => string;
|
|
23
48
|
/**
|
|
24
49
|
* Formats a date to human readable form (timeago / relative time from now).
|
|
25
50
|
*
|