How to get the next occurence of an outlook recurrencepattern - outlook

I've got an Outlook RecurrencePattern. Is there any library or code snippet to get the next occurence of an appointment or date in the recurrence pattern.

I know this answer is 1 year too late but it's better then never I guess. There is the GetOccurrence method in the RecurrencePattern class, which, unfortunately can only get you an occurrence if you know the start time of the occurrence.
That been said, if you already know the start time of a current occurrence, you can work out what the next start time is by looking at the properties in the recurrence pattern.
Except the next occurrence is a modified occurrence whose start time has been changed. In this case, you then need to work out the start time of the "next next" occurrence, then look into the Exceptions collection of the recurrence pattern, and look for one whose start time is between your current occurrence's start time and the "next next" occurrence's start time. Because Outlook does not allow you to modify the start time of an recurring appointment occurrence to be either earlier then the previous occurrence or later than the next occurrence.

Found a good library DDay.iCal http://www.ddaysoftware.com/Pages/Projects/DDay.iCal/

Related

Trying to understand how an adjusted repeating Mac Calendar event can be manipulated in Applescript

When I use AppleScript for a repeating event, I am able to reference each recurrence of an event, even if one or more of the repeated occurrences is canceled.
What I am having trouble with is how a "moved" occurrence is stored. So, this is one of the occurrences that is not at the same time but moved.
Imagine a weekly event at 9am every Monday. If on the third week, I drag the event in the calendar app to be at 10am rather than 9am on the Monday. I do not see anywhere in the event metadata that shows me the moved occurrence of the event.
I would appreciate any pointers.
I have tried looking at all the relevant event metadata. I am using Script Debugger as my tool.
Here is the code. I not only changed the time of the moved event, I also changed the name. This is looking for the name.
tell application "Calendar"
set sourceCalID to calendar id "4AA1E22C-0472-44D1-A582-31A7310AF9B4"
set howManyEvents to number of event of sourceCalID
set the_events to every event of sourceCalID
repeat with current_event in the_events
set summaryEvent to summary of current_event
log summaryEvent
end repeat
end tell

Laravel auctions app with time countdown

I am working on an bidding app in laravel. So far the idea goes like this:
An admin shall put an item, with time until which bidding shall go (e.g. admin puts tue 25.08 at 14:00 and user who puts highest bid until that time shall get to buy the item). Now, I know how all shall be done, until countdown. I could use some guides on how to actually display the time remaining. I worked on few projects and searched on google and I have no idea how I should display the time; where the time should be saved (DB) etc, how to check in the controller if the time passed or not etc. Basically I would need guides on how to display the time remaining for bidding...
You can save the date/time the auction is ending in the auctions table as an additional column (which you'll probably need anyway), and then compare Carbon::now() against that time, that's what's left on the auction. Also you'll need some kind of javascript code checking current server time against auction end server time if you want to show what's left on real time.

Delphi - delay processing if user still typing

I have an application which has an Edit Field. The user will type a search phrase in this field. I am trying to show in real time the hits against the user's text. After entering three characters, I do my first search, and then after every character or backspace the search is performed again.
The problem is that as my search algorithm is getting more advanced, it takes longer to do the search. The user can type faster than the results are before generated/displayed. As a result, the app is feeling sluggish/slow. I have a couple options:
(1). Wait until the user hits enter (2). Put the search in a different thread and do it asynchronously. Kinda hesitant here since I have never worked with threads before (3). Implement some type of delay so that if the user is still typing, I wait for the user to stop.
I am leaning towards option 3, but how do I detect if the user is still typing? Do I have to keep a timestamp associated with every keystroke?
If I were you I would stick with the threading solution.
It is faster, does not lag and - if written properly - will not introduce additional problems, and is a great opportunity to learn threading by a not so risky or difficult problem. If you choose this solution you will have to perform four easy steps:
Create an OnSearchFinished() event handler on your form and assign it to a message code (like WM_USER + 1). This message will be sent by your thread when it has finished producing search results.
Create a TThread descendant with your search code in its .Execute() method that will perform the search. It has to have a field with the search term. (The .Execute() will not be called directly so it can't handle parameters. You execute TThread descendents by .Resume()ing them.) The instance of this class can be created in the constructor of your form and needs to be created in suspended state.
Assuming your search code has a main cycle, you will have to check if your main program called .Terminate() over your object. If it has, you have to exit your cycle.
In the .OnChange() or .OnKeyDown() where you handle your search, you should (first) .Terminate() your thread (to stop an already running search if there is any), then set the field to your new search term and .Resume() it.

Google Calendar API : event update with the Ruby gem

I'm using https://github.com/google/google-api-ruby-client to connect to different google API in particular the Google Calendar one.
Creating an event, updating it and deleting it works most of the time with what one can usually find around.
The issue appears when one tries to update an event details after a previous update of the dates of the event.
In that case, the id provided is not enough and the request fails with an error :
SmhwCalendar::GoogleServiceException: Invalid sequence value. 400
Yet the documentation does not mention such things : https://developers.google.com/google-apps/calendar/v3/reference/calendars/update
The event documentation does describe the sequence attribute without saying much : https://developers.google.com/google-apps/calendar/v3/reference/events/update
What's needed to update an event ?
Is there specific attributes to keep track of when creating, updating events besides the event id ?
how is the ruby google api client handling those ?
I think my answer from Cannot Decrease the Sequence Number of an Event applies here too.
Sequence number must not decrease (and if you don't supply it, it's the same as if you supplied 0) + some operations (such as time changes) will bump the sequence number. Make sure to always work on the most recent copy of the event (the one that was provided in the response).
#luc answer is pretty correct yet here are some details.
Google API documentation is unclear about this (https://developers.google.com/google-apps/calendar/v3/reference/events/update).
You should consider that the first response contains a sequence number of 0.
The first update should contain that sequence number (alongside the title, and description etc ). The response to that request will contain an increment sequence number (1 in this case) that you should store and reuse on the next update.
While the first update would imply a sequence number of 0 (and work) if you don't pass any the second might still pass but the third will probably not (because it's expecting 1 as sequence).
So that attribute might appear optional but it is actually not at all optional.

Recurring appointments during a given period, MAPI way

When you query EWS or Outlook API for appointments restricted by some period for recurring ones you get fake instances. Exchange keeps only the main instance with recurrence pattern and exceptions list, and if one have to use MAPI one should "unpack" this solo appointment to get occurences by hand. That's not the problem ) The real pain I still cannot cure is how to get main appointments which reside outside of given period but their occurences are inside, I want to evade getting all recurring appointments (or even at some reasonable distance from given period for example a year to the left), "unpacking" and checking for ocurrences which are between our dates.
The current action sequence:
IMAPITable.Restrict on dates
.SetColumns
.QueryRows
Do MAPI interfaces have some methods or parameters which allow to achive my goal?
Here http://www.pcreview.co.uk/forums/redemption-recurring-activities-t2964080.html I've found detailed answer: pidLidClipStart and pidLidClipEnd instead of PR_START/END_DATE filtering.

Resources