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.
@@ -1 +1,2 @@
1
1
  export declare function FormatDate(date: Date, format: string): string;
2
+ export declare function localDateStringToUTC(dateStr: string): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kelt-ui-kit-react",
3
3
  "type": "module",
4
- "version": "1.6.4",
4
+ "version": "1.6.5",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -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
+ }