Incorrect date format in new comment HTML

Bug #510539 reported by Emilis Dambauskas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Policy Feed
Confirmed
Low
Emilis Dambauskas

Bug Description

Steps:
- Go to document page.
- Submit a new comment.

Result:
A new comment appears with wrong date format (e.g. "2010-0-21 10:24").

Tags: comments
Revision history for this message
Darius Damalakas (darkcloud) wrote :

The reason for this is that The getMonth() method returns the month (from 0 to 11)
See docs for details: http://www.w3schools.com/jsref/jsref_getmonth.asp

The issue is in file static/files/PolicyFeed/Comments.js:182

When the page is reloaded, the date is taken from Comments table Update field. That field, AFAIK, is populated automatically by default by MYSQL, since it has setting default value to CURRENT_TIMESTAMP. So in this case everything works as expected

Revision history for this message
Darius Damalakas (darkcloud) wrote :

It seems JS does not have a proper dateFormat function (or at least i can not find one)
here is something more or less doing the right thing: http://blog.stevenlevithan.com/archives/date-time-format

we could use this to fix the issue. On the other hand, a simple +1 might also do the job to some extent

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.