improved date check in unit test