fix: add a hasSeconds check to the step check to be able to type a value for seconds in the input

This commit is contained in:
Jacob Overgaard
2024-05-03 14:35:11 +02:00
parent 21b1026d33
commit 56d4b1de78

View File

@@ -48,6 +48,7 @@ export class UmbPropertyEditorUIDatePickerElement extends UmbLitElement implemen
// Format string prevalue/config
const format = config.getValueByAlias<string>('format');
const hasTime = format?.includes('H') || format?.includes('m');
const hasSeconds = format?.includes('s');
this._inputType = hasTime ? 'datetime-local' : 'date';
// Based on the type of format string change the UUI-input type
@@ -58,7 +59,7 @@ export class UmbPropertyEditorUIDatePickerElement extends UmbLitElement implemen
this._min = config.getValueByAlias('min');
this._max = config.getValueByAlias('max');
this._step = config.getValueByAlias('step');
this._step = config.getValueByAlias('step') ?? hasSeconds ? 1 : undefined;
if (this.value) {
this.#formatValue(this.value);