Skip to content

Commit

Permalink
fix: OBCalendar date init missing calendar parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mtktsl committed Oct 1, 2024
1 parent 8404ea3 commit 8a489c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Sources/OBCalendar/OBCalendar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ public struct OBCalendar<

let placeholderView = Color.red

var calendar = Calendar.current
calendar.locale = .init(identifier: "en-US")

return OBCalendar(
calendar: calendar,
startingDate: startingDate,
endingDate: endingDate
) { model, scrollProxy in
Expand Down
7 changes: 6 additions & 1 deletion Sources/OBCalendar/Utility/OBCalendar+Init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ extension OBCalendar {

//MARK: - Start-end date
public init(
calendar: Calendar = .current,
startingDate: Date,
endingDate: Date,
lazyYears: Bool = false,
Expand Down Expand Up @@ -94,7 +95,11 @@ extension OBCalendar {
_ monthsView: OBCollectionView<Month, CalendarModel.Month>
) -> Year
) {
let years = CalendarModelBuilder.defaultLayout(startingDate: startingDate, endingDate: endingDate)
let years = CalendarModelBuilder.defaultLayout(
calendar: calendar,
startingDate: startingDate,
endingDate: endingDate
)
self.init(
years: years,
lazyYears: lazyYears,
Expand Down

0 comments on commit 8a489c6

Please sign in to comment.