typescript - 有没有办法将系统日期与 Angular TypeScript 中的日期列进行比较
问题描述
我在尝试将日期列值与系统日期进行比较时遇到问题。下面是代码。
public top5Items: Goal[] = [];
top5DailyItems() {
var date: Date = new Date();
this.apiservice.GetAllItems().subscribe(res => {
this.allGoals = res;
this.top5Items = this.allItems.filter(x => x.completion == 'Completed' && x.updatedDate.getDate == date.getDate());
});
}
<tr class="table-default" *ngFor="let top5DI of top5Items">
它在 lambda 表达式部分通过错误“TS2367:This condition will always return false ....”
解决方案
推荐阅读
- reactjs - Typescript 中抽象泛型容器类的子类的装饰器
- apache-kafka - 无法使用 KSQL 创建流
- android - 为什么我的自定义 TextView 不继承字体?
- python - jupyter notebook:再次显示seaborn情节
- android - 在 setGridViewItemClickListener 中出现错误以及如何显示可绘制的图像
- slack-api - 用于获取和设置团队偏好的 API
- javascript - 在网格元素内垂直居中文本
- python - 请求避免 ddos 保护
- widget - Flutter - 动态小部件定位
- php - php yii 框架,更改 connect.php 文件中的主机会导致网站挂起?