Thanks very much for your very quick reply. Sub-classing on BasicGJChronology (in the chrono package) worked beautifully.
As an aside, here are some of the common calendars our community works with (http://www.cgd.ucar.edu/cms/eaton/cf-metadata/CF-1.0.html#cal). Many already exist in joda-time already and I will probably implement most or all of those that don't. I'd be happy to send them along for the contrib area when I'm finished. Thanks again, Roland Brian O'Neill wrote: > Because leap year calculations are used internally by many of the > fields, simply overriding the isLeap method is not likely to work. > What will work better is for you to subclass GregorianChronology and > override the implementations of isLeapYear and > calculateFirstDayOfYearMillis. > > The problem is that these methods are package private, and the > GregorianChronology constructor is private. If you subclass > BasicGJChronology, you can workaround the private constructor, but > BasicGJChronology is package private. > > For now you can just create you chronology in the same package and it > should work, but I think the chronology implementations should be > opened up a bit. i.e. public classes and protected methods. > > As for your second problem, LenientChronology or LenientDateTimeField > should (I think) do the trick. > > On 12/8/06, *Roland Schweitzer* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Hello, > > I've been using joda-time for a while and it's great tool. Much > of the > complication with calendars comes from the "leap issues" so it's a bit > ironic that I want to create a Chronology that ignores leap years > (every > February is 28 days long regardless of the year). Climate scientists > often use such a calendar for long running climate simulations and > they > often create climatological calendars where the calendar axis is > modulo > (i.e. the 366th day is the same as the first day). I would like to > create Chronology classes I can use for working the time axis of > such a > models. > > For the first it seems that I should create a sub-class of > AssembledChronology where every DateTimeField is a sub-class where > isLeap is always false.. For the second, I may be able to use > addWrap* > methods of my NoLeapChronology. > > Has anybody done this or have I overlooked something that already > exists? Any advice or comments? > > Thanks in advance. > > Roland > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Joda-interest mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/joda-interest > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Joda-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/joda-interest
