JS Date functions not working in SharePoint with IE…?

Ever run into a problem where you have what you know to be valid javascript, trying to work with a Date object, and yet you keep getting JS errors in the console? If you’re working in SharePoint 2010 or older, blame Microsoft ;-)

Joking aside, even if you’re using the latest version of Internet Explorer, because of the meta tags present in the OOTB masterpages of the older versions of SharePoint, IE will load the page in an older Document Mode; IE8 Standards for SP2010 and Quirks for SP2007. You can always, of course, apply a different masterpage or customize the native ones, however you run the risk of encountering issues elsewhere – for example, remove the “IE8″ meta tag from an SP2010 masterpage (or just setting it to a newer version) causes myriad issues with controls like the People Picker, the RTF field, certain menu options in the Item Context Menu, etc.

If your organization’s timeline for upgrading to SP2013 is a long-term effort, consider allowing/enabling your users to run Firefox or Chrome (Chrome Frame was a nice alternative until it was retired at the end of 2013). I know, not the most ideal answer – but at least you can stop banging your head on your desk wondering why your perfectly valid JS for manipulating Dates keeps throwing errors in IE.

Comments are closed.