mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: prefer timezones over timezone for previews (#10506)
eg: timezone="America/Detroit" timezones="US/Eastern" Before this commit we would show America/Detroit in previews and not US/Eastern, given US/Eastern and America/Detroit are equivalent. After this commit, we will display the date with America/Detroit but show US/Eastern in the previews.
This commit is contained in:
parent
1acb2f752b
commit
4f7a9802e7
@ -83,9 +83,7 @@ export default class LocalDateBuilder {
|
|||||||
const previewedTimezones = [];
|
const previewedTimezones = [];
|
||||||
|
|
||||||
const timezones = this.timezones.filter(
|
const timezones = this.timezones.filter(
|
||||||
timezone =>
|
timezone => !this._isEqualZones(timezone, this.localTimezone)
|
||||||
!this._isEqualZones(timezone, this.localTimezone) &&
|
|
||||||
!this._isEqualZones(timezone, this.timezone)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
previewedTimezones.push({
|
previewedTimezones.push({
|
||||||
@ -105,7 +103,8 @@ export default class LocalDateBuilder {
|
|||||||
this.timezone &&
|
this.timezone &&
|
||||||
displayedTimezone === this.localTimezone &&
|
displayedTimezone === this.localTimezone &&
|
||||||
this.timezone !== displayedTimezone &&
|
this.timezone !== displayedTimezone &&
|
||||||
!this._isEqualZones(displayedTimezone, this.timezone)
|
!this._isEqualZones(displayedTimezone, this.timezone) &&
|
||||||
|
!this.timezones.any(t => this._isEqualZones(t, this.timezone))
|
||||||
) {
|
) {
|
||||||
timezones.unshift(this.timezone);
|
timezones.unshift(this.timezone);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user