Mercurial > urweb
comparison lib/js/urweb.js @ 1622:a20daedfd1d0
Avoid setting a Date's time with a non-integer value
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 03 Dec 2011 10:13:36 -0500 |
parents | 62d6d452c2b8 |
children | f96e708b4b93 |
comparison
equal
deleted
inserted
replaced
1621:62d6d452c2b8 | 1622:a20daedfd1d0 |
---|---|
329 // End of YUI code | 329 // End of YUI code |
330 | 330 |
331 function strftime(fmt, thisTime) | 331 function strftime(fmt, thisTime) |
332 { | 332 { |
333 var thisDate = new Date(); | 333 var thisDate = new Date(); |
334 thisDate.setTime(thisTime / 1000); | 334 thisDate.setTime(Math.floor(thisTime / 1000)); |
335 return Dt.format(thisDate, fmt); | 335 return Dt.format(thisDate, fmt); |
336 }; | 336 }; |
337 | 337 |
338 | 338 |
339 // Error handling | 339 // Error handling |
340 | 340 |
341 function whine(msg) { | 341 function whine(msg) { |