Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

39930: "Learn About" page not rendering properly in Safari #261

Merged
merged 1 commit into from Mar 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions webapp/Connector/src/ext-patches.js
Expand Up @@ -73,4 +73,25 @@ Ext.override(Ext.grid.View, {
}
me.superclass.setHighlightedItem.apply(this, arguments);
}
});

Ext.override(Ext.util.Format, {
date(v, format){
if (!v) {
return "";
}
if (!Ext.isDate(v)) {
var orig = v;
v = new Date(Date.parse(v));

// issue 39930 - Safari is strict regarding ECMAScript date time string formats (ISO 8601)
if (isNaN(v) && Ext.isSafari){
var parts = orig.split(/[\s-:.]/);
if (parts.length === 7) {
v = new Date(parseInt(parts[0]), parseInt(parts[1]) - 1, parseInt(parts[2]), parseInt(parts[3]), parseInt(parts[4]), parseInt(parts[5]), parseInt(parts[6]));
}
}
}
return Ext.Date.dateFormat(v, format || Ext.Date.defaultFormat);
}
});