【发布时间】:2018-09-27 09:19:03
【问题描述】:
我想根据当前月份显示对象 我的代码是
for (let m of this.monthEvent){
m=new Date();
if(m.getMonth() === new Date().getMonth()){
this.thisMonth=m;
}
return this.thisMonth;
我的数组是
[{title: "", date: "2018-03-29"},
{title: "", date: "2018-04-13"},
{title: "", date: "2018-04-12"},
{title: "leave", date: "2018-04-11"}
{title: "", date: "2018-04-16"}]
它表明 m.getTime 不是一个函数
我想显示当前月份的事件
提前致谢
【问题讨论】:
-
myArray.filter(event => event.date.indexOf('currentMonth') > -1)尝试自己解决日期解析;)
标签: javascript arrays date ionic-framework ionic2