JS calendar duplicate issue resolved