mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-25 05:20:20 +01:00
Merge pull request #5155 from openstreetmap/fix-note-date
fix browser-specific Date() issues in notes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user