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

Allow user only to select today's & Future dates, not the past ones #8

Open
Rajputvikassingh opened this issue Apr 10, 2012 · 5 comments

Comments

@Rajputvikassingh
Copy link

Hi Oliver,

Thanks for sharing the component with us. It's really an interesting controller which can be used as Date Picker similar to the iPhone Picker view, but much far better than that considering the look-wise , may be with space or the Animation ,whatever it may be it's far better than controller available for date selections.

I have already implemented this controller instead of using the UIDatePicker in my application. But now facing couple of issues with the Date Selections

  1. I am not able to limit the user for selecting the dates from Present to Future, they should not able to selected the past dates of the months.
  2. Not able to show the last selected dates on the PopOver Calendar.

If we get such options then this may lead for making the excellent controller which still we are missing in iPhoneSDK & overcoming the limitations the Tapku library.

Thanks,

@ocrickard
Copy link
Owner

Hello,

Thanks for using the controller!

1.) So you'd like to restrict selection dates to a particular range? I suppose that isn't too hard. I'll look into implementing it son.

2.) Good point, something I probably need to implement. What do you think of declaring two parameters within the controller that you can modify after init which will re-draw the selection view with your inputs? Alternatively, it could be part of a new initialization routine...

@Rajputvikassingh
Copy link
Author

Thanks for your acknowledgment !!!

  1. Yes, I am looking out to implement the functionality to let user choose the dates from present to future disable the past dates as we do have in UIDatePicker, user would be able to see them but cannot selected.

  2. Hmm... I think whatever the code I have studied according to that, we should be able to achieve by declaring the variables which stores the start & end dates of the selection which need to be drawn on to the Calendar.Probably there is no need to have the new routine for this. And yes, an another alternative for this ,which is quite easy even than storing the dates is :

Just storing the below values from the last selections : (OCSelectionView.m) & get rid of making new routine.

       startCellX = 1;
       startCellY = 0;
       endCellX = 4;
       endCellY = 3;

just changing the status of the BOOL selected
       selected = YES;
else default none of the date selected will be shown.

Thanks,

@ocrickard
Copy link
Owner

FYI in my original post I said "son" instead of "soon". Typo. I'm not quite old enough to use that nickname yet... Sorry if it came across as patronizing.

  1. I'll see what I can do in the next week or two. This together with the other good feedback I've received will make for an interesting morning of programming. I've got a ton of work to do in the next week, so I'm not positive when I'll get around to it.
  2. I'm afraid that this controller is built to not remember anything. The controller is not a persistent interface, so I'd prefer not to use remembered values from previous allocations because that would require storing that information either in user defaults, or in the delegate somehow..... However, I believe that adding two NSDate parameters to the controller would function just as well, and would add great flexibility. For instance, it would allow you to set the selected date range that a use had already selected via your web interface.

@Rajputvikassingh
Copy link
Author

No worry at all, I looked on that & understood of that being the TYPO. FYI, I am still so young to be called a son ;)

That sounds good.I will also work out on adding more features .If possible I will Hope that will save allot of time of others.

@ghost
Copy link

ghost commented Nov 30, 2012

Has this ever be done? I am trying to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants