Skip to content

Commit

Permalink
Adds Safari bug comments
Browse files Browse the repository at this point in the history
misc fixes
  • Loading branch information
megheaiulian committed Mar 16, 2019
1 parent 35b17d5 commit 698191c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cosmoz-omnitable-column-date-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
* @return {String} an ISO date string, with timezone info
*/
getAbsoluteISOString(localISOString) {
// Most browsers use local timezone when no timezone is specified
// but Safari uses UTC, so we set it implicitly
// TODO: Consider removing this when/if Safari handles local timezone correctly
if (localISOString.length === 19) {
return localISOString + this._getTimezoneString(localISOString);
}
Expand Down
6 changes: 4 additions & 2 deletions cosmoz-omnitable-column-time.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ <h3 style="margin: 0;">[[ title ]]</h3>
* @returns {Date|void} Value converted to date optionaly limitated
*/
toDate(value, limit, limitFunc) {
// Most browsers use local timezone when no timezone is specified
// but Safari uses UTC, so we set it implicitly
// TODO: Consider removing this when/if Safari handles local timezone correctly
const date = typeof value === 'string' && value.length > 3 && value.length <= 9
? this.getAbsoluteISOString(this._fixedDate + 'T' + value)
: value;
Expand Down Expand Up @@ -142,8 +145,7 @@ <h3 style="margin: 0;">[[ title ]]</h3>
if (value == null) {
return;
}
value = this.getAbsoluteISOString(this._fixedDate + 'T' + value);
value = this.toValue(value);
value = this.toValue(this.getAbsoluteISOString(this._fixedDate + 'T' + value));
if (value == null) {
return;
}
Expand Down

0 comments on commit 698191c

Please sign in to comment.