Move time format function into utils. Change event listener.