For Joda compat are alternate chronologies supported?

40 views
Skip to first unread message

SAL

unread,
Nov 24, 2011, 1:16:56 PM11/24/11
to google-...@googlegroups.com
I tried building a simple rule and then created an iterator with a start date using an alternate chronology. Is this supported? The results I got were that all returned dates seemed to be using the ISO chronology. Here is my test code:

        RRule rr = new RRule();
        rr.setFreq(Frequency.YEARLY);
        rr.setCount(7);
        rr.setName("RRULE");
       
        BuddhistChronology chron = BuddhistChronology.getInstance(DateTimeZone.getDefault());
       
        DateTime dt = new DateTime(2500, 1, 1, 0, 0, chron);
       
        System.out.println(dt.getChronology().toString());
        System.out.println(dt.toString());
        System.out.println(dt.toDateTimeISO().toString());
       
        DateTimeIterator dti = DateTimeIteratorFactory.createDateTimeIterator(rr.toIcal(), dt, dt.getZone(), true);
       
        DateTimeFormatter dtf = DateTimeFormat.forPattern(TEST_DATE_FORMAT);
        //dtf = dtf.withChronology(chron);
       
        while (dti.hasNext())
        {
            DateTime dt1 = dti.next();
            System.out.print(dt1.getChronology().toString());
            System.out.print(" ");
            System.out.print(dt1.toString());
            System.out.print(" ");
            System.out.print(dtf.print(dt1));
            System.out.print(" ");
            DateTime dt2 = dt1.toDateTimeISO();
            System.out.print(dt2.toString());
            System.out.print(" ");
            System.out.println(dtf.print(dt2));
        }

Wondering if this is expected to work right?

Mike Samuel

unread,
Nov 25, 2011, 8:44:25 AM11/25/11
to google-...@googlegroups.com
2011/11/24 SAL <sal...@gmail.com>:

No. It assumes CALSCALE:GREGORIAN, the proleptic Gregorian calendar.

Reply all
Reply to author
Forward
0 new messages