Fixed datepair and improved date format handling