Gregorian date to Julian Day calculation refactored