Dynamic calendar in javascript with example