#12202 closed defect (fixed)
Mismatch datetime separator in datetime picker for several locales
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.9 |
Component: | i18n | Version: | 1.0-stable |
Severity: | normal | Keywords: | datetimepicker |
Cc: | Branch: | ||
Release Notes: |
Fix parsing error in datetime picker when datetime separator of the locale isn't a space character, e.g. en_US in Babel 1.3. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Originally reported in [50289f02/rjollos.git].
timepicker_separator
is always ' '
when iso8601 format isn't configured. However, date/time separator isn't a space character for several locales.
({0}
is time part, {1}
is date part in get_datetime_format()
).
>>> import babel >>> babel.__version__ '0.9.6' >>> from babel.dates import get_datetime_format >>> from trac.util.translation import get_available_locales >>> fmts = {} >>> for locale_id in 'ca cs da de el en_GB en_US eo es es_AR es_MX et fa fi fr gl he hu hy it ja ko nb nl pl pt pt_BR ro ru sl sv tr uk vi zh_CN zh_TW'.split(): ... fmt = get_datetime_format('medium', locale_id) ... fmts.setdefault(fmt, []).append(locale_id) ... >>> for fmt in sorted(fmts): ... print('%r => %s' % (fmt, ' '.join(fmts[fmt]))) ... u'{0} {1}' => vi u'{1} {0}' => ca cs da de el en_GB en_US eo es es_AR es_MX et fi fr gl he hu hy it ja ko nb nl pl pt pt_BR ru sl sv tr uk zh_CN zh_TW u'{1}, {0}' => ro u'{1}\u060c \u0633\u0627\u0639\u062a {0}' => fa
>>> import babel >>> babel.__version__ '1.3' >>> from babel.dates import get_datetime_format >>> from trac.util.translation import get_available_locales >>> fmts = {} >>> for locale_id in 'ca cs da de el en_GB en_US eo es es_AR es_MX et fa fi fr gl he hu hy it ja ko nb nl pl pt pt_BR ro ru sl sv tr uk vi zh_CN zh_TW'.split(): ... fmt = get_datetime_format('medium', locale_id) ... fmts.setdefault(fmt, []).append(locale_id) ... >>> for fmt in sorted(fmts): ... print('%r => %s' % (fmt, ' '.join(fmts[fmt]))) ... u'{0} {1}' => nb vi u'{1} - {0}' => el u'{1} {0}' => ca cs da de en_GB eo es es_AR es_MX et fi fr gl hu it ja ko nl pt pt_BR sl sv tr uk zh_CN zh_TW u'{1}, {0}' => en_US he hy pl ro ru u'{1}\u060c\u200f {0}' => fa
Attachments (0)
Change History (6)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:3 by , 9 years ago
The change looks good. I might have found another issue while testing, reported in #12203.
comment:4 by , 9 years ago
This might be unrelated, but after the upgrade of timepicker in [14312:14313], with the changes for this ticket rebased on the trunk, an error is seen in the console when the separator is anything other than a whitespace (e.g. en_US):
Error parsing the date string: Extra/unparsed characters found in date: , 11:45:29 AM date string = Sep 5, 2015, 11:45:29 AM date format = M d, yy
I can create another ticket for the issue if it's unrelated.
comment:5 by , 9 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:6 by , 9 years ago
Thanks for explaining that. It seems odd to me that they explicitly log the error on line 1756 rather than suppressing it in the catch
.
Proposed changes in [83e0d4c90/jomae.git].