UIDatePicker select Month and Year

Here is a solution to get the same effect. For using this snippet of code you should replace UIPickerView to CDatePickerViewEx in nib file in “Custom class” of “Indentity inspector”. .h file #import <UIKit/UIKit.h> @interface CDatePickerViewEx : UIPickerView <UIPickerViewDelegate, UIPickerViewDataSource> @property (nonatomic, strong, readonly) NSDate *date; -(void)selectToday; @end .m file #import “CDatePickerViewEx.h” // Identifiers of … Read more

UIDatePicker pop up after UIButton is pressed

canihazcode? Yes, sir. Thanks for helping me procrastinating. – (void)changeDate:(UIDatePicker *)sender { NSLog(@”New Date: %@”, sender.date); } – (void)removeViews:(id)object { [[self.view viewWithTag:9] removeFromSuperview]; [[self.view viewWithTag:10] removeFromSuperview]; [[self.view viewWithTag:11] removeFromSuperview]; } – (void)dismissDatePicker:(id)sender { CGRect toolbarTargetFrame = CGRectMake(0, self.view.bounds.size.height, 320, 44); CGRect datePickerTargetFrame = CGRectMake(0, self.view.bounds.size.height+44, 320, 216); [UIView beginAnimations:@”MoveOut” context:nil]; [self.view viewWithTag:9].alpha = 0; [self.view … Read more

iOS 7 – How to display a date picker in place in a table view?

With iOS7, Apple released the sample code DateCell. Demonstrates formatted display of date objects in table cells and use of UIDatePicker to edit those values. As a delegate to this table, the sample uses the method “didSelectRowAtIndexPath” to open the UIDatePicker control. For iOS 6.x and earlier, UIViewAnimation is used for sliding the UIDatePicker up … Read more

jQuery Date Picker – disable past dates

You must create a new date object and set it as minDate when you initialize the datepickers <label for=”from”>From</label> <input type=”text” id=”from” name=”from”/> <label for=”to”>to</label> <input type=”text” id=”to” name=”to”/> var dateToday = new Date(); var dates = $(“#from, #to”).datepicker({ defaultDate: “+1w”, changeMonth: true, numberOfMonths: 3, minDate: dateToday, onSelect: function(selectedDate) { var option = this.id == … Read more