handle YYYY-MM-DD and MM-DD-YYYY