asv-hlps 1.3.5 → 1.3.6
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/lib/cjs/utils.d.ts +1 -1
- package/lib/cjs/utils.js +6 -4
- package/lib/esm/utils.d.ts +1 -1
- package/lib/esm/utils.js +6 -4
- package/package.json +1 -1
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -97,4 +97,4 @@ export declare const returnBool: (tob?: boolean) => boolean;
|
|
|
97
97
|
export declare const monthStringName: (date: string | Date, format?: "MMM" | "MMMM", options?: {
|
|
98
98
|
en?: true;
|
|
99
99
|
}) => string;
|
|
100
|
-
export declare const dateFormatter: (date: Date | string, format?: "ymd" | "
|
|
100
|
+
export declare const dateFormatter: (date: Date | string, format?: "ymd" | "dmy" | "dmyfr", separator?: "/" | "-") => string;
|
package/lib/cjs/utils.js
CHANGED
|
@@ -603,14 +603,16 @@ const monthStringName = (date, format = "MMM", options) => {
|
|
|
603
603
|
return (0, dayjs_1.default)(date).locale("fr").format(format);
|
|
604
604
|
};
|
|
605
605
|
exports.monthStringName = monthStringName;
|
|
606
|
-
const dateFormatter = (date, format) => {
|
|
606
|
+
const dateFormatter = (date, format, separator = "-") => {
|
|
607
607
|
switch (format) {
|
|
608
608
|
case "ymd":
|
|
609
|
-
return (0, dayjs_1.default)(date).format("YYYY
|
|
610
|
-
case "
|
|
609
|
+
return (0, dayjs_1.default)(date).format(`"YYYY${separator}MM${separator}DD"`);
|
|
610
|
+
case "dmy":
|
|
611
|
+
return (0, dayjs_1.default)(date).format(`DD${separator}MM${separator}YYYY`);
|
|
612
|
+
case "dmyfr":
|
|
611
613
|
return (0, dayjs_1.default)(date).locale("fr").format("dddd DD MMMM YYYY");
|
|
612
614
|
default:
|
|
613
|
-
return (0, dayjs_1.default)(date).format("YYYY
|
|
615
|
+
return (0, dayjs_1.default)(date).format(`"YYYY${separator}MM${separator}DD"`);
|
|
614
616
|
}
|
|
615
617
|
};
|
|
616
618
|
exports.dateFormatter = dateFormatter;
|
package/lib/esm/utils.d.ts
CHANGED
|
@@ -97,4 +97,4 @@ export declare const returnBool: (tob?: boolean) => boolean;
|
|
|
97
97
|
export declare const monthStringName: (date: string | Date, format?: "MMM" | "MMMM", options?: {
|
|
98
98
|
en?: true;
|
|
99
99
|
}) => string;
|
|
100
|
-
export declare const dateFormatter: (date: Date | string, format?: "ymd" | "
|
|
100
|
+
export declare const dateFormatter: (date: Date | string, format?: "ymd" | "dmy" | "dmyfr", separator?: "/" | "-") => string;
|
package/lib/esm/utils.js
CHANGED
|
@@ -523,13 +523,15 @@ export const monthStringName = (date, format = "MMM", options) => {
|
|
|
523
523
|
}
|
|
524
524
|
return dayjs(date).locale("fr").format(format);
|
|
525
525
|
};
|
|
526
|
-
export const dateFormatter = (date, format) => {
|
|
526
|
+
export const dateFormatter = (date, format, separator = "-") => {
|
|
527
527
|
switch (format) {
|
|
528
528
|
case "ymd":
|
|
529
|
-
return dayjs(date).format("YYYY
|
|
530
|
-
case "
|
|
529
|
+
return dayjs(date).format(`"YYYY${separator}MM${separator}DD"`);
|
|
530
|
+
case "dmy":
|
|
531
|
+
return dayjs(date).format(`DD${separator}MM${separator}YYYY`);
|
|
532
|
+
case "dmyfr":
|
|
531
533
|
return dayjs(date).locale("fr").format("dddd DD MMMM YYYY");
|
|
532
534
|
default:
|
|
533
|
-
return dayjs(date).format("YYYY
|
|
535
|
+
return dayjs(date).format(`"YYYY${separator}MM${separator}DD"`);
|
|
534
536
|
}
|
|
535
537
|
};
|