Simplifying julian date code

added test