I'm trying to use DateTime::Calendar::Chinese to calculate public holidays for Hong Kong, as illustrated by this output from a test script, included below.

For 2004, Chinese New Year is 22 January, and there is a leap month after the
second lunar month. Buddah's Birthday is the 8th day of the 4th lunar month, so
(taking into account the leap month) that is 26 May. My script returns 26 April. Similarly, Tuen Ng is the 5th day of the 5th month, that is 22 June, but my script returns 23 May.


The table after "New Moons, Month starts" lists the dates of new moons, the first day of the month with leap_month => 0 and the first day of the month with
leap_month => 1. There is no difference between the last two columns: setting leap_month does nothing.

I've finally pulled out my copy of Calendrical Calculations and have been rewriting tests for DateTime::Calendar::Chinese, and apparently the conversion from Chinese date components to gregorian components is mightly screwed up...


And this in turn seems to be a problem in DateTime::Event::Chinese. new_year_before() is returning future dates(!)

Still poking around...

--d



Reply via email to