Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/components/FormDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,17 @@ export default {
return this.dataFormat === "datetime";
},
format() {
return this.datepicker ? getUserDateTimeFormat() : getUserDateFormat();
if (this.datepicker) {
let format = getUserDateTimeFormat();
// Check if the format already includes time patterns (hh:mm A or HH:mm)
const hasTimePattern = /[Hh]{1,2}:[mM]{1,2}/.test(format);
if (!hasTimePattern) {
// If forceDateTime is true and no time pattern exists, ensure the format includes hh:mm A
format = `${format.replace(/[\sHh:msaAzZ]/g, '')} hh:mm A`;
}
return format;
}
return getUserDateFormat();
},
classList() {
return {
Expand Down