What to write in startDate and endDate under Event of schema.org, if event is happending all the time? - schema.org

There is no start date and end date, but this fields are recommended.

If your events are infinite, then this is not an event but a process.

Related

iCalendar RRULE/RECUR for Thanksgiving weekend?

Is there an "easy" way to create yearly events for "Thanksgiving weekend", meaning an event starting on the 4th Thursday of November (with Sunday as the first weekday), and ending on the following Sunday?
As nearly as I can tell, things like RRULE and RECUR let you create recurring events with zero duration (ie, points in time), but not recurring events that last over a period of time.
What am I missing?
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY:4TH;WKST=SU
You're definitely not restricted to 0 duration events. You can simply specify a DTSTART and DTEND (or DURATION) to get the full weekend.
To elaborate on Evert's answer, to specify a 4 day long event, you just need to specify the DTSTART and DTEND such as below:
DTSTART;VALUE=DATE:20151126 DTEND;VALUE=DATE:20151130 RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=4TH;WKST=SU
the justification comes from below section of RFC5545:
RFC5545 3.6.1The "DTSTART" property for a "VEVENT" specifies the inclusive
start of the event. For recurring events, it also specifies the
very first instance in the recurrence set. The "DTEND" property
for a "VEVENT" calendar component specifies the non-inclusive end
of the event.

What is the relationship between #timestamp and "over window:time"?

I'm using Drools 6.2.0.Final and I need to process a set of event using window:time. Each event has a date's field.
public class Event {
private Long id;
private Date date;
...
And in my drl:
declare org.drools.examples.broker.events.Event
#role( event )
#timestamp (date)
end
rule "test"
when
$count: Number() from accumulate (
$e: Event() over window:time(40s) from entry-point "stream" ,
count($e))
then
System.out.println("Count:" + $count);
end
e1 (2015-01-01 00:00:00)
e2 (2015-01-01 00:00:20)
e3 (2015-01-01 00:00:40)
e4 (2015-01-01 00:01:00)
Scenario 1: Using realtime and inserting a set a event simultaneously.
session.getEntryPoint("stream").insert(e1);
session.fireAllRules();
session.getEntryPoint("stream").insert(e2);
session.fireAllRules();
session.getEntryPoint("stream").insert(e3);
session.fireAllRules();
session.getEntryPoint("stream").insert(e4);
session.fireAllRules();
Scenario 2: Using pseudo, inserting a set a event simultaneously and adding to clock the event's offset.
session.getEntryPoint("stream").insert(e1);
session.fireAllRules();
clock.advanceTime(20, TimeUnit.SECONDS);
session.getEntryPoint("stream").insert(e2);
session.fireAllRules();
clock.advanceTime(40, TimeUnit.SECONDS);
session.getEntryPoint("stream").insert(e3);
session.fireAllRules();
clock.advanceTime(60, TimeUnit.SECONDS);
session.getEntryPoint("stream").insert(e4);
session.fireAllRules();
The second scenario runs fine. But I have some questions:
What is the relationship between #timestamp and "over window:time"?
What happends if a need to insert unsorted events (by timestamp) in Working memory?
Can I use the timestamp denoted by my event instead of the timestamp denoted by the insert's time?
Thanks.
UPDATE 1
#timestamp, #duration etc. are only used to relate events together (e.g A before B, A meets B, and so on), and that they do not relate the event to the clock. But "over window:time" is based on Drools's clock. The window's time uses the moment that the event was inserted in working memory to match the rule. You need to use Drools stream mode.
What is the relationship between #timestamp and "over window:time"? A window with length d selects an event containing the timestamp x if now.d < x <= now.
What happens if I need to insert unsorted events (by timestamp) in Working memory? You shouldn't do that unless the Engine is in "cloud" mode. The timestamp is basically nothing but a long value, and can be evaluated all the same. However, you should think carefully before doing this, as this may produce results that differ from an execution where inserts are done in the proper order.
Can I use the timestamp denoted by my event instead of the timestamp denoted by the insert's time? It appears that you are doing just that, due to #timestamp(date) in the DRL declare statement.

Highlight certain days in monthcalendar in iphone

I need to mark date from the date where the event is started to the the date where the event is ended. I need to mark from start date to end date with some shadow on my calendar.How can I do this.

iPhone - sorting a list of recurrent events

I have this list of recurrent events on a table at my app. Something like iCal. The user can set up events like:
meeting next tuesday 3 pm
meet wife every wednesday 6 pm
take pills every day 1 pm
take children saturday and sunday 9 am
The question is: how do I sort this to discover which will be the next event?
I am not sure the best way to create the core data entities.
Should I create the days of weeks as a second managed object on core data and create a to-many relationship to the first managed object representing the events (so each event can have one or more days of week objects). Should I create one managed object with boolean entities representing the days of week?
I can imagine different ways of doing this on core data, but I am not seeing how one can extract from core data a list sorted by event, I mean, a list that shows first the events close to today's date and last the event more distant.
What I ask here is not code, but rather, ideas on how this should be constructed... what do you guys suggest as the best way to put this together.
thanks.
What I would do is have your "Event" entity in Core Data have a date and a recurrence attribute to it. Set the date to when the event occurs and recurrence to how many seconds until the next time it occurs. When the event happens, update the date with -dateByAddingTimeInterval with the current date and the recurrence interval.
You can then sort by date to get your next event. If you want to show the event multiple times, like for a month calendar layout, loop on -dateByAddingTimeInterval: with the recurrence interval and mark it on your view during each iteration.

How to set workflow condition that runs 2AM everyday?

I am to create email alert which works together with workflow rule.
My goal is to set the workflow that runs 2am everyday &&
my custom object field 'startDate' is tomorrow.
Basically every 2am workflow checks my custom object and see if startDate is tomorrow.
I'm at workflow page looking at Date predefined variable,
I see:
DATE
DATEVALUE
DAY
MONTH
NOW
TODAY
YEAR
For the startDate, I can set condition startDate = today() + 1
For second condition which is 2am everyday I can't think of a way. I don't see HOUR variable etc..
Has anyone done this before?
UPDATE
This might work I have to test though..
Change NOW() datetime output to String (done by TEXT)
Start from index 12 and grab 2 chars to the right (done by MID)
This means I obtained hour part of current time and if the value equals to '02' which means
2am at night.
MID(TEXT(NOW()), 12, 2) = '02'
Wait a sec.. but WHEN does salesforce check this workflow???
If they check workflow once a day, what time it would be? If check is done past 2am, this workflow would never get looked at??? I'm a bit confused.
Work flow only triggers on some event (object update, create, etc.). So having it run at 2am without a some sort of trigger is impossible.
The trick is to use schedulable apex to insert an object (or update a field) every day at 2am and set your workflow to trigger on that insert/update. Then your workflow would fire off on that object at whatever time your scheduled apex ran.