fix(datepicker): memory leak fix for datepicker

Fixes #2658
Closes #2684