Custom JavaScript prototype class for generating dates