Updated changeDate function in dates.js