function changeDate(date) { date = date.replace(/\-/g, ''); link = createLink('my', 'todo', 'type=' + date); location.href=link; }