I used the EventKit and found the property firstDayOfTheWeek in the EKRecurrenceRule, but the property is only readonly so my question does somebody know how can i set this property or how can i set any readonly property?
According to Apple's documentation on "EKRecurrenceRule"...
Note: It is currently not possible to directly modify an
EKRecurrenceRule or any of its properties. This functionality is
achieved by creating a new EKRecurrenceRule and setting an event or
reminder to use the newly created rule.
In other words, ALL of the properties in an EKRecurrenceRule object are read-only. Which makes sense to me: once a user sets a rule, it shouldn't be a moving target. If you want to change it, you have to create a completely new and/or separate rule.
As for the "firstDayOfTheWeek" thing, I'm not 100% certain if Apple's implementation returns the first day of the week that the recurring event happens or if it's the first practical day of the week for the calendar (whether Sunday or Monday). My guess is that it's the former. Apple's documentation say the property "indicates which day of the week the recurrence rule treats as the first day of the week."
Related
The goal is to create a date and time picker for a viewmodel in MDriven.
Date-wise, this is easily achieved by making set variable of date type.
When it comes to the time aspects, it seems to be a little more tricky since a time type does not exist, for obvious reasons.
(Yes, before you suggest so, I have already read How do I set Date AND time picker in MDriven? and it did not help fully.
Context:
We have tried to work our way around this by letting the user write their desired time in a column of Int-form and implementing constraints that disallows users to write something other than that of "hhmm". Whilst this worked, it is not practical and slows down the user-experience.
Ideally, we would like to have a picklist where the user gets to chose pre-made times (i.e 16:00, 16:30, 17:00 etc). This way, the format of the chosen time would never break the framework in which we want to make use of the time later on, since it is limited.
Question:
How could this be attained? Surely there is a way to create constants (like hard-coded, solely visible variables), or perhaps you could collect instances of string with a specific operator for this use?
I think you want a set of usual values to choose from. But possibly the chosen value could be changed by the user.
I would declare a class TimeValueStore. In this class I would have an attribute with only the time part set of a datetime, so 0000-00-00 16:00. I would add a admin UI to maintain these. (I can parse the DateTime back from a string with DateTime.Parse(vTimeStringValue)).
In the UI I can then have a combobox with TimeValueStore.allinstances.
When the user changes the picked value in the combo the value can be assigned to a viewmodel variable vPickedTime.
I would also have a DateTimePicker that sets a date in vPickedDate.
In a button named "Apply" I would have this expression: self.TheDateTimeFinallyChoosen:=vPickedDate.Add(vPickedTime)
This doesn't solve the pick-list problem, but take a look at the example in Derived Settable attributes in the MDriven Wiki.
Using derived settable attributes might be a good way to remove complexity from the UI controls.
https://wiki.mdriven.net/index.php/Derived_settable_attributes
When editing recurring events in Calendar, if the event time is changed, should the recur break events that have been edited previously be removed or maintained?
I'm assuming that you are talking about changing the event time for "all" instances.
The iCalendar specification does not mandate anything with regards to such a scenario. A common practice though is to have the client split the recurring event into 2:
* the existing recurring event is bounded by adding an UNTIL date in the RRULE. The UNTIL value corresponds to the last instance before the change of time. All instances that had been edited in that time period are preserved.
* a new event (with a new UID etc...) gets created, with a DTSTART corresponding to the new time. Edited instances (exceptions) for that time period are removed.
Both events are linked together via a cross referencing RELATED-TO property.
Problem
Some reoccurring events, that don't really end at some point (like club meetings?), depend on other conditions (like holiday season). However, manually adding these exceptions would be necessary every year, as the dates might differ.
Research
I have found out about exdate (see the image of "iCalendar components and their properties" on Wikipedia (2))
Also found some possible workaround: 'just writing a script to do process such events'. This would still mean I need to process a .ics manually and import it into my calendar, which implies some limitations:
can not be determined for all time spans (e.g. holidays not fixed for more than three years)
these events would probably be separate and not reoccurring/'grouped', which makes further edits harder
Question
Is there a way to specify recurring exceptions in iCal ?
To clarify, I have a recurring event and recurring exceptions.
So for instance I have a infinitely reoccurring weekly event, that depends on the month; where it might only take place if it's not e.g. January, August, or December.
Is there a way to use another event (/calendar) to filter events by boolean logic ?
If one could use a second event (or several) to plug into exdate this would solve the first problem and add some more possibilities.
note
if this question is too specific and the original problem could be solved by other means (other calendar-formats), feel free to comment/edit/answer
RFC2445 defines an EXRULE (exception rule) property. You can use that in addition to the RRULE to define recurring exceptions.
However, RFC2445 was superseded by RFC5545, which unfortunately deprecates the EXRULE property. So, client support is questionable.
As you already proposed, automatically adding EXDATE properties is a possible solution.
BYMONTH would be another possibility, e.g. here's a rule for a club meeting that occurs the first Wednesday of every month except December (which is their Christmas party, so no business meeting)
RRULE:FREQ=MONTHLY;BYDAY=1WE;BYMONTH=1,2,3,4,5,6,7,8,9,10,11
I want to enter an event in my calendar that runs on Monday and Tuesdays from 8-3 and Saturdays from 8-12 every week. My app is supporting rrule's. Is it possible to pack that into a single rrule?
If it would be only the weekdays, then the rule would be simple and do look like:
FREQ=WEEKLY;BYDAY=MO,TU
Any hints are appreciated.
The duration of the event is not part of the rrule definition but is rather determined by the DTSTART/DTEND or DTSTART/DURATION combinations so there is no way to have one single event representing what you want (unless you create exceptions for every single instances on Saturday)
The best you can do is to use the RELATED-TO property (https://www.rfc-editor.org/rfc/rfc5545#section-3.8.4.5) to link the 2 events.
I'd like to do this in the graphical workflow designer witin CRM if possible, rather than resort to XAML or a custom assembly.
I want to set a date in a new record to the value of the corresponding date in another record, incremented by a number of months found in a third (related) record. The application is bumping the renewal date of a membership by the duration of the membership type, which might be 3, 12, 24 or 60 months.
Any help appreciated, including telling me that it can't be done!
It can be done but you need to write a custom workflow activity, this because you need to fetch the related entities to retrieve the value.
MSDN - Create a Custom Workflow Activity