Fix js bugs, validation date