Merge pull request #2362 from GSA/feat/fe-tz-change

Added local/utc time conversion for text metrics
This commit is contained in:
Alex Janousek
2025-02-26 14:59:44 -05:00
committed by GitHub
5 changed files with 210 additions and 6 deletions

View File

@@ -216,7 +216,13 @@
return;
}
var url = type === 'service' ? `/services/${currentServiceId}/daily-stats.json` : `/services/${currentServiceId}/daily-stats-by-user.json`;
var userTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
var url = type === 'service'
? `/services/${currentServiceId}/daily-stats.json?timezone=${encodeURIComponent(userTimezone)}`
: `/services/${currentServiceId}/daily-stats-by-user.json`;
return fetch(url)
.then(response => {
if (!response.ok) {