Jump to content

Include date.js causes all timer and tweens to stop working


markp
 Share

Recommended Posts

I've been having a problem with timer events and tweens not working at all and it would appear that just by having a script src to date.js included it causes the issue but I have no idea why. 

 

The data.js can be downloaded from this site https://github.com/datejs/Datejs.  I'm using Phaser v2.0.1 and the latest datejs.

 

I can reproduce the issue just by adding the following line to view_full.html in the examples and then trying one of the time based examples or one with animation.  None of the animations or tweening will work.

<script src="_site/js/date.js" type="text/javascript"></script>

Obviously the data.js file must be dropped into the relative folder used in the src attribute.

 

Swapping with moment.js is possibly as referencing that file does not affect the examples as far as I can tell.  I'd rather understand why just including date.js causes phaser to completely stop handling time events and only if there isn't a solution convert to moment.js.

 

Any ideas?

 

Link to comment
Share on other sites

I took a quick look at datejs and it is directly modifying the core Date object and its prototype. I'm suspecting it might be replacing an existing function on the Date object. The library hasn't been updated in 5 years so it's likely there has been api change to the Date object that cause compatibility issue with it.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...