Opened 9 years ago
Last modified 5 years ago
#16203 assigned defect
[patch][ccla] DateTextBox: does not validate correctly when using a Hebrew date.
Reported by: | barbossusus | Owned by: | dylan |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | DojoX Form | Version: | 1.7.3 |
Keywords: | Cc: | Adam Peller, hhelena, Douglas Hays | |
Blocked By: | Blocking: |
Description
Typing words, not numbers, in a DateTextBox? does not trigger the validation correctly because the regular expression provided by dojox.date.hebrew.locale is wrong.
From my investigation
_buildDateTimeRE : function(tokens, bundle, options, pattern){ .... line 372: s = '\\S+'; //in my opinion this should probably be replaced with s = '\\d+' //because "\S" means "Find a non-whitespace character" (w3schools) .... }
http://www.w3schools.com/jsref/jsref_obj_regexp.asp
Let me know if you need more details.
Attachments (3)
Change History (18)
comment:1 Changed 9 years ago by
Component: | General → Dijit - Form |
---|---|
Owner: | set to Douglas Hays |
Summary: | DateTextBox does not validate correctly when using a Hebrew date. → DateTextBox: does not validate correctly when using a Hebrew date. |
comment:2 Changed 8 years ago by
Cc: | Adam Peller hhelena added |
---|---|
Component: | Dijit - Form → Dojox |
Owner: | Douglas Hays deleted |
Status: | new → assigned |
comment:3 follow-up: 4 Changed 8 years ago by
could you please provide an example? Also, specify which calendar is used as well as which locale.
comment:4 follow-up: 5 Changed 8 years ago by
Replying to peller:
could you please provide an example? Also, specify which calendar is used as well as which locale.
1) create a Hebrew calendar by setting datePackage argument in the constructor of dijit.form.DateTextBox? to dojox.date.hebrew
2) set <html lang="en">
3) var dojoConfig = {locale: "en", ...}
4) run this page - a DateTextBox? should be visible on the screen
5) type any number of letters (an invalid date)-> no error message is displayed
This behaviour is not consistent with neither the Gregorian, nor the Islamic calendar (if steps 2-6 are followed )
comment:5 Changed 8 years ago by
This works fine in our unit tests (in Hebrew, but I switched the locale to English and it worked as well) Please attach the full HTML page rather than a list of steps. You also may wish to check the Javascript console for errors.
Also, note that step #2 is not necessary, though given that it matches the dojoConfig, it should not be harmful either.
Changed 8 years ago by
Attachment: | DateTextBoxTest.html added |
---|
comment:6 Changed 8 years ago by
Please use this file to observe the difference between the Hebrew and Gregorian DateTextBox? validation. I am also providing you with a screenshot. There are not console errors.
Changed 8 years ago by
Attachment: | Ticket_16203.png added |
---|
comment:7 Changed 8 years ago by
Cc: | Douglas Hays added |
---|
CC'ing Doug since it sounds related to his partial regex matching code.
comment:8 Changed 8 years ago by
also need to check the locale.js module in hebrew against the others, as that code is still copied and needs to be updated with latest fixes
comment:9 Changed 8 years ago by
The use of
S+ must have been deliberate, because in the Hebrew locale, the years are represented by the Hebrew alphabet rather than numerals.
comment:10 Changed 8 years ago by
Thanks for the prompt reply. Is this behaviour specific to the Hebrew calendar? The Islamic one behaves just like the Gregorian one.
Also, as a user I expect that the string I type (input) to be similar to the one produced by the control (output). So, if the control produces "5773-02-14"(only date strings represented using digits and dashes), the user is expected to introduce similar strings (learned from the control), without Hebrew alphabet. Otherwise this control would behave inconsistently.
comment:11 Changed 8 years ago by
Is this behaviour specific to the Hebrew calendar?
Yes. Hebrew letters, used to represent numbers, are specific to the Hebrew calendar in the Hebrew locale. There are alternate numeric symbols used for Arabic locales (in calendars and elsewhere) but they have yet to be implemented.
The case you cite is a Hebrew date represented "short" form in the English locale and does not use Hebrew letters. Somehow, that code must support formats for all locales.
comment:12 Changed 8 years ago by
Component: | Dojox → DojoX Form |
---|
comment:13 Changed 8 years ago by
Summary: | DateTextBox: does not validate correctly when using a Hebrew date. → [patch][ccla]DateTextBox: does not validate correctly when using a Hebrew date. |
---|
comment:14 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|---|
Owner: | set to dylan |
Summary: | [patch][ccla]DateTextBox: does not validate correctly when using a Hebrew date. → [patch][ccla] DateTextBox: does not validate correctly when using a Hebrew date. |
Not sure why this was never finally reviewed or landed?
comment:15 Changed 5 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
This is a possible problem with dojox/date/hewbrew/locale.js