Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Material Date Picker Default Date Selected

This help me for date picker,

Now in this date-picker i want today's date as selected by default.

can anyone help me how do set default date?

Thank you.

like image 422
Sagar Naliyapara Avatar asked Aug 04 '26 11:08

Sagar Naliyapara


1 Answers

In andgular material i have used this for datepicker and my issue of set current date is solved as follow,

Using AngularJs Controller,

HTML:

<input type="date" list="days" ng-model="transaction.date">

Javascript:

$scope.transaction.date = new Date();
(1) google components (2) datepicker demo (3) material demo
like image 109
Sagar Naliyapara Avatar answered Aug 07 '26 03:08

Sagar Naliyapara



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!