Fixing js error hiding all date fields