Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#6229 closed defect (fixed)

Date fields for reports require specific format and do not return errors properly

Reported by: jjustman@… Owned by: bobbysmith007
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


On the reports page, the text boxes for start and end time require a text string suitable for JavaScript's Date.parse() method:

The form of which is similar to:

"Mon, 25 Dec 1995 13:30:00 GMT"

It does not accept more useful RFC-compliant date strings. The report page should at least say this, if not offer a reasonable date picker widget.

Perhaps more importantly, the tests for invalid dates don't work as intended in the JavaScript code. I never see the 'alert' statement no matter what I enter. I don't have more detailed information as I'm having difficulty getting any breakpoints to work in the code.

Testing with Trac 0.11, TAEP 0.8.0, FireFox 3.5x.

Attachments (0)

Change History (5)

comment:1 Changed 5 years ago by bobbysmith007

Hmmm... Dates in the form MM/DD/YYYY work fine as best I can tell. (so you dont have to use the funky format up there). I agree accepting many standard and locale specific formats would be nice, but that is not feasible (at least for me now). I will look into adding a Calendar widget or something.

new Date('11/16/2009')
new Date('11/16/2009 12:15')

The date validation code not working is somewhat more troubling. When I get a chance, I will attempt to rectify this.

Sorry for any inconvenience,

comment:2 Changed 5 years ago by anonymous

Ah, you're right. That format does work, however the following do not:


I'm accustomed to the first being a non-ambiguous, sortable format. Not your fault JavaScript is kind of backwards when it comes to that.

Thanks for the quick response.

comment:3 Changed 5 years ago by bobbysmith007

yes, I much prefer yyyy-mm-dd for its iSO8601-ishness, unambiguity and relative saneness.

While I am digging around in there, I might whip up a regex to check for iso date stamps.


comment:4 Changed 5 years ago by bobbysmith007

  • Resolution set to fixed
  • Status changed from new to closed

(In [7230]) fixes #6229

Date entry on the billing/management/time reports screen should be more forgiving.

I have pulled in a javascript date library that seems to do a better job of parsing arbitrary date formats. On my check it seems to support both the current date format and iso8601 type descending precedence dates.

Hope this helps

comment:5 Changed 5 years ago by bobbysmith007

(In [7231]) got it alerting invalid dates
re #6229

Add Comment

Modify Ticket

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from bobbysmith007. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.