From 816676bc9eb69be1299b4ba9da2278305accdae0 Mon Sep 17 00:00:00 2001 From: Evgeny Aleksandrov Date: Mon, 5 Dec 2022 17:23:05 +0300 Subject: [PATCH] Use device timezone and calendar for stats requests --- .../Time Range/AnalyticsHubTimeRangeSelection.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/Time Range/AnalyticsHubTimeRangeSelection.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/Time Range/AnalyticsHubTimeRangeSelection.swift index 9ea8b17464e..14a05eb0048 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/Time Range/AnalyticsHubTimeRangeSelection.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/Time Range/AnalyticsHubTimeRangeSelection.swift @@ -29,11 +29,10 @@ public class AnalyticsHubTimeRangeSelection { return previousTimeRangeDescription } - //TODO: abandon usage of the ISO 8601 Calendar and build one based on the Site calendar configuration init(selectionType: SelectionType, currentDate: Date = Date(), - timezone: TimeZone = TimeZone.autoupdatingCurrent, - calendar: Calendar = Calendar(identifier: .iso8601)) { + timezone: TimeZone = TimeZone.current, + calendar: Calendar = Locale.current.calendar) { var selectionData: AnalyticsHubTimeRangeData switch selectionType {