Adding defaultDate setting
Code refactoring