Closed randym127 closed 4 years ago
There must be also d and m letters in the date format string.
Right, but if we want to use this as a Date of Birth collection, in some countries you can only collect year.
'yyyy' is a valid date format as is 'mm yyyy' is also common for DOB.
That is good point :-) I will investigate this next weekend and check how easy is change current functionality.
@kekeh
Also in one of our project the requirement is like 17 January
.
Format - d mmm
.
It will be better, if we have that support in library. :)
@ShrikantAdhav I would also need that functionality. @kekeh Can you investigate if this is something you could easily add? I think it was already available in the previous datepicker for Angular < 7
Now you can give more date formats to the dateFormat option. For example yyyy, mm/yyyy and mmm yyyy.
This is implemented in 0.5.6 version.
When I set the format to 'yyyy' I get the following error:
ERROR TypeError: Cannot read property '0' of null at UtilService.push.../../node_modules/angular-mydatepicker/fesm5/angular-mydatepicker.js.UtilService.getDateValue (angular-mydatepicker.js:218) at UtilService.push.../../node_modules/angular-mydatepicker/fesm5/angular-mydatepicker.js.UtilService.isDateValid (angular-mydatepicker.js:146) at AngularMyDatePickerDirective.push.../../node_modules/angular-mydatepicker/fesm5/angular-mydatepicker.js.AngularMyDatePickerDirective.writeValue (angular-mydatepicker.js:2617) at setUpControl (forms.js:2057) at FormGroupDirective.push.../../node_modules/@angular/forms/fesm5/forms.js.FormGroupDirective.addControl (forms.js:5281) at FormControlName.push.../../node_modules/@angular/forms/fesm5/forms.js.FormControlName._setUpControl (forms.js:5882) at FormControlName.push.../../node_modules/@angular/forms/fesm5/forms.js.FormControlName.ngOnChanges (forms.js:5803) at checkAndUpdateDirectiveInline (core.js:22085) at checkAndUpdateNodeInline (core.js:23353) at checkAndUpdateNode (core.js:23315)