【发布时间】:2016-08-10 10:39:37
【问题描述】:
我正在尝试使用 Angular2 在 vaadin-date-picker 中动态设置默认日期。在我的项目上实施这些任务时,它显示了一个异常。
我的代码和错误的 PFA
谢谢。
点击查看异常图片:Exception Image
点击获取代码 ImageCode Image
【问题讨论】:
标签: angular typescript polymer vaadin-elements vaadin-date-picker
我正在尝试使用 Angular2 在 vaadin-date-picker 中动态设置默认日期。在我的项目上实施这些任务时,它显示了一个异常。
我的代码和错误的 PFA
谢谢。
点击查看异常图片:Exception Image
点击获取代码 ImageCode Image
【问题讨论】:
标签: angular typescript polymer vaadin-elements vaadin-date-picker
答案在这里:https://vaadin.com/forum#!/thread/13790736
谢谢
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())}`;
}
【讨论】: