File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Sources/YCalendarPicker/SwiftUI/Views
Tests/YCalendarPickerTests/SwiftUI Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public struct CalendarView {
109109 self . minimumDate = minimumDate? . dateOnly
110110 self . maximumDate = maximumDate? . dateOnly
111111 self . locale = locale ?? Locale . current
112- self . startDate = startDate
112+ self . startDate = startDate? . startDateOfMonth ( )
113113 }
114114}
115115
Original file line number Diff line number Diff line change @@ -178,9 +178,10 @@ final class CalendarViewTests: XCTestCase {
178178 }
179179
180180 func testOnStartDate( ) {
181- let sut = makeSUT ( startDate: Date ( ) . date ( byAddingMonth: 4 ) )
181+ let expectedDate = Date ( ) . date ( byAddingMonth: 4 )
182+ let sut = makeSUT ( startDate: expectedDate)
182183 XCTAssertNotNil ( sut. startDate)
183- XCTAssertNotEqual ( sut . currentDate , sut. startDate)
184+ XCTAssertEqual ( expectedDate ? . startDateOfMonth ( ) , sut. startDate)
184185 }
185186
186187 func testCalendarViewPreviewIsNotNill( ) {
You can’t perform that action at this time.
0 commit comments