Skip to content

Conversation

@marcoAntonioNina
Copy link
Contributor

@marcoAntonioNina marcoAntonioNina commented Sep 9, 2025

Ticket FOUR-25088

According to the date picker configuration, if it is a datetime type, a hh:mm is added by default if the date and time configuration does not have the time.

},
format() {
return this.datepicker ? getUserDateTimeFormat() : getUserDateFormat();
let format = this.datepicker ? getUserDateTimeFormat() : getUserDateFormat();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a fallback control
format = format || 'YYYY-MM-DD'; // fallback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the functions getUserDateTimeFormat() and getUserDateFormat() already have a fallback defined.

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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is posible use
format =${format} hh:mm A;
instead of replace?

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants