F24d9 custom time format (#473)

* fix password reset bug

* feat: time format in dat input

* fix lint issues

* fix time prefill, time format backend

* fix time format in OpenDate

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka
2024-07-15 22:31:04 +01:00
committed by GitHub
parent 9a17787f76
commit 2a23c0a4f5
10 changed files with 37 additions and 10 deletions

View File

@@ -64,6 +64,7 @@
v-if="props.dateRange"
v-model.range="modeledValue"
:mode="props.withTime ? 'dateTime' : 'date'"
:is24hr="props.timeFormat == '24'"
is-required
borderless
:min-date="minDate"
@@ -76,6 +77,7 @@
v-else
v-model="modeledValue"
:mode="props.withTime ? 'dateTime' : 'date'"
:is24hr="props.timeFormat == '24'"
is-required
borderless
:min-date="minDate"
@@ -112,6 +114,7 @@ const props = defineProps({
disablePastDates: { type: Boolean, default: false },
disableFutureDates: { type: Boolean, default: false },
dateFormat: { type: String, default: 'dd/MM/yyyy' },
timeFormat: { type: String, default: '24' },
outputDateFormat: { type: String, default: 'yyyy-MM-dd\'T\'HH:mm:ssXXX' },
isDark: { type: Boolean, default: false }
})
@@ -190,8 +193,9 @@ const clear = () => {
const formattedDate = (value) => {
if (props.withTime) {
try {
return format(new Date(value), props.dateFormat + ' HH:mm')
return format(new Date(value), props.dateFormat + (props.timeFormat == 12 ? ' p':' HH:mm'))
} catch (e) {
console.log(e)
return ''
}
}

View File

@@ -22,9 +22,11 @@
},
]"
>
<div
v-for="(option, index) in options"
v-if="options && options.length"
<template
v-if="options && options.length"
>
<div
v-for="(option) in options"
:key="option[optionKey]"
:role="multiple?'checkbox':'radio'"
:aria-checked="isSelected(option[optionKey])"
@@ -67,6 +69,7 @@
{{ option[displayKey] }}
</p>
</div>
</template>
<div
v-else
:class="[