Title: iOS Set datepicker TimeMode minimum and maximum date between PM and AM
Tags: ios;swift;xamarin;datepicker
Question: I have a UIDatePicker in Time mode, and I need to set a minimum and maximum time but it needs to be between PM and AM (11:00 PM and 02:00 AM).
I tried adding a day component ```components.Day = 1;``` but it doesn't see to work it get maximum gary46@example.com. Any thought to set multiple ranges or something to make it work ?
Thanks.

Comment: Do you need to select the date as well, or just a Time?

Comment: @SeifSelmi I would suggest using UIPickerView with one component for your hour range and one for minutes.

Comment: If you chose time mode , `MaximumDate` must be great than `MinimumDate`, so you can set 2AM~11PM but can't reverse them.

Comment: try https://stackoverflow.com/a/16322625/3231194

Comment: @rbaldwin i need only Time picker

Comment: @Glenn yes i tried that but same problem unfortunately.

Comment: @Cole yes you are right, I had to do that programatically and setting two ranges, and that fixed my problem.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 7, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2018:00:05/09/18', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ios><swift><xamarin><datepicker>', 'Title': 'iOS Set datepicker TimeMode minimum and maximum date between PM and AM', 'ViewCount': 333, 'id': 50255680, 'user_AboutMe': None, 'user_AccountId': 12709556.0, 'user_DisplayName': 'Seif Selmi', 'user_Reputation': 67.0, 'user_Views': 29.0, 'user_id': 9233588.0}}