How to Disable certain dates in Date Picker in IOS [duplicate] - ios

This question already has answers here:
How to disable specific dates in UIDatePicker?
(2 answers)
Closed last month.
I want to disable certain dates in the date picker, for example, I want to disable holidays and weekend dates in a date picker so the user can't select those dates. Is there any way to disable specific dates?

You can use UICalendarView but it's only supported in iOS 16+ and it only works with dates not dates and time.
if you are really want to use UIDatePicker here is a workaround first you add addTarget(_:action:for:) with a valueChanged event and you check the date each time the event fires and if the date match one of those dates you don't want the user to select, You can show error to the user or you can set a new date and that will make the UIDatePicker to skip the current date which in your case it will be the holiday date.

Related

How to highlight months dynamically in Angular Material datepicker?

I can't find documentation for selected month for Angular Material Calendar highlight month.I want to show calendar with Month (3 months) highlighted and these month values are coming from Backend Data Respond. And when user able to change another month auto selected to 3 months.
For example, while I click on June, next two month July and August should selected as like the below image.

Jump to Current Month from Any Month in Calendar?

I am using SACalendar. I am trying to achieve jump to Today's date from any month. After Scrolling to any month I should able to move directly to Today's date.

How to pick the pre selected date/time

I am building an iOS app and in this app I got a datepicker (timepicker mode).
When user clicks the button and the picker opens one date/time is "selected". For example 1:20 am (I use 5 minutes intervals) but when the user dismiss the picker it picks the real time which is 1:23 am. If I pick another date/time by scrolling and then selects 1:20 am again I get that time. But not if I donĀ“t do any active selection.
My question is this. How can I get the time that is selected by default (if no user interaction is done)?
Thankful for all help!

How to create a daily calendar event using event kit?

I am having a event starting from june 1st to june 10th daily 10 am to 5 pm.After creating the event programatically it needs to add in calendar from june 1st to 10th in between 10 to 5 only.I don't want to enable the all day option.I want to use repeat daily option.And it needs to show in the dates given and time mentioned in blue colour (how event will display).
Create an instance of EKEvent for the event, and an instance of EKRecurrenceRule that describes the way the item repeats. Add the rule to the event using the -addRecurrenceRule: method from EKCalendarItem (which EKEvent inherits).
The color used to display the event is determined by the calendar, not by the event. If you must use a certain color, it's probably best to create a new calendar.

How to change date in onChangeEvent?

I need to react at TDateTimePicker.OnChangeEvent on date change. Display dialogs like "Unsaved changes will be lost" with buttons OK, Cancel. If the user press Cancel button I want to reset back the original date.
Unfortunatelly I can't change the date from that event. Change is ignored.
More detailed description:
User change the date in DateTimePicker (by keyboard) or Opens the calendar and pick a date
OnChange event is fired (calendar maybe still open)
I display the MessageDialog and if user press "Cancel" I want to restore date. Eg. close the calendar and restore date.
It is partially solved by user LU RD - see comments "Restore the value in the OnCloseUp event". It works for choosing date from a calendar.
If user change date directly in edit using keyboard it can be changed directly in onChangeEvent.
So combination of setting original (or any other date) in onCloseUp and onChange event is enough.

Resources