File tree 2 files changed +4
-3
lines changed
Sources/YCalendarPicker/SwiftUI/Views
Tests/YCalendarPickerTests/SwiftUI
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public struct CalendarView {
109
109
self . minimumDate = minimumDate? . dateOnly
110
110
self . maximumDate = maximumDate? . dateOnly
111
111
self . locale = locale ?? Locale . current
112
- self . startDate = startDate
112
+ self . startDate = startDate? . startDateOfMonth ( )
113
113
}
114
114
}
115
115
Original file line number Diff line number Diff line change @@ -178,9 +178,10 @@ final class CalendarViewTests: XCTestCase {
178
178
}
179
179
180
180
func testOnStartDate( ) {
181
- let sut = makeSUT ( startDate: Date ( ) . date ( byAddingMonth: 4 ) )
181
+ let expectedDate = Date ( ) . date ( byAddingMonth: 4 )
182
+ let sut = makeSUT ( startDate: expectedDate)
182
183
XCTAssertNotNil ( sut. startDate)
183
- XCTAssertNotEqual ( sut . currentDate , sut. startDate)
184
+ XCTAssertEqual ( expectedDate ? . startDateOfMonth ( ) , sut. startDate)
184
185
}
185
186
186
187
func testCalendarViewPreviewIsNotNill( ) {
You can’t perform that action at this time.
0 commit comments