I'm looking for a library in PHP (or better yet in ruby) to handle an events calendar. I've looked a dozens of them and every one breaks down when it comes to recurring events. Many require and end date and most create every recurring event as a entry in a database or something.
Every suggestion I get is to use the Google calendar which does do exactly what I want but I'm sure they won't let me build a service on top of there service.
Sounds like you may not want to roll your own, but what about just setting up a cron job to check every x minutes if there are any events that have to be sent out?
Haven't used Runt myself, but it looks like it might do what you want.
According to their homepage:
Runt is an implementation of select temporal patterns by Martin Fowler in the super-fantastic Ruby language. Runt provides:
ability to define recurring events
using simple, set-like expressions
an interfaced-based API for creating
schedules for arbitrary
events/objects
precisioned date types using Time
Points
date Ranges
everlasting peace and/or eternal life
RiCal's recurrence rules would work for this. They do the math, the implementation would be up to you.
require 'rubygems'
require 'ri_cal'
rule = RiCal::PropertyValue::RecurrenceRule::RecurringMonthDay.new(15)
p rule.include?(Date.new(2025, 7, 15)) # true
One good thing to know about recurring events is that our calendar cycles every 28 years.
i.e. today is thursday 3 december 2010, so I know that in excaclty 28 years(10226 days) we will be thursday 3 december 2038.
With this knowledge you can build an occurencies table on a limited period of time and just "move" it to your targeted time range...
Related
I'm developing an application, which needs to use calendar and I've decided to try a ready-made solution - Google Calendar API. I'm making calls from my backend to google and I only store calendars' and ids in my database, everything else is stored in google. So I'm writing a proxy basically and everything is going ok, but I've bumped into this article https://support.google.com/a/answer/2905486?hl=en, and now I'm really worried about those "short periods of time" in exceeding limits. I haven't found more accurate numbers. Well, if those "short periods of time" are ~1h, then I'm in the trouble and I need to implement my own calendar system. Can anyone dispel my doubts? This is not a pet-project.
Answer:
There's no public official information regarding the exact period this is referring to.
Nevertheless, after some testing, it seems like the short periods of time are longer than what your workflow would require.
Research:
Since the limit that is troubling you is calendar creation (from Avoid Calendar use limits):
If you create more than 60 new calendars in a short period, your calendar might go into read-only mode for several hours.
I did some tests with a Workspace account, in order to see what's the maximum rate of calendar creation that won't result in this limit being exceeded.
More specifically, I tried creating calendars periodically, with several different periods, ranging from 5 seconds to 15 minutes.
For most of these periods (from 5 seconds to 10 minutes at least), the following exception started showing up after creating 40-something calendars approximately:
You have been creating or deleting too many calendars or calendar events in a short time
After this, no more calendars could be created for some time.
For 15-minute period, I got the error after creating around 80-something calendars, so I guess the maximum rate of creation is close from there (1 calendar created every >15 minutes). Since this rate is not disclosed, though, it could change without notice, so take this with a grain of salt.
The original poster, GorgeousPuree, also made some testing, with results in accordance with what I got (see comment):
I also made my expirements and I've got a timeout after 25 calendars in 1 and 3 minutes intervals.
Conclusion:
In any case, the short period seems to be way too long for the worst case scenario:
60 calendars in 5 mins
I am working on a project where the objective is to keep track of whether a client has uploaded data within their expected time-window or not. These windows can occur daily, weekly, bi-weekly, bi-monthly, quarterly... etc. I'm currently using the CRON syntax to describe these schedules which kind-of works, but it falls short in some scenarios, for example the bi-weekly one.
I was wondering if there is some industry standard way to efficiently describe and store schedules that I don't know of. I tried to educate myself via Google, but when I put the word schedule into the mix, it always assumes I'm trying to schedule some task, but I only want to calculate dates based on these schedule definitions and compare the incoming file dates with them.
Thank you
I'd like to setup a Microsoft Flow trigger in Office 365 so that if I get an email from a specific set of people after hours, or on the weekend that I'd get a notification from the app. I've got the people portion figured out, and I see they have an "equals" condition for the receive time, but how can I filter by day / time range?
I haven't done this before, but look into the dayOfWeek() and startOfHour() functions.
You can figure out if its a weekend using dayOfWeek(), and for the weekdays use startOfHour() to know if the time is greater than or less than your preference.
-Chris
Capturing data in Keen.io is pretty straight-forward when it's driven by an event. (User-logged-in, Customer-bought-stuff, ...). That's very nicely explained in the docs.
But what is the best approach when I want insight on a state of my app at a given time in the past?
For instance: how many active licenses were there this time last year?
Our first thought is to run a cronjob every hour, to get those data from te DB, and store them in a custom collection. Is this the right approach, or are there better solutions?
Is there a way for me to make multiple all-day events at weird intervals. If so, is there a way to make it a template so I can do it faster?
I have a very repetitive business that has identical deadlines for every project I am given. Currently, I have to add all of these deadlines into my outlook calendar manually. I'd like a short cut where I can select a template or something that automatically programs the various all-day calendar items that I currently create manually.
For instance, I get a project today and I want to make an all-day reminder in 15 days to remind me to complete my first task. 7 days later, I need an all-day reminder for my second task. 45 days later, I need a reminder for my third task.
The other scenario is deadlines. I want to add an all-day event in my outlook calendar for the final deadline for a project. I'd like a 15 day reminder and a 5 day reminder to appear on my calendar as all-day events. I know there is a way to add a single reminder, but if it pops up while I'm away from my desk, I tend to ignore the reminder. An all-day calendar item is much harder to ignore.
Is there some way to automatically do this through a macro or function of MS Outlook of which I'm unaware. I keep my life in outlook, so I'd like for all of my deadlines to appear there as well.
TIA