0

I'm trying to set a default date dynamically in vaadin-date-picker using Angular2. While implementing these task on my project it shows an exception.

PFA of My code and Error

Thank you.

Click for exception image: Exception Image
Click for code ImageCode Image

Limon Monte
  • 52,539
  • 45
  • 182
  • 213
Nunna Suma
  • 469
  • 1
  • 11
  • 23

1 Answers1

0

Answer is here : https://vaadin.com/forum#!/thread/13790736

Thanks

    pad(i: number) {
  return i < 10 ? '0' + i : i;
}

ngOnInit() {
  const selectedDate = new Date();
  this.birthday = `${selectedDate.getFullYear()}-${this.pad(selectedDate.getMonth() + 1)}-${this.pad(selectedDate.getDate())}`;
}
Nunna Suma
  • 469
  • 1
  • 11
  • 23