Skip to content

Commit

Permalink
Initialize month view with calendar view's presented date, if availab…
Browse files Browse the repository at this point in the history
…le, falling back to the current date.
  • Loading branch information
paulyhedral committed Nov 10, 2017
1 parent 0b204d3 commit 19fb157
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CVCalendar/CVCalendarContentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ open class CVCalendarContentViewController: UIViewController {
open var presentationEnabled = true
open var lastContentOffset: CGFloat = 0
open var direction: CVScrollDirection = .none

open var toggleDateAnimationDuration: Double {
return calendarView.delegate?.toggleDateAnimationDuration?() ?? 0.8
}

public init(calendarView: CalendarView, frame: CGRect) {
self.calendarView = calendarView
scrollView = UIScrollView(frame: frame)
presentedMonthView = MonthView(calendarView: calendarView, date: Foundation.Date())
presentedMonthView = MonthView(calendarView: calendarView, date: calendarView.presentedDate.convertedDate() ?? Foundation.Date())
presentedMonthView.updateAppearance(frame)

super.init(nibName: nil, bundle: nil)
Expand Down Expand Up @@ -267,4 +267,4 @@ extension UIView {
subview.removeFromSuperview()
}
}
}
}

0 comments on commit 19fb157

Please sign in to comment.