【发布时间】:2019-03-01 04:08:11
【问题描述】:
日期字符串数组由后端数据对象构造如下:
const dates: string[] = this.data.map((item:any) => item.date.jsdate);
结果是
dates = [
Thu Jan 12 2015 00:00:00 GMT+0530 (India Time),
Tue Feb 25 2015 00:00:00 GMT+0530 (India Time),
Sun Jan 28 2016 00:00:00 GMT+0530 (India Time)
]
typeof(dates) 是“对象”
如何在 jsdates 数组中找到获取最新日期?
是否可以应用 date-fns 的 max 功能?
【问题讨论】:
标签: javascript arrays angular typescript date-fns