Refactored competition date code so we can use it on the front page as
well as the edit competition page.