How to set date formate to the UIDatePickerView for month MMM using locale can we achieve it?
Is there away to set three char of month to UIDatePickerView
No, you can't set a specific format on a date picker. You can set the locale (which defaults to the user's current locale) which affects the format.
If you truly want a date picker with a specific format (bad idea because it will likely confuse users), you will need to create your custom date picker using UIPickerView.
Related
I want to allow user to select only given date from API and other date should be un-clickable or disable.
As I can check in SWIFT UIDatePicker only providing minimum date and maximum date selection but my requirement is to enable random date.
How do I get data picker to display and select the year also.
Currently I see the following but what I need is Year Mon Day HH MM
.datePickerMode = .date or .datePickerMode = .dateAndTime
both are dependant on locale... so different countries will see different potentially undesirable formats.
Swift Accessing year from UIDatePicker
You can customise UIPickerView though if you need to...
Can i customize UIDatePicker?
Just Making Calendar app which i have the same requirement as IOS calendar. In that All Day toggle Changes To Different Date Formatting And DatePicker Style is also different. How can i deal with that?.
Use NSDateFormatter and when user change the toggle update format of date using Date formatter and load new format in Picker.
you have option to create another picker otherwise you have to define condition on the picker delegate to show the new date format or your required format .
when you first time open the picker than the content would load on to the picker may be there is a chance when you pass the command to change format than the picker is still showing previous content than you need to reload the picker content to update the picker content value and to show the updated format type content.
may this could help you.
I have two date pickers. In first I'm selecting a date, and I want second date picker to show the dates after that particular date. Previous dates should be disabled.
Use minimum date property of the date picker to disable the all date before the minimum date. The date picker would also allow you to define range as minimum and maximum date so that it can show the date from minimum to maximum date range and remaining all other date will be disabled in picker view.
swift 3
datePickerEndDate.minimumDate = datePickerStartDate.date
Is it possible to set in UIDatePicker, date/time frames selectively? for example: show only Mondays from 8am to 4pm ?
Unfortunately, you cannot do this with standard UIDatePicker. Instead you should build your own custom date picker based on UIPickerView.