maps.googleapis.com incompatible with date.js

Viewed 1065

Recently encountered a problem with a long standing asp.net c# program.

In my default.aspx amongst other things we have...

<script src="https://maps.googleapis.com/maps/api/js?key=...&libraries=geometry"></script>

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

date.js is a utility library from http://www.datejs.com/

Just recently (last 6 weeks) our map is failing to draw anything, after a bit of investigation it seems that there's a toString() in one of the maps library files that tries to use the toString() from the date.js file and fails miserably.

Uncaught TypeError: format.replace is not a function
    at Date.toString (date.js:40)
    at iq (common.js:65)
    at Object._.Bq (common.js:75)
    at map.js:83

For the moment I can specify the version of google maps, 3.40 works fine, anything later doesn't.

Does anyone have a solution to this or has anyone seen this problem? Granted date.js is very old library now but I wondered if there's anything simply I can do.

3 Answers

I am also getting the same error in version 3.41, but after changing it to version 3.40, It works!

Ran into this same issue in a Rails app, updating data.js to a more recent version fixed it. There's a more recent fork that's available here that fixed the issue for me: https://github.com/abritinthebay/datejs

Related