angular-datepicker icon indicating copy to clipboard operation
angular-datepicker copied to clipboard

Datepicker with an empty ng-model

Open aurenda opened this issue 9 years ago • 2 comments

Cannot have a datepicker with an empty ng-model because it shows invalid date or the current date. I think it would be a good idea to have an option to specify if I want to have a value when the model is initialized (with the current date) or an empty object (or string). There are some cases (such as having a form where the input field related to the datepicker is not required) when it is not necessary to select a date; it is confusing then that the current date appears always in the input field. I made a workaround for this and modified the code below sending an empty string in the function "formatter". This is only a workaround but I think a functionality like this will add value to your component.

function formatter(value) { return value != "" ? dateFilter(value, format, timezone) : ""; }

aurenda avatar Jul 11 '16 13:07 aurenda

#199

cipchk avatar Jul 11 '16 14:07 cipchk

Would be fixed by PR https://github.com/g00fy-/angular-datepicker/pull/293

Dr1Ku avatar Aug 01 '16 10:08 Dr1Ku