how to set input date to today date on initialization 1

how to set input date to today date on initialization

 date: new FormControl((new Date()).toISOString().substring(0, 10)),

Here is what the above code is Doing:
1. We’re creating a new FormGroup object and passing in an object with a key of date and a value of a new FormControl object.
2. The FormControl object is created with a default value of the current date.
3. The date is formatted to only include the year, month, and day.

Now that we have a FormGroup object, we can use it in our template.

Similar Posts