JavaScript application that calculates moon phases of any date