Fixed bug in date calc on tests