Edgewall Software
Modify

Opened 5 years ago

Closed 5 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 Ryan J Ollos, 5 years ago

Owner: set to Ryan J Ollos

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

comment:2 by Jun Omae, 5 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:3 by Ryan J Ollos, 5 years ago

I guess the issue is similar to [11892].

comment:4 by Ryan J Ollos, 5 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Revised changes tested with Babel 0.9.6 and 2.2.1. Committed to 1.0-stable in [14403], merged to trunk in [14404].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.