Finished porting the code from Date4J.