Opened 10 years ago
Closed 10 years ago
#12295 closed defect (fixed)
Date and datetime format hint can be incorrect
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.10 |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | datetime |
| Cc: | Branch: | ||
| Release Notes: |
Fixed datetime format hint used in place of a date format hint. Fixed ISO9601 date or datetime format hint repeated twice in an error message. |
||
| API Changes: | |||
| Internal Changes: | |||
Description
Noted in comment:4:ticket:12285, the date format hint can sometimes read Try "MMM d, y" or "YYYY-MM-DDThh:mm:ss±hh:mm" instead, but should be Try "MMM d, y" or "YYYY-MM-DD" instead.
I also noticed that when the locale is iso8601 the date and datetime format hint can read Try "YYYY-MM-DD" or "YYYY-MM-DD" instead and Try "YYYY-MM-DDThh:mm:ss±hh:mm" or "YYYY-MM-DDThh:mm:ss±hh:mm" instead, respectively.
Attachments (0)
Change History (4)
comment:1 by , 10 years ago
| Owner: | set to |
|---|
comment:2 by , 10 years ago
2 failures with Babel 0.9.6.
Package Version
---------------------------------------------------------------------
Python : 2.5.6 (r256:88840, Oct 21 2014, 22:26:35)
[GCC 4.6.3]
Setuptools : 0.6
Genshi : 0.7
Babel : 0.9.6
sqlite3 : 2.3.2
PySqlite : 2.6.3
MySQLdb : 1.2.5
Psycopg2 : 2.5.2 (dt dec pq3 ext)
SVN bindings : 1.6.23 (r1485506)
Mercurial : 3.4
Pygments : 1.6
Textile : not installed
Pytz : 2015.2
ConfigObj : 4.7.2
Docutils : 0.12
Twill : 0.9
LXML : 3.3.6
coverage : 3.7.1
figleaf : not installed
...
======================================================================
FAIL: test_hint_date (trac.util.tests.datefmt.I18nDateFormatTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/run/shm/c05fba74ef7cd7cba9ec41346f37822dac3d2dec/py25-sqlite/trac/util/tests/datefmt.py", line 1198, in test_hint_date
unicode(e))
File "/run/shm/c05fba74ef7cd7cba9ec41346f37822dac3d2dec/py25-sqlite/trac/tests/compat.py", line 55, in assertIn
(member, container))
AssertionError: 'Try "MMM d, y" or "YYYY-MM-DD" instead.' not in u'"***" is an invalid date, or the date format is not known. Try "MMM d, yyyy" or "YYYY-MM-DD" instead.'
======================================================================
FAIL: test_hint_datetime (trac.util.tests.datefmt.I18nDateFormatTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/run/shm/c05fba74ef7cd7cba9ec41346f37822dac3d2dec/py25-sqlite/trac/util/tests/datefmt.py", line 1207, in test_hint_datetime
unicode(e))
File "/run/shm/c05fba74ef7cd7cba9ec41346f37822dac3d2dec/py25-sqlite/trac/tests/compat.py", line 55, in assertIn
(member, container))
AssertionError: u'Try "MMM d, y, h:mm:ss a" or "YYYY-MM-DDThh:mm:ss\xb1hh:mm" instead.' not in u'"***" is an invalid date, or the date format is not known. Try "MMM d, yyyy h:mm:ss a" or "YYYY-MM-DDThh:mm:ss\xb1hh:mm" instead.'
----------------------------------------------------------------------
Ran 1787 tests in 45.670s
FAILED (failures=2)
make: *** [unit-test] Error 1
comment:4 by , 10 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |



Proposed changes in log:rjollos.git:t12295_parse_date_hint:. Tests pass with and without Babel installed.