Add a loop to detect whether the DD and MM need to be swapped

Works for 2B schedule. Can't test other terms.