[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #4545 [TorBrowserButton]: torbutton_set_timezone() does not work (properly)
#4545: torbutton_set_timezone() does not work (properly)
------------------------------+---------------------------------------------
Reporter: gk | Owner: mikeperry
Type: defect | Status: new
Priority: major | Milestone: TorBrowserBundle 2.2.x-stable
Component: TorBrowserButton | Version:
Keywords: | Parent:
Points: | Actualpoints:
------------------------------+---------------------------------------------
Comment(by gk):
No, I just meant that the saved offset string is wrong in those cases
(that's why, I thought this ticket only describes minor issues). That said
instead of
{{{
if(Math.floor(offset/60) < 10) {
offStr += "0";
}
offStr += Math.floor(offset/60)+":";
if((offset%60) < 10) {
offStr += "0";
}
offStr += (offset%60);
}}}
something like
{{{
var minutes = offset % 60;
// Division in JS gives always floating point results we do not want.
// And Math.floor() is not working properly for negative values.
if ((offset - minutes) / 60 < 10) {
offStr += "0";
}
offStr += ((offset - minutes) / 60) + ":";
if ((minutes) < 10) {
offStr += "0";
}
offStr += (minutes);
}}}
should fix that "issue".
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4545#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs