asv-hlps 1.3.11 → 1.3.12
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 +5 -1
- package/lib/esm/utils.d.ts +1 -1
- package/lib/esm/utils.js +5 -1
- package/package.json +1 -1
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -98,6 +98,6 @@ export declare const returnBool: (tob?: boolean) => boolean;
|
|
|
98
98
|
export declare const monthStringName: (date: string | Date, format?: "MMM" | "MMMM", options?: {
|
|
99
99
|
en?: true;
|
|
100
100
|
}) => string;
|
|
101
|
-
export declare const dateFormatter: (date: Date | string, format?: "ymd" | "dmy" | "dmy-hm" | "dmyfr" | "mfr-short" | "mfr-long", separator?: "/" | "-") => string;
|
|
101
|
+
export declare const dateFormatter: (date: Date | string, format?: "y" | "ymd" | "dmy" | "dmy-hm" | "dmyfr" | "myfr" | "mfr-short" | "mfr-long", separator?: "/" | "-") => string;
|
|
102
102
|
export declare const countryIsoToFlag: (code: string) => string;
|
|
103
103
|
export declare const removeParamKeyName: (params: any, name?: string) => any;
|
package/lib/cjs/utils.js
CHANGED
|
@@ -139,7 +139,7 @@ const removeDuplicateObjects = (array, property = "id") => {
|
|
|
139
139
|
uniqueIds.push(element[property]);
|
|
140
140
|
|
|
141
141
|
return true;
|
|
142
|
-
}
|
|
142
|
+
}π
|
|
143
143
|
|
|
144
144
|
return false;
|
|
145
145
|
});
|
|
@@ -625,6 +625,8 @@ const monthStringName = (date, format = "MMM", options) => {
|
|
|
625
625
|
exports.monthStringName = monthStringName;
|
|
626
626
|
const dateFormatter = (date, format, separator = "-") => {
|
|
627
627
|
switch (format) {
|
|
628
|
+
case "y":
|
|
629
|
+
return (0, dayjs_1.default)(date).format("YYYY");
|
|
628
630
|
case "ymd":
|
|
629
631
|
return (0, dayjs_1.default)(date).format(`YYYY${separator}MM${separator}DD`);
|
|
630
632
|
case "dmy":
|
|
@@ -633,6 +635,8 @@ const dateFormatter = (date, format, separator = "-") => {
|
|
|
633
635
|
return (0, dayjs_1.default)(date).format(`DD${separator}MM${separator}YYYY HH:mm`);
|
|
634
636
|
case "dmyfr":
|
|
635
637
|
return (0, dayjs_1.default)(date).locale("fr").format("dddd DD MMMM YYYY");
|
|
638
|
+
case "myfr":
|
|
639
|
+
return (0, dayjs_1.default)(date).locale("fr").format("MMMM YYYY");
|
|
636
640
|
case "mfr-short":
|
|
637
641
|
return (0, dayjs_1.default)(date).locale("fr").format("MMM");
|
|
638
642
|
case "mfr-long":
|
package/lib/esm/utils.d.ts
CHANGED
|
@@ -98,6 +98,6 @@ export declare const returnBool: (tob?: boolean) => boolean;
|
|
|
98
98
|
export declare const monthStringName: (date: string | Date, format?: "MMM" | "MMMM", options?: {
|
|
99
99
|
en?: true;
|
|
100
100
|
}) => string;
|
|
101
|
-
export declare const dateFormatter: (date: Date | string, format?: "ymd" | "dmy" | "dmy-hm" | "dmyfr" | "mfr-short" | "mfr-long", separator?: "/" | "-") => string;
|
|
101
|
+
export declare const dateFormatter: (date: Date | string, format?: "y" | "ymd" | "dmy" | "dmy-hm" | "dmyfr" | "myfr" | "mfr-short" | "mfr-long", separator?: "/" | "-") => string;
|
|
102
102
|
export declare const countryIsoToFlag: (code: string) => string;
|
|
103
103
|
export declare const removeParamKeyName: (params: any, name?: string) => any;
|
package/lib/esm/utils.js
CHANGED
|
@@ -115,7 +115,7 @@ export const removeDuplicateObjects = (array, property = "id") => {
|
|
|
115
115
|
uniqueIds.push(element[property]);
|
|
116
116
|
|
|
117
117
|
return true;
|
|
118
|
-
}
|
|
118
|
+
}π
|
|
119
119
|
|
|
120
120
|
return false;
|
|
121
121
|
});
|
|
@@ -544,6 +544,8 @@ export const monthStringName = (date, format = "MMM", options) => {
|
|
|
544
544
|
};
|
|
545
545
|
export const dateFormatter = (date, format, separator = "-") => {
|
|
546
546
|
switch (format) {
|
|
547
|
+
case "y":
|
|
548
|
+
return dayjs(date).format("YYYY");
|
|
547
549
|
case "ymd":
|
|
548
550
|
return dayjs(date).format(`YYYY${separator}MM${separator}DD`);
|
|
549
551
|
case "dmy":
|
|
@@ -552,6 +554,8 @@ export const dateFormatter = (date, format, separator = "-") => {
|
|
|
552
554
|
return dayjs(date).format(`DD${separator}MM${separator}YYYY HH:mm`);
|
|
553
555
|
case "dmyfr":
|
|
554
556
|
return dayjs(date).locale("fr").format("dddd DD MMMM YYYY");
|
|
557
|
+
case "myfr":
|
|
558
|
+
return dayjs(date).locale("fr").format("MMMM YYYY");
|
|
555
559
|
case "mfr-short":
|
|
556
560
|
return dayjs(date).locale("fr").format("MMM");
|
|
557
561
|
case "mfr-long":
|