mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 19:47:49 +01:00
Fixed offset for graphs with minutes in timezones
Timezone offset is now a double. This fix seems very simple, and it kinda is. HighCharts represents offset in minutes. Java gives offset in milliseconds, and that was incorrectly to be assumed as full hours, so the offset was rounded to an integer. Using a double will allow all kinds of offsets that still work with highcharts. Fixes timezones like - Nepal (GMT+05:45) - Newfoundland Time (GMT-03:30) Affects issues: - Fixed #1652
This commit is contained in:
parent
6758a56167
commit
2b737c9973
@ -108,10 +108,10 @@ public class PlanConfig extends Config {
|
||||
return foundTZ.orElse(TimeZone.getTimeZone(ZoneId.of("UTC")));
|
||||
}
|
||||
|
||||
public int getTimeZoneOffsetHours() {
|
||||
int offset = getTimeZone().getOffset(System.currentTimeMillis());
|
||||
public double getTimeZoneOffsetHours() {
|
||||
int offsetMs = getTimeZone().getOffset(System.currentTimeMillis());
|
||||
int hourMs = (int) TimeUnit.HOURS.toMillis(1L);
|
||||
return -offset / hourMs;
|
||||
return -offsetMs * 1.0 / hourMs;
|
||||
}
|
||||
|
||||
public Path getPageExportPath() {
|
||||
|
Loading…
Reference in New Issue
Block a user