Open loverde-co opened 6 years ago
update the DateModel.swift:
public enum MonthType {
case previous
case current
case next
case custom(year: Int, month: Int)
}
then
func display(in month: MonthType) {
currentDates = []
currentDate = date(of: month)
setup()
}
func date(of month: MonthType) -> Date {
var components = DateComponents()
switch month {
case .previous: components.month = -1
case .current: components.month = 0
case .next: components.month = 1
case let .custom(year: year, month: month):
components.year = -year
components.month = -month
}
return calendar.date(byAdding: components, to: currentDate) ?? Date()
}
@springlo What about if it is used as a pod ? What do we need to do make this changes reflect ?
If i want some date in specific month, how to show calendar koyomi on that month ?