-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #23671: Locale issue: date picker outputs date in wrong order #5157
Fixes #23671: Locale issue: date picker outputs date in wrong order #5157
Conversation
The patch is a bit shorter than that.... |
PR rebased |
8932a0e
to
e4ba7fd
Compare
This breaks actual tests:
|
I do think we want to enforce dd/mm/yyyy everywhere (I think it just have to be forced on client side) |
@@ -564,7 +564,7 @@ case object OrderedStringComparator extends TStringComparator { | |||
|
|||
case object DateComparator extends LDAPCriterionType { | |||
override val comparators = OrderedComparators.comparators.filterNot(c => c == Regex || c == NotRegex) | |||
val fmt = "dd/MM/yyyy" | |||
val fmt = "yyyy/MM/dd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not change that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore my comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use RFC3339 format ? If we are changing it at all? (ie yyyy-MM-dd
)
@@ -579,6 +579,7 @@ case object DateComparator extends LDAPCriterionType { | |||
// init a jquery datepicker | |||
override def initForm(formId: String): JsCmd = OnLoad(JsRaw("""var init = $.datepicker.regional['en']; | |||
init['showOn'] = 'focus'; | |||
init['dateFormat'] = 'yy/mm/dd'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change it to dd/MM/yyyy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep it it's ok
Go for yyyy/mm/dd and correct the tests |
Commit modified |
bc43b85
to
0ef920e
Compare
Commit modified |
0ef920e
to
2228ec0
Compare
Fixes #23671: Locale issue : Date picker outputs date in wrong order
2228ec0
to
ed91926
Compare
PR updated with a new commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand if the change are just at the query langage level for new input, or more.
I'm almost sure that change should have to deal somewhere with a compatibility layer so that existing serialized data, for dyn group queries, or other things, are dealt with, or that the query lang test several input format and try to guess which one it should use.
Please, you need to explain how these compat subject are addressed, and you should not do a PR without a comment explaining the architectural impact of the change (or if none, why so)
So, to sum-up and be clear:
|
@@ -564,7 +564,7 @@ case object OrderedStringComparator extends TStringComparator { | |||
|
|||
case object DateComparator extends LDAPCriterionType { | |||
override val comparators = OrderedComparators.comparators.filterNot(c => c == Regex || c == NotRegex) | |||
val fmt = "dd/MM/yyyy" | |||
val fmt = "yyyy/MM/dd" | |||
val frenchFmt = DateTimeFormat.forPattern(fmt).withLocale(Locale.FRANCE) | |||
def error(value: String, e: Exception) = Inconsistency( | |||
s"Invalide date: '${value}', expected format is: '${fmt}'. Error was: ${e.getMessage}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you fix this typo also ?
I'm closing this PR, it contains some works about what we can do to change the format in the backend, this is the PR that are fixing the issue by only modifying the date picker expected format for the UI : #5201 |
https://issues.rudder.io/issues/23671
⚠️ We should validate that this change doesn't break anything and need more attention. We should not merge this without validating that is not breaking any other part of Rudder