Fix error in dates.js