We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd50ec5 commit 39bff54Copy full SHA for 39bff54
datex-bindings/dom-utils.ts
@@ -926,6 +926,13 @@ export class DOMUtils {
926
return date.toISOString().slice(0,10)
927
}
928
else if (element.type == "time") {
929
+ // empty value
930
+ if (!val) return "";
931
+
932
+ // if already in time (e.g. HH:mm:ss) format, return directly
933
+ if (typeof val == "string" && val.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?$/)) return val;
934
935
+ // handle conversion from Date or number
936
const date = val instanceof Date ? val : new Date(val);
937
// show seconds if step is < 60
938
if (element.step && Number(element.step) < 60) return date.toISOString().slice(11,19)
0 commit comments