Update utils.js

add trim and date