Skip to content
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

Limit calendar start and end dates #48

Closed
ShadeApps opened this issue Nov 23, 2014 · 10 comments
Closed

Limit calendar start and end dates #48

ShadeApps opened this issue Nov 23, 2014 · 10 comments
Milestone

Comments

@ShadeApps
Copy link

Is there any convenient way to set the start and the end of the calendar view with, say months from today?

E.g. I want my calendar to show only 3 previous months and 6 future months. Is it possible in the current setup?

@ruslanskorb
Copy link
Owner

Hi @ShadeApps,

In the current setup it is impossible. But you can play with the variables fromDate / toDate and the methods pickerCollectionViewWillLayoutSubviews: / scrollToDate:animated: to do it.

Best,
Ruslan

@serkanucpinar
Copy link

I have same problem. I want my calendar to show only 1 year.I don't know, How can I do this?

@ShadeApps
Copy link
Author

@serkanucpinar I don't think it's possible to do without changing a big amount of code base. We've been struggling with it for several weeks now

@barkiiqbal
Copy link

@ShadeApps did you succeed to limit start and end dates. Any help please

@ShadeApps
Copy link
Author

@barkiiqbal We have ended up using MDCalendar - it has the best implementation of start & end dates in iOS open source control right now.

@barkiiqbal
Copy link

@ShadeApps thanks, i succeed to fix the dates by just commenting the code in pickerCollectionViewWillLayoutSubviews and changing values of toDate and fromDate. Its simple

@ruslanskorb
Copy link
Owner

Is there someone who has done it and can make a pull request? :-]

@agibson73
Copy link

@barkiiqbal,
Any help on this would be much appreciated.

@aryaxt
Copy link
Contributor

aryaxt commented Jun 28, 2015

@barkiiqbal Mind sharing more info on how you did it? You have a fork somewhere?

aryaxt added a commit to aryaxt/RSDayFlow that referenced this issue Jun 28, 2015
aryaxt added a commit to aryaxt/RSDayFlow that referenced this issue Jun 29, 2015
aryaxt added a commit to aryaxt/RSDayFlow that referenced this issue Jun 29, 2015
@ruslanskorb ruslanskorb added this to the 1.1.0 milestone Jun 30, 2015
ruslanskorb added a commit that referenced this issue Jul 5, 2015
Fix for #48, allow limiting dates in the calendar
@ruslanskorb
Copy link
Owner

Resolved in the version 1.1.0.

bartoszhernas added a commit to whatsahoy/RSDayFlow that referenced this issue Dec 2, 2016
* AG/SupportForPickingADateRange:
  Fix
  Added correct days off calculation
  Restore selection after shifting dates for range selection mode
  Fix for ruslanskorb#48, allow limiting dates in the calendar
  Allow selecting a date range
  Fix for ruslanskorb#48, allow limiting dates in the calendar

# Conflicts:
#	Example/Podfile.lock
#	Example/RSDayFlowExample/RSDFDatePickerViewController.m
#	RSDayFlow/RSDFDatePickerDayCell.h
#	RSDayFlow/RSDFDatePickerDayCell.m
#	RSDayFlow/RSDFDatePickerView.h
#	RSDayFlow/RSDFDatePickerView.m
bartoszhernas added a commit to whatsahoy/RSDayFlow that referenced this issue Dec 2, 2016
* master:
  Fix
  Added correct days off calculation
  update calendar today date when app becomes active to ensure we are displaying the correct today date
  better name for delegate method for configuring cell
  - allow customizing cells based on specific dates
  restore selection on reload
  Added deselect functionality
  Added multiple selection mode
  Added selection mode (single/range)
  - Fixes issues when paging was enabled - Updated code based on code review
  Restore selection after shifting dates for range selection mode
  Fix for ruslanskorb#48, allow limiting dates in the calendar
  Allow selecting a date range
  Fix for ruslanskorb#48, allow limiting dates in the calendar

# Conflicts:
#	Example/Podfile
#	Example/Podfile.lock
#	Example/RSDayFlowExample.xcodeproj/project.pbxproj
#	RSDayFlow/RSDFDatePickerDaysOfWeekView.m
#	RSDayFlow/RSDFDatePickerView.h
#	RSDayFlow/RSDFDatePickerView.m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants