@communecter/cocolight-api-client 1.0.92 → 1.0.94
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 +6 -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
|
}
|