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:
@@ -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 ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user