added date looping js