@rocketlink/crm-model 1.0.326 → 1.0.328
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/util/dateUtil.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export declare const FORMATS: {
|
|
|
5
5
|
readonly ISO_DATE_TIME_MINUTES: "yyyy-MM-dd HH:mm";
|
|
6
6
|
readonly ISO_DATE_TIME_SECONDS: "yyyy-MM-dd HH:mm:ss";
|
|
7
7
|
readonly COMPACT_DATETIME: "yyyyMMddHHmmss";
|
|
8
|
+
/** Same as COMPACT_DATETIME plus 3-digit ms — avoids collisions when many IDs are minted in the same second. */
|
|
9
|
+
readonly COMPACT_DATETIME_MILLISECONDS: "yyyyMMddHHmmssSSS";
|
|
8
10
|
readonly COMPACT_DATE: "yyyyMMdd";
|
|
9
11
|
};
|
|
10
12
|
export declare const INTERVAL_UNIT: {
|
|
@@ -19,7 +21,10 @@ export declare function dateToYYYYMMDD(date?: Date | undefined | null): string |
|
|
|
19
21
|
export declare function dateToTZ(date?: Date | undefined | null): string | undefined;
|
|
20
22
|
export declare function dateToMinutes(date?: Date | undefined | null): string | undefined;
|
|
21
23
|
export declare function dateToMinutesSeconds(date?: Date | undefined | null): string | undefined;
|
|
24
|
+
/** "Now" as compact local datetime including milliseconds (used for merchant IDs, filenames, TIDs). */
|
|
22
25
|
export declare function getCurrentDateCompacted(): string | undefined;
|
|
26
|
+
/** Alias of {@link getCurrentDateCompacted}; same millisecond precision. */
|
|
27
|
+
export declare function getCurrentDateCompactedWithMilliseconds(): string | undefined;
|
|
23
28
|
export declare function isDateString(value: string): boolean;
|
|
24
29
|
export declare function stringToDate(value: string): Date;
|
|
25
30
|
export declare function formatDateString(value: string, formatString?: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateUtil.d.ts","sourceRoot":"","sources":["../../src/util/dateUtil.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO
|
|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AAM,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAUrF;AAMD,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,EACvC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,MAAM,CAgDR"}
|
package/dist/util/dateUtil.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.dateToTZ = dateToTZ;
|
|
|
9
9
|
exports.dateToMinutes = dateToMinutes;
|
|
10
10
|
exports.dateToMinutesSeconds = dateToMinutesSeconds;
|
|
11
11
|
exports.getCurrentDateCompacted = getCurrentDateCompacted;
|
|
12
|
+
exports.getCurrentDateCompactedWithMilliseconds = getCurrentDateCompactedWithMilliseconds;
|
|
12
13
|
exports.isDateString = isDateString;
|
|
13
14
|
exports.stringToDate = stringToDate;
|
|
14
15
|
exports.formatDateString = formatDateString;
|
|
@@ -33,6 +34,8 @@ exports.FORMATS = {
|
|
|
33
34
|
ISO_DATE_TIME_MINUTES: 'yyyy-MM-dd HH:mm', // "2026-01-07 14:30
|
|
34
35
|
ISO_DATE_TIME_SECONDS: 'yyyy-MM-dd HH:mm:ss', // "2026-01-07 14:30:23,
|
|
35
36
|
COMPACT_DATETIME: 'yyyyMMddHHmmss', // "20260107143000"
|
|
37
|
+
/** Same as COMPACT_DATETIME plus 3-digit ms — avoids collisions when many IDs are minted in the same second. */
|
|
38
|
+
COMPACT_DATETIME_MILLISECONDS: 'yyyyMMddHHmmssSSS', // "20260107143023123"
|
|
36
39
|
COMPACT_DATE: 'yyyyMMdd', // "20260107"
|
|
37
40
|
};
|
|
38
41
|
exports.INTERVAL_UNIT = {
|
|
@@ -92,8 +95,13 @@ function dateToMinutes(date) {
|
|
|
92
95
|
function dateToMinutesSeconds(date) {
|
|
93
96
|
return dateToString(date, exports.FORMATS.ISO_DATE_TIME_SECONDS);
|
|
94
97
|
}
|
|
98
|
+
/** "Now" as compact local datetime including milliseconds (used for merchant IDs, filenames, TIDs). */
|
|
95
99
|
function getCurrentDateCompacted() {
|
|
96
|
-
return
|
|
100
|
+
return dateToString(new Date(), exports.FORMATS.COMPACT_DATETIME_MILLISECONDS);
|
|
101
|
+
}
|
|
102
|
+
/** Alias of {@link getCurrentDateCompacted}; same millisecond precision. */
|
|
103
|
+
function getCurrentDateCompactedWithMilliseconds() {
|
|
104
|
+
return getCurrentDateCompacted();
|
|
97
105
|
}
|
|
98
106
|
// Checks if a string matches a date pattern
|
|
99
107
|
function isDateString(value) {
|
package/package.json
CHANGED
package/src/util/dateUtil.ts
CHANGED
|
@@ -7,6 +7,8 @@ export const FORMATS = {
|
|
|
7
7
|
ISO_DATE_TIME_MINUTES: 'yyyy-MM-dd HH:mm', // "2026-01-07 14:30
|
|
8
8
|
ISO_DATE_TIME_SECONDS: 'yyyy-MM-dd HH:mm:ss', // "2026-01-07 14:30:23,
|
|
9
9
|
COMPACT_DATETIME: 'yyyyMMddHHmmss', // "20260107143000"
|
|
10
|
+
/** Same as COMPACT_DATETIME plus 3-digit ms — avoids collisions when many IDs are minted in the same second. */
|
|
11
|
+
COMPACT_DATETIME_MILLISECONDS: 'yyyyMMddHHmmssSSS', // "20260107143023123"
|
|
10
12
|
COMPACT_DATE: 'yyyyMMdd', // "20260107"
|
|
11
13
|
} as const;
|
|
12
14
|
|
|
@@ -74,8 +76,14 @@ export function dateToMinutesSeconds(date?: Date | undefined | null): string | u
|
|
|
74
76
|
return dateToString(date, FORMATS.ISO_DATE_TIME_SECONDS);
|
|
75
77
|
}
|
|
76
78
|
|
|
79
|
+
/** "Now" as compact local datetime including milliseconds (used for merchant IDs, filenames, TIDs). */
|
|
77
80
|
export function getCurrentDateCompacted(): string | undefined {
|
|
78
|
-
return
|
|
81
|
+
return dateToString(new Date(), FORMATS.COMPACT_DATETIME_MILLISECONDS);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Alias of {@link getCurrentDateCompacted}; same millisecond precision. */
|
|
85
|
+
export function getCurrentDateCompactedWithMilliseconds(): string | undefined {
|
|
86
|
+
return getCurrentDateCompacted();
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
// Checks if a string matches a date pattern
|