JS dates validation