Skip to content

Commit 3a70c3a

Browse files
committed
Use a init for the SelectionType
1 parent ba7449c commit 3a70c3a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ extension AnalyticsHubTimeRangeSelection {
104104
}
105105
}
106106

107-
static func from(_ statsTimeRange: StatsTimeRangeV4) -> SelectionType {
107+
init(_ statsTimeRange: StatsTimeRangeV4) {
108108
switch statsTimeRange {
109109
case .today:
110-
return .today
110+
self = .today
111111
case .thisWeek:
112-
return .weekToDate
112+
self = .weekToDate
113113
case .thisMonth:
114-
return .monthToDate
114+
self = .monthToDate
115115
case .thisYear:
116-
return .yearToDate
116+
self = .yearToDate
117117
}
118118
}
119119
}

0 commit comments

Comments
 (0)