Cleaned up code and fixed the translation of the weekdays in the datepicker