shridharsahil / datejs

Automatically exported from code.google.com/p/datejs
0 stars 0 forks source link

Don't clobber Date.now #190

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It looks like the locally defined Date.now() is only used in a few places. 
Normally, Date.now() returns the EPOCH ms but Date.js redefines it to return 
new Date().

Instead of 
Date.now = function() { return new Date(); }

I would do something like
Date.nowAsDate = function() { return new Date(); } 

and update calls to Date.now() accordingly.

ref
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
/Date/now

Original issue reported on code.google.com by chad.arm...@cloudsherpas.com on 18 Jul 2014 at 3:59

GoogleCodeExporter commented 8 years ago
I agree with Chad,

I was using this library together with BingMaps. We decided to switch to Nokia 
Here Maps and nothing was working.

Eventually I found out that your library is overriding, in a wrong way, the 
Date.now(). As already mentioned "the now() method returns the milliseconds 
elapsed since 1 January 1970 00:00:00 UTC up until now as a Number."

Please update your code.

L.

Original comment by lorenzo....@gmail.com on 15 Sep 2014 at 10:33

GoogleCodeExporter commented 8 years ago
there is a newer version available jsdeliver has the old broken version...  
cloudflare has the correct version.
http://cdnjs.com/libraries/datejs

Original comment by david.de...@gmail.com on 22 Sep 2014 at 8:58