How to set today date and time in mdb-date-picker and mdb-t


Topic: How to set today date and time in mdb-date-picker and mdb-time-picker?

Water Damage Network pro asked 6 years ago

How to set current date  and time in input date picker and time picker?


Arkadiusz Idzikowski staff answered 6 years ago

Copy the examples from our documentation and update ngModel value, for example for date picker:

setDate() {

const date= newDate();

const year= date.getUTCFullYear();

const month= date.getUTCMonth() +1;

const day= date.getUTCDate();

this.model= { date: { year, month, day } };

}
 
And for time picker:
 
this.lightClock = '14:00';

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 6.2.4
  • Device: PC
  • Browser: chrome
  • OS: Ubantu
  • Provided sample code: No
  • Provided link: No