Merge pull request #5155 from openstreetmap/fix-note-date

fix browser-specific Date() issues in notes
This commit is contained in:
Bryan Housel
2018-07-17 22:43:31 -04:00
committed by GitHub

View File

@@ -99,6 +99,7 @@ export function uiNoteComments() {
if (!s) return null;
var detected = utilDetect();
var options = { day: 'numeric', month: 'short', year: 'numeric' };
s = s.replace(/-/g, '/'); // fix browser-specific Date() issues
var d = new Date(s);
if (isNaN(d.getTime())) return null;
return d.toLocaleDateString(detected.locale, options);