bare-script 2.2.12 → 2.2.13
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/library.js +6 -2
- package/package.json +1 -1
package/lib/library.js
CHANGED
|
@@ -278,9 +278,13 @@ export const scriptFunctions = {
|
|
|
278
278
|
'datetimeISOFormat': ([datetime, isDate = false]) => {
|
|
279
279
|
let result = null;
|
|
280
280
|
if (datetime instanceof Date) {
|
|
281
|
-
result = datetime.toISOString();
|
|
282
281
|
if (isDate) {
|
|
283
|
-
|
|
282
|
+
const year = datetime.getFullYear();
|
|
283
|
+
const month = datetime.getMonth() + 1;
|
|
284
|
+
const day = datetime.getDate();
|
|
285
|
+
result = `${year}-${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day}`;
|
|
286
|
+
} else {
|
|
287
|
+
result = datetime.toISOString();
|
|
284
288
|
}
|
|
285
289
|
}
|
|
286
290
|
return result;
|