Refactoring the date input in SweWPF.