Questions tagged [uidatepicker]

The UIDatePicker is a class in the UIKit framework of iOS which represents an graphical object that uses multiple rotating wheels to allow users to select dates and times.

The UIDatePicker class implements an object that uses multiple rotating wheels to allow users to select dates and times. On UIDatePicker, you can find the following methods:

Managing the Date and Calendar

  • calendar property
  • date property
  • locale property
  • setDate:animated:
  • timeZone property

Configuring the Date Picker Mode

  • datePickerMode property

Configuring Temporal Attributes

  • maximumDate property
  • minimumDate property
  • minuteInterval property
  • countDownDuration property
1661 questions
10
votes
1 answer

Swift change date picker language

I want to change format of month represent in my UIDatePicker. I tried: self.datePicker = UIDatePicker() self.datePicker.backgroundColor = .white self.datePicker.datePickerMode = .date let loc = Locale.init(identifier: "uk") var calendar =…
Evgeniy Kleban
  • 6,794
  • 13
  • 54
  • 107
10
votes
2 answers

How to properly use selectors in swift 4

I have read many tutorials and even the official Apple documentation and must not understand what is wrong with this code. var dueDatePicker = UIDatePicker() @IBOutlet weak var textField: UITextField! override func viewDidLoad() { …
Kohler Fryer
  • 764
  • 2
  • 8
  • 17
10
votes
5 answers

How to add a "Done" button with in the DatePicker Through StoryBoard?

In my app i want to display UIDatePicker when user click on button.and that date save into UITextFiled.I done this things. My problem is when date picker appears there is no done button,How can add that done button. Upto now i tried. -…
User558
  • 1,165
  • 1
  • 13
  • 37
10
votes
1 answer

Can you change the font size of a UIDatePicker?

In my application, I have several UIDatePickers that I need to take up about 2/3 of the screen. However, doing so currently, the month and year columns are getting truncated when in portrait. For example, instead of "2015" you'll see "..." or…
Ektris
  • 113
  • 1
  • 1
  • 7
10
votes
6 answers

iOS9: UIDatePicker with datePickerMode of UIDatePickerModeTime only shows Hours, and no Minutes

I'm using Xcode beta 7 with the iOS9 simulator. Using a UIDatePicker with a datePickerMode of UIDatePickerModeTime only shows Hours, and not minutes. See screenshot: On iOS 7 and 8, obviously it works as expected, and shows both Hours and Minutes.…
FranticRock
  • 3,233
  • 1
  • 31
  • 56
10
votes
2 answers

How can I remove the extra width to the right of jquery UI datepicker?

I am using jquery UI datepicker against a div so I can see the months on my screen. The issue is that it seems to add a width attribute that is much wider than it actually needs which creates this extra white space as seen below here is my…
leora
  • 188,729
  • 360
  • 878
  • 1,366
10
votes
1 answer

UIDatePicker issues in popovers on iOS 8

Is anyone else having issues with UIDatePickers in popovers on iOS 8? Suddenly our date pickers are not showing up correctly (see screenshot). It appears that part of the picker is not being displayed (though, you can still interact with the missing…
Jeremy
  • 321
  • 1
  • 7
10
votes
2 answers

UIDatePicker Cutting Off Text & Not Displaying Days

My app is suddenly unable to correctly display UIDatePickers. I'm using storyboards. The Datepickers are set to just display the date. They are cutting off the month, and also not even showing the days. There's a big space in the middle. I have…
SmileBot
  • 19,393
  • 7
  • 65
  • 62
10
votes
4 answers

How can I show a UIDatePicker instead of a keyboard when a user selects a UITextField?

I have a nice clean UI within a table view which has a few text fields for the user to fill out. One of the fields is for the user's birthday. I'd like to have it so that when the user selects the birthday field, a view containing a UIDatePicker…
Ben S
  • 68,394
  • 30
  • 171
  • 212
9
votes
1 answer

UIDatePicker NSRangeException crash iOS 11

I have the following code to add a DatePicker to one of my UIViews. UIDatePicker *datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 30, 320, 250)]; [datePicker setDatePickerMode:UIDatePickerModeDate]; datePicker.hidden = NO; …
tbag
  • 1,268
  • 2
  • 16
  • 34
9
votes
5 answers

jQuery UI Datepicker - allow only certain weekdays

I'm using jquery UI datepicker on a huge project and I realize now that I'll need to allow only certain weekdays on some areas. I read their documentation and didn't find anything about it.. I know that there are some datepickers scripts for jq…
9
votes
3 answers

Convert gregorian datepicker to persian datepicker in swift?

How can I convert Gregorian datepicker to persian datepicker in Swift language ? func datePickerValueChanged(sender: UIDatePicker) { let dateFormatter = NSDateFormatter() dateFormatter.dateStyle = NSDateFormatterStyle.MediumStyle …
9
votes
1 answer

JQuery datepicker numberOfMonths: display current selection month last

I have a jquery datepicker with the numberOfMonths set to 3, currently when I click on the datepicker, the left side month is the current month. In most cases, the user is only going to be selecting a date prior to todays date so I would prefer the…
Maton
  • 167
  • 1
  • 2
  • 8
9
votes
1 answer

remove/hide rows outside minimum/maximum date range of UIDatePicker?

I have a UIDatePicker with set minimum and maximum dates. I'm wondering if there is a way to hide the rows of the columns for the dates/times that are either before my minimum date or after my maximum date. Right now the picker displays every single…
Jared Gross
  • 649
  • 3
  • 9
  • 23
9
votes
4 answers

How to set UIDatePicker to an initial date other than "Today"

I need to set the initial date to something other than "Today" so the user is forced to make a selection. I have found that if the user does NOT make a selection, the date/time is set to "nil"; I can send an UIAlertView, but that is after the…
SpokaneDude
  • 4,856
  • 13
  • 64
  • 120