@@ -29,7 +29,7 @@ import Foundation
2929 */
3030public struct FastisShortcut < Value: FastisValue > : Hashable {
3131
32- private var id : UUID = UUID ( )
32+ private var id = UUID ( )
3333
3434 /// Display name of shortcut
3535 public var name : String
@@ -51,7 +51,7 @@ public struct FastisShortcut<Value: FastisValue>: Hashable {
5151 }
5252
5353 public static func == ( lhs: FastisShortcut < Value > , rhs: FastisShortcut < Value > ) -> Bool {
54- return lhs. id == rhs. id
54+ lhs. id == rhs. id
5555 }
5656
5757 internal func isEqual( to value: Value ) -> Bool {
@@ -65,28 +65,28 @@ public struct FastisShortcut<Value: FastisValue>: Hashable {
6565
6666}
6767
68- extension FastisShortcut where Value == FastisRange {
68+ public extension FastisShortcut where Value == FastisRange {
6969
7070 /// Range: from **`now.startOfDay`** to **`now.endOfDay`**
71- public static var today : FastisShortcut {
72- return FastisShortcut ( name: " Today " ) {
71+ static var today : FastisShortcut {
72+ FastisShortcut ( name: " Today " ) {
7373 let now = Date ( )
7474 return FastisRange ( from: now. startOfDay ( ) , to: now. endOfDay ( ) )
7575 }
7676 }
7777
7878 /// Range: from **`now.startOfDay - 7 days`** to **`now.endOfDay`**
79- public static var lastWeek : FastisShortcut {
80- return FastisShortcut ( name: " Last week " ) {
79+ static var lastWeek : FastisShortcut {
80+ FastisShortcut ( name: " Last week " ) {
8181 let now = Date ( )
8282 let weekAgo = Calendar . current. date ( byAdding: . day, value: - 7 , to: now) !
8383 return FastisRange ( from: weekAgo. startOfDay ( ) , to: now. endOfDay ( ) )
8484 }
8585 }
8686
8787 /// Range: from **`now.startOfDay - 1 month`** to **`now.endOfDay`**
88- public static var lastMonth : FastisShortcut {
89- return FastisShortcut ( name: " Last month " ) {
88+ static var lastMonth : FastisShortcut {
89+ FastisShortcut ( name: " Last month " ) {
9090 let now = Date ( )
9191 let monthAgo = Calendar . current. date ( byAdding: . month, value: - 1 , to: now) !
9292 return FastisRange ( from: monthAgo. startOfDay ( ) , to: now. endOfDay ( ) )
@@ -95,26 +95,26 @@ extension FastisShortcut where Value == FastisRange {
9595
9696}
9797
98- extension FastisShortcut where Value == Date {
98+ public extension FastisShortcut where Value == Date {
9999
100100 /// Date value: **`now`**
101- public static var today : FastisShortcut {
102- return FastisShortcut ( name: " Today " ) {
103- return Date ( )
101+ static var today : FastisShortcut {
102+ FastisShortcut ( name: " Today " ) {
103+ Date ( )
104104 }
105105 }
106106
107107 /// Date value: **`now - .day(1)`**
108- public static var yesterday : FastisShortcut {
109- return FastisShortcut ( name: " Yesterday " ) {
110- return Calendar . current. date ( byAdding: . day, value: - 1 , to: Date ( ) ) !
108+ static var yesterday : FastisShortcut {
109+ FastisShortcut ( name: " Yesterday " ) {
110+ Calendar . current. date ( byAdding: . day, value: - 1 , to: Date ( ) ) !
111111 }
112112 }
113113
114114 /// Date value: **`now + .day(1)`**
115- public static var tomorrow : FastisShortcut {
116- return FastisShortcut ( name: " Tomorrow " ) {
117- return Calendar . current. date ( byAdding: . day, value: 1 , to: Date ( ) ) !
115+ static var tomorrow : FastisShortcut {
116+ FastisShortcut ( name: " Tomorrow " ) {
117+ Calendar . current. date ( byAdding: . day, value: 1 , to: Date ( ) ) !
118118 }
119119 }
120120
0 commit comments