简体   繁体   中英

Can not filter the data from as per date using Angular.js

I need one help.I need to filter data from list as per two date using Angular.js.My all code are present inside plunkr .There you can find i have list of 3 set of data.On the to i have two date field one is for from date and another is for to date . If user is selecting two date the list data will filter accordingly means the list data should view as per selecting dates from date field.Here i can not get that type of result. Here is code.Please help me to resolve this.

In script.js at line 25 change

getMidnight(event.date + 24 * 3600 * 1000).getTime()

to

getMidnight(new Date(event.date) + 24 * 3600 * 1000).getTime()

Edit:

For the comment, add these two line before return events.filter

from = getMidnight(from);

to = getMidnight(to).getTime() + (24 * 3600-1) * 1000;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM