In attachDatePickerEvents function for component element use the same pattern to find when toggle the class than in the init function.