Skip to content

Commit

Permalink
Merge pull request #8054 from ehuelsmann/fix/1.11/date-selector-forma…
Browse files Browse the repository at this point in the history
…tting

Fix date format presentation not being aligned with placeholder
  • Loading branch information
ehuelsmann committed Mar 6, 2024
2 parents 5811891 + 799e42d commit afa5823
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions UI/js-src/lsmb/DateTextBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ define([

/* retrieve format to add it as the placeholder
* (unless there's a placeholder already) */
params.constraints.formatLength ||= "short";
if (!params.placeholder) {
var l = i18n.normalizeLocale(params.locale);
var formatLength = params.formatLength || "short";
var formatLength = params.constraints.formatLength;
var bundle = locale._getGregorianBundle(l);

if (params.constraints.selector === "year") {
Expand All @@ -57,9 +58,10 @@ define([
params.constraints.datePattern ||
bundle["dateFormat-" + formatLength];
}
params.constraints.datePattern = params.placeholder;
params.placeholder = params.placeholder
.replace(/M/g, "m")
.replace(/y/g, "yy");
.replace(/yy?y?y?/g, "yyyy");
}
},
postMixInProperties: function () {
Expand Down

0 comments on commit afa5823

Please sign in to comment.