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

@@ -39,9 +39,10 @@ export default {
formattedDate(val) {
if (!val) return ''
const dateFormat = _has(this.property, 'date_format') ? this.property.date_format : 'dd/MM/yyyy'
const timeFormat = _has(this.property, 'time_format') ? this.property.time_format : '24'
if (this.property?.with_time) {
try {
return format(new Date(val), dateFormat + ' HH:mm')
return format(new Date(val), dateFormat + (timeFormat == 12 ? ' p':' HH:mm'))
} catch (e) {
return ''
}