FIX: end date of ranges in html preview was incorrect (#9654)

This commit also remove an unused block of code as previewedTimezones can't be empty anymore.
This commit is contained in:
Joffrey JAFFEUX
2020-05-06 17:16:36 +02:00
committed by GitHub
parent c99ecba68f
commit 2f714c7412
2 changed files with 50 additions and 15 deletions

View File

@ -113,22 +113,16 @@ export default class LocalDateBuilder {
previewedTimezones.push({
timezone: this._zoneWithoutPrefix(timezone),
formated: this._createDateTimeRange(
localDate.datetimeWithZone(timezone),
DateWithZoneHelper.fromDatetime(
localDate.datetime,
localDate.timezone,
timezone
),
this.time
)
});
});
if (!previewedTimezones.length) {
previewedTimezones.push({
timezone: "UTC",
formated: this._createDateTimeRange(
localDate.datetimeWithZone("Etc/UTC"),
this.time
)
});
}
return previewedTimezones.uniqBy("timezone");
}