From 8d5bfbe828f55688c430200742b42d1af7c274fb Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 9 Jan 2022 13:33:12 +0100 Subject: [PATCH] feat: add two inputs to toggle flatpickr --- src/components/date/datepickerWithRange.vue | 48 +++++++++++++++++++-- src/i18n/lang/en.json | 4 ++ 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/src/components/date/datepickerWithRange.vue b/src/components/date/datepickerWithRange.vue index 3587fabc..77af08ec 100644 --- a/src/components/date/datepickerWithRange.vue +++ b/src/components/date/datepickerWithRange.vue @@ -22,7 +22,29 @@ {{ $t('misc.custom') }} -
+
+ + ({ altInput: true, dateFormat: 'Y-m-d H:i', enableTime: false, - inline: true, + wrap: true, mode: 'range', locale: { firstDayOf7Days: weekStart.value, @@ -137,9 +159,27 @@ const customRangeActive = computed(() => { .flatpickr-container { width: 70%; border-left: 1px solid var(--grey-200); + padding: 1rem; + font-size: .9rem; - :deep(input.input) { - display: none; + // Flatpickr has no option to use it without an input field so we're hiding it instead + :deep(input.form-control.input) { + height: 0; + padding: 0; + border: 0; + } + + .field .control :deep(.button) { + border: 1px solid var(--input-border-color); + height: 2.25rem; + + &:hover { + border: 1px solid var(--input-hover-border-color); + } + } + + .label, .input, :deep(.button) { + font-size: .9rem; } } diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 1121d91b..83dadcc9 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -522,6 +522,10 @@ "multiselect": { "createPlaceholder": "Create new", "selectPlaceholder": "Click or press enter to select" + }, + "datepickerRange": { + "to": "To", + "from": "From" } }, "task": {