@communecter/cocolight-api-client 1.0.92 → 1.0.93
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/cocolight-api-client.browser.js +1 -1
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
- package/package.json +1 -1
- package/src/ApiClient.ts +8 -0
package/package.json
CHANGED
package/src/ApiClient.ts
CHANGED
|
@@ -1593,6 +1593,12 @@ export default class ApiClient extends EventEmitter {
|
|
|
1593
1593
|
return { $date: value.sec * 1000 };
|
|
1594
1594
|
} else if (typeof value === "number") {
|
|
1595
1595
|
return { $date: value * 1000 };
|
|
1596
|
+
} else if (typeof value === "string" && value.trim() !== "") {
|
|
1597
|
+
const date = new Date(value);
|
|
1598
|
+
// Vérifier que la date est valide (pas NaN)
|
|
1599
|
+
if (!isNaN(date.getTime())) {
|
|
1600
|
+
return EJSON.toJSONValue(date);
|
|
1601
|
+
}
|
|
1596
1602
|
}
|
|
1597
1603
|
return value;
|
|
1598
1604
|
}
|
|
@@ -1667,7 +1673,9 @@ export default class ApiClient extends EventEmitter {
|
|
|
1667
1673
|
|
|
1668
1674
|
// Si la clé correspond à un champ de date, on applique la normalisation de date.
|
|
1669
1675
|
if (this._dateFields.includes(key)) {
|
|
1676
|
+
console.log(key, value);
|
|
1670
1677
|
value = this._normalizeDate(value);
|
|
1678
|
+
console.log("Date", key, value);
|
|
1671
1679
|
}
|
|
1672
1680
|
|
|
1673
1681
|
// Si la clé correspond à un champ d'image, on applique la normalisation d'image.
|