-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you get the visible date range in calendar #503
Comments
Hi @Nidhee . There is no public interface for this. But the |
Hi @WenchaoD, how can i use |
Hi, let startDate: Date
let endDate: Date?
if self.calendar.scope == .week {
startDate = self.calendar.currentPage
endDate = self.calendar.gregorian.date(byAdding: .day, value: 6, to: startDate)
} else { // .month
let indexPath = self.calendar.calculator.indexPath(for: self.calendar.currentPage, scope: .month)
startDate = self.calendar.calculator.monthHead(forSection: (indexPath?.section)!)!
endDate = self.calendar.gregorian.date(byAdding: .day, value: 41, to: startDate)
} |
Thanks a lot @allenhuang but it is working only when I install FSCalendar through pods. When I added FSCalendar manually in my project it throws an error stating Calculator is not a member of calendar. Could you please help me in this regard? |
̶H̶a̶v̶i̶n̶g̶ ̶t̶h̶e̶ ̶s̶a̶m̶e̶ ̶i̶s̶s̶u̶e̶ ̶b̶u̶t̶ ̶i̶n̶ ̶S̶w̶i̶f̶t̶.̶ ̶C̶a̶l̶c̶u̶l̶a̶t̶o̶r̶ ̶p̶r̶o̶p̶e̶r̶t̶y̶ ̶i̶s̶ ̶i̶n̶a̶c̶c̶e̶s̶s̶i̶b̶l̶e̶ ̶a̶n̶d̶ ̶g̶r̶a̶b̶b̶i̶n̶g̶ ̶d̶a̶t̶e̶s̶ ̶f̶r̶o̶m̶ ̶v̶i̶s̶i̶b̶l̶e̶ ̶c̶e̶l̶l̶s̶ ̶i̶s̶ ̶n̶o̶t̶ ̶a̶ ̶g̶o̶o̶d̶ ̶a̶p̶p̶r̶o̶a̶c̶h̶ ̶f̶o̶r̶ ̶m̶e̶,̶ ̶c̶u̶z̶ ̶c̶e̶l̶l̶s̶ ̶a̶r̶e̶ ̶t̶a̶k̶i̶n̶g̶ ̶s̶h̶o̶r̶t̶ ̶t̶i̶m̶e̶ ̶t̶o̶ ̶a̶p̶p̶e̶a̶r̶.̶ ̶B̶u̶t̶ ̶I̶ ̶n̶e̶e̶d̶ ̶t̶o̶ ̶h̶a̶v̶e̶ ̶a̶ ̶s̶y̶n̶c̶h̶r̶o̶n̶o̶u̶s̶ ̶w̶a̶y̶ ̶t̶o̶ ̶g̶e̶t̶ ̶p̶a̶g̶e̶'̶s̶ ̶s̶t̶a̶r̶t̶/̶e̶n̶d̶ ̶d̶a̶t̶e̶s̶ ̶a̶s̶ ̶s̶o̶o̶n̶ ̶a̶s̶ ̶p̶o̶s̶s̶i̶b̶l̶e̶ ̶t̶o̶ ̶f̶e̶t̶c̶h̶ ̶a̶n̶d̶ ̶c̶a̶l̶c̶u̶l̶a̶t̶e̶ ̶e̶v̶e̶n̶t̶ ̶m̶a̶r̶k̶e̶r̶s̶.̶ Don't know is there was any update, but now the answer from @allenhuang works :) |
Hello,
Is there any way to get visible minimum and maximum date (start and end date).
The following informations are requested in a bug report
(manually/cocoapods/carthage)
e.g. iPhone 6s iOS9.1
e.g. Xcode 8.1
e.g. FSCalenda 2.5.1
如果在使用过程中遇到问题,请提供以下信息以便于尽快将问题修复
如手动安装、cocoapods安装、或者通过carthage安装
。例如: iPhone6s iOS9.1
例如: Xcode8.1
例如: FSCalendar 2.5.1
The text was updated successfully, but these errors were encountered: