首页 > 解决方案 > 有没有更好的方法将 Moment 与 TypeScript(Visual Studio 2019 红色波浪线)一起使用?

问题描述

现在看起来我们必须输入很多:

nextTimePeriod(momentString: string) {
    this.today = moment(this.today).add(1, <moment.unitOfTime.DurationConstructor>(momentString + 's'));
    this.startDate = moment(this.today).startOf(<moment.unitOfTime.StartOf>momentString);
}

标签: typescriptmomentjsvisual-studio-2019

解决方案


推荐阅读