fix browser-specific Date() issues in notes

This commit is contained in:
Thomas Hervey
2018-07-17 16:07:47 -04:00
parent 4c9ef45448
commit b0ba681538
+1
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);