fix[#1730, #1742] fixed datepicker clear btn and increased theslightly the fields contrast

This commit is contained in:
Gani Georgiev
2023-02-02 00:19:04 +02:00
parent 8b93aac8e3
commit 2b5f00b62e
37 changed files with 178 additions and 165 deletions
@@ -8,6 +8,8 @@
export let field = new SchemaField();
export let value = undefined;
let pickerValue = value;
// strip ms and zone for backwards compatibility with the older format
// and because flatpickr currently doesn't have integrated
// zones support and requires manual parsing and formatting
@@ -15,6 +17,10 @@
value = value.substring(0, 19);
}
$: if (pickerValue != value) {
pickerValue = value;
}
// ensure that value is set even on manual input edit
function onClose(e) {
if (e.detail && e.detail.length == 3) {
@@ -44,7 +50,7 @@
<Flatpickr
id={uniqueId}
options={CommonHelper.defaultFlatpickrOptions()}
{value}
bind:value={pickerValue}
bind:formattedValue={value}
on:close={onClose}
/>