JavaScript SyntaxError in the Sitecore Client when using Google Chrome on non-English OS


Description

The Sitecore Client may not work when using Google Chrome on a machine with a non-English culture, for example, Japanese.
A JavaScript error like the following may appear in the browser:
Uncaught SyntaxError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'Thu Nov 14 2013 18:27:20 GMT+0900 …' is not a valid HTTP header field value.

Solution

Replace the following JavaScript code line in the /sitecore/shell/Controls/Sitecore.js file:

this.httpRequest.setRequestHeader("lastCached", new Date().toString());

with:

this.httpRequest.setRequestHeader("lastCached", new Date().toString().split('(')[0]);