Update with changes done in the trunk for revision 7785:7797. This includes a bug correction for using leap calendar.