@@ -68,7 +68,7 @@ public extension Date {
6868 /// - increment: components to add
6969 /// - Returns: array of dates
7070 static func enumerateDates( from startDate: Date , to endDate: Date , increment: DateComponents ) -> [ Date ] {
71- return Date . enumerateDates ( from: startDate, to: endDate, increment: { _ in
71+ Date . enumerateDates ( from: startDate, to: endDate, increment: { _ in
7272 return increment
7373 } )
7474 }
@@ -78,15 +78,15 @@ public extension Date {
7878 /// - Parameter style: rounding mode.
7979 /// - Returns: rounded date
8080 func dateRoundedAt( at style: RoundDateMode ) -> Date {
81- return inDefaultRegion ( ) . dateRoundedAt ( style) . date
81+ inDefaultRegion ( ) . dateRoundedAt ( style) . date
8282 }
8383
8484 /// Returns a new DateInRegion that is initialized at the start of a specified unit of time.
8585 ///
8686 /// - Parameter unit: time unit value.
8787 /// - Returns: instance at the beginning of the time unit; `self` if fails.
8888 func dateAtStartOf( _ unit: Calendar . Component ) -> Date {
89- return inDefaultRegion ( ) . dateAtStartOf ( unit) . date
89+ inDefaultRegion ( ) . dateAtStartOf ( unit) . date
9090 }
9191
9292 /// Return a new DateInRegion that is initialized at the start of the specified components
@@ -95,7 +95,7 @@ public extension Date {
9595 /// - Parameter units: sequence of transformations as time unit components
9696 /// - Returns: new date at the beginning of the passed components, intermediate results if fails.
9797 func dateAtStartOf( _ units: [ Calendar . Component ] ) -> Date {
98- return units. reduce ( self ) { ( currentDate, currentUnit) -> Date in
98+ units. reduce ( self ) { ( currentDate, currentUnit) -> Date in
9999 return currentDate. dateAtStartOf ( currentUnit)
100100 }
101101 }
@@ -106,7 +106,7 @@ public extension Date {
106106 ///
107107 /// - returns: A new Moment instance.
108108 func dateAtEndOf( _ unit: Calendar . Component ) -> Date {
109- return inDefaultRegion ( ) . dateAtEndOf ( unit) . date
109+ inDefaultRegion ( ) . dateAtEndOf ( unit) . date
110110 }
111111
112112 /// Return a new DateInRegion that is initialized at the end of the specified components
@@ -115,7 +115,7 @@ public extension Date {
115115 /// - Parameter units: sequence of transformations as time unit components
116116 /// - Returns: new date at the end of the passed components, intermediate results if fails.
117117 func dateAtEndOf( _ units: [ Calendar . Component ] ) -> Date {
118- return units. reduce ( self ) { ( currentDate, currentUnit) -> Date in
118+ units. reduce ( self ) { ( currentDate, currentUnit) -> Date in
119119 return currentDate. dateAtEndOf ( currentUnit)
120120 }
121121 }
@@ -125,7 +125,7 @@ public extension Date {
125125 /// - Parameter components: components to alter with their new values.
126126 /// - Returns: new altered `DateInRegion` instance
127127 func dateBySet( _ components: [ Calendar . Component : Int ] ) -> Date ? {
128- return DateInRegion ( self , region: SwiftDate . defaultRegion) . dateBySet ( components) ? . date
128+ DateInRegion ( self , region: SwiftDate . defaultRegion) . dateBySet ( components) ? . date
129129 }
130130
131131 /// Create a new date by altering specified time components.
@@ -147,15 +147,15 @@ public extension Date {
147147 /// - Parameter components: components to truncate.
148148 /// - Returns: new date with truncated components.
149149 func dateTruncated( _ components: [ Calendar . Component ] ) -> Date ? {
150- return DateInRegion ( self , region: SwiftDate . defaultRegion) . dateTruncated ( at: components) ? . date
150+ DateInRegion ( self , region: SwiftDate . defaultRegion) . dateTruncated ( at: components) ? . date
151151 }
152152
153153 /// Creates a new instance by truncating the components starting from given components down the granurality.
154154 ///
155155 /// - Parameter component: The component to be truncated from.
156156 /// - Returns: new date with truncated components.
157157 func dateTruncated( from component: Calendar . Component ) -> Date ? {
158- return DateInRegion ( self , region: SwiftDate . defaultRegion) . dateTruncated ( from: component) ? . date
158+ DateInRegion ( self , region: SwiftDate . defaultRegion) . dateTruncated ( from: component) ? . date
159159 }
160160
161161 /// Offset a date by n calendar components.
@@ -166,23 +166,23 @@ public extension Date {
166166 /// - component: component to offset.
167167 /// - Returns: new altered date.
168168 func dateByAdding( _ count: Int , _ component: Calendar . Component ) -> DateInRegion {
169- return DateInRegion ( self , region: SwiftDate . defaultRegion) . dateByAdding ( count, component)
169+ DateInRegion ( self , region: SwiftDate . defaultRegion) . dateByAdding ( count, component)
170170 }
171171
172172 /// Return related date starting from the receiver attributes.
173173 ///
174174 /// - Parameter type: related date to obtain.
175175 /// - Returns: instance of the related date.
176176 func dateAt( _ type: DateRelatedType ) -> Date {
177- return inDefaultRegion ( ) . dateAt ( type) . date
177+ inDefaultRegion ( ) . dateAt ( type) . date
178178 }
179179
180180 /// Create a new date at now and extract the related date using passed rule type.
181181 ///
182182 /// - Parameter type: related date to obtain.
183183 /// - Returns: instance of the related date.
184184 static func nowAt( _ type: DateRelatedType ) -> Date {
185- return Date ( ) . dateAt ( type)
185+ Date ( ) . dateAt ( type)
186186 }
187187
188188 /// Return the dates for a specific weekday inside given month of specified year.
0 commit comments