How to get list of occurrence dates from iCalendar RRULE - icalendar

I have the iCalendar file with RRULE for occurrences. How to get the list of dates on which the event will be occurring as per given start date and RRULE in the iCal file.
In Java, I want to write a method which should take start date and RRULE and return me the list of occurrence dates. Please help with simple solution or directions.

There is a Java library specifically for parsing RRULEs called google-rfc-2445.
The following link contains an example using the library where you supply a start date along with an RRULE and it prints out the dates.
http://google-rfc-2445.googlecode.com/svn/trunk/README.html

I do not have a chance to read README because of 404 - The requested URL /svn/trunk/README.html was not found on this server. If you have an example to show, please share it. I've found another solution lib-recur. lib-recur is shared via maven repository.

Related

I need the complete list of date format in meteor autoform

I am trying to bring up a date format of "Monday, February 2,2015" in meteor autoform, from this code
moment.utc("2015-02-02").format("LL")
I would like to have a list like in php.date function shows the full date format.
I believe each one of us will find few and post here so that we get the complete list. I googled and I never got the list.
I'm not sure I fully understand your question but this might help.
http://momentjs.com/

Java code to use Ical rrule and generate next recurrence date

I need a java code snippet to parse ICal rrule and generate the next recurrence date.
There is a Java library specifically for parsing RRULEs called google-rfc-2445.
The following link contains an example using the library where you supply a start date along with an RRULE and it prints out the dates.
http://google-rfc-2445.googlecode.com/svn/trunk/README.html
But I don't want to use the google lib.
You can use ical4j: https://github.com/ical4j/ical4j
More specifically, you can use the Component.calculateRecurrenceSet() method

Facebook-like "time since" calculation algorithm

On Facebook, each comment or other user event has a timestamp. But it is not listed as a simple date, but presented in a form of a human-friendly string. For example if right now it is 08:38 and the comment was made at 08:31, Facebook doesn't just tell you the time, but says "7 minutes ago".
Is there an open source implementation of Facebook algorithm (or similar) that takes a data of event, a current date and tells in a human-friendly form how long has it been since?
Pretty date http://ejohn.org/projects/javascript-pretty-date/ is a good javascript library for this
You could dig into timeago jQuery plugin's source code to study.
What I think that should be the best is this :
Store the timestamp when the comment is made (eg- 3:45 12-10-2012)
Get the current system time
Get the differnce between the two .i.e (current time -comment time ) .
Most of the languages provide the datediff method . Like in PHP you can use it like this

regarding calculating business days/holidays

does anyone know where I can download this zip file called "businessdays.zip" which was mentioned from this link ... http://www.tek-tips.com/viewthread.cfm?qid=136159 ... I mean is there a better way of calculating business days/holidays than what is previously written here ... http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_21376129.html ... I've tried this but method from experts-exchange, registered the dll but still not working for me. Can anyone help?
You could create a custom function that returns an array of holidays. See my answer to Crystal Report exclude time entries based on holiday rules.
In this post there is a function that takes a start date, and end date and return the number of working days in between. Also takes holidays into account.

Change article_custom so that 'past' doesn't exclude an event on the current date

I'm using textpattern and trying to display a list of upcoming events. I'm using article_custom.
<txp:article_custom
form="eventshome"
limit="4"
time="future"
sort="Posted
section="events" />
The issue I have is that this is supposed to show events coming up but using 'future' means that when an event is on the current date it's not showing (it's not future anymore). Both 'past' and 'future' time options seem to exclude the current date. That means people coming on the site don't see an event on that day which is a bit of an issue.
I've had a quick look around the code but can't seem to work out how to change the SQL statement so that future includes the current date.
Any help appreciated.
Its a bit oldie, but since i've just fixed the same issue, i thought i could provide my very simple soution to this matter.
What i did was simply set article date and time to its date and 25:59:59 time, so its visible all day on current day, but disappears immeadetly when day changes.
Since i didn't want to type those times always again and again, i run small javascript on article page which sets those automaticly to fields.
You can try plugin smd_calendar - http://stefdawson.com/sw/plugins/smd_calendar
it supports a lot of methods to display upcomming and past events.