Skip to content

Commit 51e78c2

Browse files
authored
Merge pull request #8414 from woocommerce/issue/release-custom-range
Analytics Hub: Release Custom Date Ranges
2 parents 1ed0c4e + 9418ad5 commit 51e78c2

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
11.7
44
-----
5+
- [**] Analytics Hub: Now you can select custom date ranges. [https://github.com/woocommerce/woocommerce-ios/pull/8414]
56

67

78
11.6

WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/AnalyticsTimeRangeCard.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -172,24 +172,5 @@ extension AnalyticsTimeRangeCard {
172172
case monthToDate
173173
case quarterToDate
174174
case yearToDate
175-
176-
/// Wee need to provide a custom `allCases` in order to evict `.custom` while the feature flag is active.
177-
/// We should delete this once the feature flag has been removed.
178-
///
179-
static var allCases: [Range] {
180-
[
181-
ServiceLocator.featureFlagService.isFeatureFlagEnabled(.analyticsHub) ? .custom : nil,
182-
.today,
183-
.yesterday,
184-
.lastWeek,
185-
.lastMonth,
186-
.lastQuarter,
187-
.lastYear,
188-
.weekToDate,
189-
.monthToDate,
190-
.quarterToDate,
191-
yearToDate
192-
].compactMap { $0 }
193-
}
194175
}
195176
}

WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/RangedDatePicker.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct RangedDatePicker: View {
5757
DatePicker("", selection: $startDate, in: ...Date(), displayedComponents: [.date])
5858
.datePickerStyle(.graphical)
5959
.accentColor(Color(.brand))
60+
.padding(.horizontal, Layout.calendarPadding)
6061

6162
// End Picker
6263
Text(Localization.endDate)
@@ -68,6 +69,7 @@ struct RangedDatePicker: View {
6869
DatePicker("", selection: $endDate, in: ...Date(), displayedComponents: [.date])
6970
.datePickerStyle(.graphical)
7071
.accentColor(Color(.brand))
72+
.padding(.horizontal, Layout.calendarPadding)
7173
}
7274
.padding()
7375
}
@@ -116,6 +118,7 @@ private extension RangedDatePicker {
116118
}
117119
enum Layout {
118120
static let titleSpacing: CGFloat = 4.0
121+
static let calendarPadding: CGFloat = -8.0
119122
}
120123
}
121124

0 commit comments

Comments
 (0)