jinjin9876 / google-rfc-2445 Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/google-rfc-2445
License: Apache License 2.0
Automatically exported from code.google.com/p/google-rfc-2445
License: Apache License 2.0
Hi, a lot of different RRULEs that I've tried returns me the start date.
The rule below is just an example.
Most of the examples from https://tools.ietf.org/html/rfc2445#section-4.8.5.4
fails due to a returning startdate.
private static void runGoogleTests() throws ParseException
{
DateTimeZone dtz = DateTimeZone.UTC;
DateTime dtStart = new DateTime("2014-11-22T00:00:00Z", dtz);//SATURDAY
DateTimeIterable dti = DateTimeIteratorFactory.createDateTimeIterable("RRULE:FREQ=WEEKLY;COUNT=10;BYDAY=MO", dtStart, dtz, true);
System.out.println("Size of iterable = " + Iterators.size(dti.iterator()));
for(DateTime dateTime : dti)
{
System.out.println(dateTime);
}
}
What is the expected output? What do you see instead?
The expected output is a 10 dates that is only Mondays.
Output
Size of iterable = 11
2014-11-22T00:00:00.000Z <-- Start date is Saturday
2014-11-24T00:00:00.000Z
2014-12-01T00:00:00.000Z
2014-12-08T00:00:00.000Z
2014-12-15T00:00:00.000Z
2014-12-22T00:00:00.000Z
2014-12-29T00:00:00.000Z
2015-01-05T00:00:00.000Z
2015-01-12T00:00:00.000Z
2015-01-19T00:00:00.000Z
2015-01-26T00:00:00.000Z
Original issue reported on code.google.com by [email protected]
on 24 Nov 2014 at 1:15
Attachments:
What steps will reproduce the problem?
DTSTART:20070501T090000
RRULE:FREQ=DAILY;UNTIL=20070506T000000Z
Then call:
RecurrenceIteratorFactory.createRecurrenceIterator
What is the expected output? What do you see instead?
I should get just 5 days back.
The iterator does not seem to end (I break out of the loop
after 10000 dates).
What version of the product are you using? On what operating system?
Unknown. Downloaded the jar from the website this week.
Please provide any additional information below.
I am using the RRULE functionality as a component of my Java-based
iCalendar library:
http://javacaltools.sourceforge.net
Original issue reported on code.google.com by [email protected]
on 17 May 2007 at 5:26
iCalendars often contain custom Timezone definitions (VTIMEZONE) which are not
matching standard timezone names. In such a case the library will, wrongly,
throw a 'bad parameter' exception.
The attached file is a test case.
In that file, parsing
EXDATE;TZID="Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna":20101216T10000
... will cause an exception
The library should handle custom timezones, but will presumably need a more
richer implementation than java.util.TimeZone: for example JodaTime's
DateTimeZone which can be build dynamically by DateTimeZoneBuilder.
Original issue reported on code.google.com by [email protected]
on 12 Jan 2011 at 8:53
Attachments:
Would it be possible to add this project to Maven Central?
Original issue reported on code.google.com by mike.angstadt
on 21 Sep 2014 at 9:46
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
expected output:
FREQ=MONTHLY;INTERVAL=6;BYDAY=2MO,2TU,2WE,2TH,2FR;COUNT=10
FREQ=MONTHLY;INTERVAL=6;BYDAY=2MO,TU,WE,TH,FR;COUNT=10
What version of the product are you using? On what operating system?
Please provide any additional information below.
According to the document "ivCalendar The Electronic Calendaring and Scheduling
Exchange Format Version 1.0",
Every six months on the 2nd Monday thru Friday for 10 occurences:
MP6 2+ MO TU WE TH FR #10
Original issue reported on code.google.com by [email protected]
on 13 May 2009 at 4:12
A simple JUnit test is needed to reproduce the bug.
public void testExcept() throws Exception
{
RecurrenceIterator rrule
= RecurrenceIteratorFactory
.createRecurrenceIterator(
"RRULE:FREQ=WEEKLY;INTERVAL=3;COUNT=5",
new DateValueImpl(2009, 02, 02),
GMT1);
StringBuilder sb = createRecuranceDateString(rrule);
// test succeed
assertEquals("20090202,20090223,20090316,20090406,20090427",
sb.toString());
RecurrenceIterator rdate
= RecurrenceIteratorFactory
.createRecurrenceIterator(
"RDATE;VALUE=DATE:20090316",
new DateValueImpl(2009, 03, 16),
GMT1);
sb = createRecuranceDateString(rdate);
//test succeed
assertEquals("20090316", sb.toString());
RecurrenceIterator rdateExcept
= RecurrenceIteratorFactory.except(rrule, rdate);
sb = createRecuranceDateString(rdateExcept);
//test FAILED !!
assertEquals("20090202,20090223,20090406,20090427", sb.toString());
}
The last assert returns:
junit.framework.ComparisonFailure:
expected:<20090202,20090223,20090406,20090427>
but was:<>
Thanks for this excellent project,
Regards
Yanick.
Original issue reported on code.google.com by [email protected]
on 18 Feb 2009 at 11:15
I am truely greateful for a wonderful library. I have a bug to report.
@Test
public void reproduceAdanceToMethodBug() throws ParseException {
// given
String rData = "RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=TU;BYSETPOS=4";
DateTime recurrenceStart = new DateTime(2015, 2, 20, 0, 0, 0, 0, DateTimeZone.UTC);
DateTime skipBefore = new DateTime(2015, 4, 20, 0, 0, 0, 0, DateTimeZone.UTC);
DateTimeIterator iterator = DateTimeIteratorFactory.createDateTimeIterable(rData, recurrenceStart, recurrenceStart.getZone(), true).iterator();
// when
iterator.advanceTo(skipBefore);
// then
assertThat(iterator.next(), is(new DateTime(2015, 4, 28, 0, 0, 0, 0, DateTimeZone.UTC)));
}
Test case above results in AssertionErrror.
java.lang.AssertionError:
Expected: is <2015-04-28T00:00:00.000Z>
but: was <2015-05-26T00:00:00.000Z>
DateTimeIterator.advanceTo() method skips 2015-04-28T00:00:00.
It seems to work correctly with rData without 'FREQ=MONTHLY + BYSETPOS'
combination.
Original issue reported on code.google.com by [email protected]
on 4 May 2015 at 8:08
The thread safety of google-rfc-2445 is not documented. Is it thread safe?
We are using google-rfc-2445 in a multi threaded environment and have
received the following exception:
08 Feb 2008 11:00:01,218 [ERROR] xxx.SurveillanceProcessor - Error
processing surveillance 264: java.lang.IndexOutOfBoundsException Index: 6,
Size: 3
java.lang.IndexOutOfBoundsException: Index: 6, Size: 3
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.google.ical.values.IcalSchema.applyContentSchema(IcalSchema.java:108)
at com.google.ical.values.RRuleSchema$4.apply(RRuleSchema.java:158)
at com.google.ical.values.IcalSchema.applyContentSchema(IcalSchema.java:101)
at com.google.ical.values.RRuleSchema$1.apply(RRuleSchema.java:81)
at com.google.ical.values.IcalSchema.applyObjectSchema(IcalSchema.java:117)
at com.google.ical.values.AbstractIcalObject.parse(AbstractIcalObject.java:82)
at com.google.ical.values.RRule.<init>(RRule.java:52)
at
com.google.ical.iter.RecurrenceIteratorFactory.parseContentLines(RecurrenceItera
torFactory.java:451)
at
com.google.ical.iter.RecurrenceIteratorFactory.createRecurrenceIterable(Recurren
ceIteratorFactory.java:93)
at
com.google.ical.compat.jodatime.LocalDateIteratorFactory.createLocalDateIterable
(LocalDateIteratorFactory.java:83)
at
com.google.ical.compat.jodatime.LocalDateIteratorFactory.createLocalDateIterable
(LocalDateIteratorFactory.java:100)
This exception doesn't happen every time and it is not clear under which
conditions it happens.
I fear that google-rfc-2445 is NOT thread safe. A look at the class
com.google.ical.values.IcalSchema has confirmed my fears.
Original issue reported on code.google.com by [email protected]
on 13 Feb 2008 at 1:19
[deleted issue]
What steps will reproduce the problem?
1. Create a calendar entry in your google calendar with a never ending daily
recurrence rule for each day.
2. Get the event data via the gdata.java-1.41.5 library and create a new RRule
with the recurrence string of the created event.
What is the expected output? What do you see instead?
Expected: A RRule instance.
Here is my recurrence rule string:
DTSTART;TZID=Europe/Zurich:20100930T183000
DTEND;TZID=Europe/Zurich:20100930T193000
RRULE:FREQ=DAILY;UNTIL=20101005T163000Z
BEGIN:VTIMEZONE
TZID:Europe/Zurich
X-LIC-LOCATION:Europe/Zurich
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
And here the thrown exception:
java.text.ParseException: cannot parse content line
[[DTSTART;TZID=Europe/Zurich:20100930T183000
DTEND;TZID=Europe/Zurich:20100930T193000
RRULE:FREQ=DAILY
BEGIN:VTIMEZONE
TZID:Europe/Zurich
X-LIC-LOCATION:Europe/Zurich
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE]] in []
at com.google.ical.values.IcalSchema.badContent(IcalSchema.java:164)
at com.google.ical.values.AbstractIcalObject.parse(AbstractIcalObject.java:58)
at com.google.ical.values.RRule.<init>(RRule.java:52)
What version of the product are you using? On what operating system?
I checked out the sources yesterday.
Original issue reported on code.google.com by [email protected]
on 1 Oct 2010 at 8:36
http://code.google.com/p/google-maven-repository/
Not really urgent on my behalf, but I expected the rfc2445 library to be
there alongside the other open source google libraries I use.
Original issue reported on code.google.com by [email protected]
on 21 Oct 2009 at 10:29
What steps will reproduce the problem?
Iterate over RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20110121
with start java.util.Date set to Mon Jan 17 11:00:00 CET 2011
What is the expected output? What do you see instead?
Expected output:
1: Mon Jan 17 11:00:00 CET 2011
2: Tue Jan 18 11:00:00 CET 2011
3: Wed Jan 19 11:00:00 CET 2011
4: Thu Jan 20 11:00:00 CET 2011
5: Fri Jan 21 11:00:00 CET 2011
Total: 5 instances
Actual output:
1: Mon Jan 17 11:00:00 CET 2011
2: Tue Jan 18 11:00:00 CET 2011
3: Wed Jan 19 11:00:00 CET 2011
4: Thu Jan 20 11:00:00 CET 2011
Total: 4 instances
What version of the product are you using? On what operating system?
1.0.31, Windows XP, rfc2445-no-joda.jar
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 17 Jan 2011 at 1:49
What steps will reproduce the problem?
1. Just running this test method :
public static void testsICAL(){
String iCal = "RRULE:FREQ=YEARLY;INTERVAL=2;BYDAY=SA;BYMONTH=9;BYSETPOS=1";
SimpleDateFormat datePatternUTC = new SimpleDateFormat(DATE_PATTERN_API);
datePatternUTC.setTimeZone(TimeZone.getTimeZone("UTC"));
String sDateStart="2013-08-31T06:00:20.000";
String sDateAdvanceTo="2013-10-01T00:00:00.000";
Calendar cStart = Calendar.getInstance();
Calendar cAdvanceTo= Calendar.getInstance();
try {
cStart.setTime(datePatternUTC.parse(sDateStart));
cAdvanceTo.setTime(datePatternUTC.parse(sDateAdvanceTo));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
DateTime start = new DateTime(cStart.getTimeInMillis());
DateTime advanceTo = new DateTime(cAdvanceTo.getTimeInMillis());
try {
DateTimeIterator it = com.google.ical.compat.jodatime.DateTimeIteratorFactory.createDateTimeIterator(iCal, start, DateTimeZone.forID("Europe/Paris"), true);
if (it != null){
// On avance l'iterateur jusqua la date de debut de liste
it.advanceTo(advanceTo);
Date date;
int i = 0;
while(i<=5 && it.hasNext()) {
date=it.next().toDate();
System.out.println("date: "+date);
i++;
}
}
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
What is the expected output? What do you see instead?
I want to get the first Saturday of September, every two year.
I want the list begin after : 2013-10-01T00:00:00.000.
Expected :
date: Sat Sep 05 08:00:20 CEST 2015
date: Sat Sep 02 08:00:20 CEST 2017
date: Sat Sep 07 08:00:20 CEST 2019
date: Sat Sep 04 08:00:20 CEST 2021
date: Sat Sep 02 08:00:20 CEST 2023
See instead :
date: Sat Sep 02 08:00:20 CEST 2017
date: Sat Sep 07 08:00:20 CEST 2019
date: Sat Sep 04 08:00:20 CEST 2021
date: Sat Sep 02 08:00:20 CEST 2023
date: Sat Sep 06 08:00:20 CEST 2025
The 2015 occurrence is ommited.
What version of the product are you using?
rfc2445-4Mar2011.jar
Please provide any additional information below.
The problem does not occurs if I set :
sDateAdvanceTo="2013-09-30T00:00:00.000";
Original issue reported on code.google.com by [email protected]
on 26 Sep 2014 at 7:37
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.