我使用angular2应用程序配置了一下,当我试图将本周星期六的日期分配给日期类型变量时,
case "weekend":
this.fromDate = moment().startOf('week');
显示错误,
Type 'Moment' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Moment'
我已在我的组件中导入了一个时刻,如下所示,
import * as moment from 'moment/moment';