Changed param type and used toDateString instead