Formalizing Date Arithmetic and Statically Detecting Ambiguities for the Law