[Koha-bugs] [Bug 12729] Overdue items won't show as overdue in red in circulation

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Sep 4 14:32:01 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12729

--- Comment #6 from Dobrica Pavlinusic <dpavlin at rot13.org> ---
Kyle, I'm not quite sure why you are not seeing this bug, but I have some hints
what is happening.

In koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js (and probably other places)
you are using

var due = new Date( oObj.date_due );

to create date. However, in my installation oObj.date_due is

"2012-08-30 00:00:00"

which doesn't parse in Firefox:

new Date("2014-08-06 00:00:00");
Invalid Date

but does parse in Chrome:

new Date("2014-08-06 00:00:00");
Wed Aug 06 2014 00:00:00 GMT+0200 (CEST)

Since we are suggesting Firefox as browser for Koha, this is a huge
show-stopper.
However, Firefox is happy when space is replaced by T like this:

new Date("2014-08-06T00:00:00");
Date 2014-08-05T22:00:00.000Z

but as you can see above, without timezone it gets shifted by my timezone
offset (which is +2 in my case).

So adding additional timezone at end:

new Date("2014-08-06T00:00:00Z");
Date 2014-08-06T00:00:00.000Z

However, you are then comparing this date with new Date(); which again creates
GMT time instead of localtime:

new Date
Date 2014-09-04T12:30:02.556Z

(my current local time is 14:30:02, not 12:30!)

Dates and JavaScript is a mess. I would love to hear your feedback on this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list