Skip to content

Commit e8b4feb

Browse files
authored
Merge pull request #8316 from woocommerce/issue/8277-timezones-config
[Analytics Hub] Use device timezone and calendar for stats requests
2 parents 1cc10b6 + 816676b commit e8b4feb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/Time Range/AnalyticsHubTimeRangeSelection.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ public class AnalyticsHubTimeRangeSelection {
2929
return previousTimeRangeDescription
3030
}
3131

32-
//TODO: abandon usage of the ISO 8601 Calendar and build one based on the Site calendar configuration
3332
init(selectionType: SelectionType,
3433
currentDate: Date = Date(),
35-
timezone: TimeZone = TimeZone.autoupdatingCurrent,
36-
calendar: Calendar = Calendar(identifier: .iso8601)) {
34+
timezone: TimeZone = TimeZone.current,
35+
calendar: Calendar = Locale.current.calendar) {
3736
var selectionData: AnalyticsHubTimeRangeData
3837

3938
switch selectionType {

0 commit comments

Comments
 (0)