fix date js error