Skip to content

Commit 401455c

Browse files
Change condition to format
1 parent f18848a commit 401455c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/FormDatePicker.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,16 @@ export default {
145145
return this.dataFormat === "datetime";
146146
},
147147
format() {
148-
let format = this.datepicker ? getUserDateTimeFormat() : getUserDateFormat();
149148
if (this.datepicker) {
149+
let format = getUserDateTimeFormat();
150150
// Check if the format already includes time patterns (hh:mm A or HH:mm)
151151
const hasTimePattern = /[Hh]{1,2}:[mM]{1,2}/.test(format);
152152
if (!hasTimePattern) {
153153
// If forceDateTime is true and no time pattern exists, ensure the format includes hh:mm A
154-
format = format.replace(/[\sHh:msaAzZ]/g, '') + ' hh:mm A';
154+
format = `${format.replace(/[\sHh:msaAzZ]/g, '')} hh:mm A`;
155155
}
156156
}
157-
return format;
157+
return getUserDateFormat();
158158
},
159159
classList() {
160160
return {

0 commit comments

Comments
 (0)