kelt-ui-kit-react 1.6.4 → 1.6.5
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/package.json
CHANGED
|
@@ -45,3 +45,12 @@ export function FormatDate(date: Date, format: string): string {
|
|
|
45
45
|
.replace("mm", minutes)
|
|
46
46
|
.replace("ss", seconds);
|
|
47
47
|
}
|
|
48
|
+
export function localDateStringToUTC(dateStr: string): string {
|
|
49
|
+
const [year, month, day] = dateStr.split("-").map(Number);
|
|
50
|
+
|
|
51
|
+
// Crée une date en heure locale
|
|
52
|
+
const localDate = new Date(year, month - 1, day, 0, 0, 0);
|
|
53
|
+
|
|
54
|
+
// Convertit en UTC ISO
|
|
55
|
+
return localDate.toISOString();
|
|
56
|
+
}
|