Cam2cam create validating date in java script