uidatepicker

UIDatePicker issue in iOS9

旧巷老猫 提交于 2019-12-02 19:44:16
Date is hiding in UIDatePicker in iOS9. i am using xib. This issue is only in xoode7(iOS9) Can any one help me to solve my issue?? I think this is problem with new font San Francisco (the font is big than Helvetica ) and .xib file. It can be hacked around by changing the UIDatePicker mode right before it was displayed, and then changing it back to the desired one: [myDatePicker setDatePickerMode:UIDatePickerModeDateAndTime]; [myDatePicker setDatePickerMode:UIDatePickerModeDate]; Also try adding DatePicker programmatically. I think its a bug in iOS 9 with new font. 来源: https://stackoverflow.com

How to set date format retrieved from UIDatePicker

强颜欢笑 提交于 2019-12-02 17:21:21
问题 I am retrieving date from UIDatePicker ,now i want to convert in to wed, Dec29 12:30pm format , I also want to set that date to UIPickerView's current display date 回答1: You can use this code,its exactly what you want NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [NSTimeZone resetSystemTimeZone]; NSTimeZone *gmtZone = [NSTimeZone systemTimeZone]; [dateFormatter setTimeZone:gmtZone]; [dateFormatter setDateFormat:@"day, MMM HH:mm:ss Z"]; NSDate *dateT = [dateFormatter

How to set date format retrieved from UIDatePicker

限于喜欢 提交于 2019-12-02 10:44:30
I am retrieving date from UIDatePicker ,now i want to convert in to wed, Dec29 12:30pm format , I also want to set that date to UIPickerView's current display date Aditya You can use this code,its exactly what you want NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [NSTimeZone resetSystemTimeZone]; NSTimeZone *gmtZone = [NSTimeZone systemTimeZone]; [dateFormatter setTimeZone:gmtZone]; [dateFormatter setDateFormat:@"day, MMM HH:mm:ss Z"]; NSDate *dateT = [dateFormatter dateFromString:str1]; NSString *strDateTaken=[appDelegate convertDate:dateT withFormat:@"EEEE, MMMM dd,yyyy

UIDatePicker adding one to year

帅比萌擦擦* 提交于 2019-12-02 09:33:24
问题 I have a very strange and confusing problem. I can't find anything about it and it seems like a bug with Apple, but if anyone has a suggestion on how to get around this it would be helpful. There are certain dates that are adding 1 to the year with a UIDatePicker, seems to never be less than December 27th. I've went back a few years to try and find a pattern. Here are some examples: Any date picked >= December 28th in 2014 changes to 2015 >= 29th in 2013 -> 2014 >= 30th in 2012 -> 2013 2011

UIDatePicker - minDate & maxDate from php Var

喜你入骨 提交于 2019-12-02 08:36:42
问题 I have some php which queries a database to get some dates: <?php //connect to db etc $sql="SELECT date FROM entries ORDER BY date ASC"; $result = mysql_query($sql); if($result){ $entryDates = array(); while ($row=mysql_fetch_array($result)) { $entryDates[] = $row['date']; } $minDate = explode("-", $entryDates[0]); $minDate[1] -= 1; $maxDate = explode("-", end($entryDates)); $maxDate[1] -= 1; echo($maxDate[1]); } ?> I then try and assign the min and max dates to a uidatepicker using jquery.

UIDatePicker - minDate & maxDate from php Var

五迷三道 提交于 2019-12-02 07:33:29
I have some php which queries a database to get some dates: <?php //connect to db etc $sql="SELECT date FROM entries ORDER BY date ASC"; $result = mysql_query($sql); if($result){ $entryDates = array(); while ($row=mysql_fetch_array($result)) { $entryDates[] = $row['date']; } $minDate = explode("-", $entryDates[0]); $minDate[1] -= 1; $maxDate = explode("-", end($entryDates)); $maxDate[1] -= 1; echo($maxDate[1]); } ?> I then try and assign the min and max dates to a uidatepicker using jquery. Originally I did this and it worked: var theDate = new Date(); $( "#datepicker" ).datepicker( {

UIDatePicker adding one to year

走远了吗. 提交于 2019-12-02 07:06:06
I have a very strange and confusing problem. I can't find anything about it and it seems like a bug with Apple, but if anyone has a suggestion on how to get around this it would be helpful. There are certain dates that are adding 1 to the year with a UIDatePicker, seems to never be less than December 27th. I've went back a few years to try and find a pattern. Here are some examples: Any date picked >= December 28th in 2014 changes to 2015 >= 29th in 2013 -> 2014 >= 30th in 2012 -> 2013 2011 (issue doesn't occur) >= 26th in 2010 -> 2011 >= 27th in 2009 -> 2010 >= 28th in 2008 -> 2009 >= 30th in

Remove the “Today” entry from UIDatePicker

自古美人都是妖i 提交于 2019-12-02 03:33:02
When using a UIDatePicker in iOS SDK, there is always an entry "Today" at the current date. That's useful in most cases, but where I need it, it's rather confusing. Is there a way to: a) disable the "today"-entry (use regular date instead), and have all entries look the same or even better b) disable the "today"-entry (use regular date instead), and color the next day in blue Further more, the application is for private use only, it's not going to get distributed on the AppStore, which means I could use private APIs (I still would rather avoid them) and I don't need it to be backwards

blank UIDatePicker on iPad in mode UIDatePickerModeDateAndTime

五迷三道 提交于 2019-12-02 02:08:52
I am struggling with the UIDatePicker on iPad. The setDate or .date assignment makes the DatePicker empty: UIDatePicker * dtVCpicker = [[UIDatePicker alloc] initWithFrame:CGRectZero]; dtVCpicker.datePickerMode = UIDatePickerModeDateAndTime; dtVCpicker.date = [NSDate date]; dtVCpicker.minimumDate = [NSDate date]; [self.view.window addSubview:dtVCpicker]; if I change the mode to UIDatePickerModeDate or UIDatePickerModeTime then it would look normal. Thanks a lot for your answers! I implemented the work-around for this issue: setting the dtVCpicker.date inside the viewDidLoad made the Picker

Swift: One UITimePicker, Multiple Textfields

Deadly 提交于 2019-12-02 00:44:45
I have a single UIDatePicker variable that has only the time. I want that to be able to set different times to different TextFields . The way I have it set up is that when I change one time, they all change. Code: *@IBOutlets for all the UITextFields...* private var datePicker = UIDatePicker() override func viewDidLoad() { super.viewDidLoad() self.setupDatePicker() self.setupTextFields() } func setupDatePicker() { self.datePicker.frame = CGRect(x: 0, y: 50, width: self.view.frame.width, height: 200) self.datePicker.timeZone = NSTimeZone.local self.datePicker.datePickerMode = .time self