I'm trying to implement Month and Year only in Angular Material Datepicker (based in their docs). I noticed that by default, it's getting the current day. For example the date today is June 13, 2019 and I selected May(month) 2019(year) and it returns May 13, 2019.
What I am thinking now is to make the day default as 1 so it would result into May 1, 2019 or Feb 1 or Mar 1 etc. How would I do that?
UPDATE: I already solved this part by setting the value like this in component file
this.form = new FormGroup({
date: new FormControl(moment().startOf('month'), validators: [Validators.required]
});
If in case I selected May 31st and assuming the current month is June and have no 31st, I'm expecting to have it returned as June 30 but what happens is it became June 1. Is this a bug?