Created
March 31, 2019 09:34
-
-
Save lydemann/e3d8bbcafba01f34b7dce6d392a34d22 to your computer and use it in GitHub Desktop.
todo-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public getDuedateTodayCount(todoItems: TODOItem[]) { | |
console.log('Called getDuedateTodayCount'); | |
return todoItems.filter((todo) => this.isToday(new Date(todo.dueDate))).length; | |
} | |
private isToday(someDate) { | |
const today = new Date(); | |
return ( | |
someDate.getDate() == today.getDate() && | |
someDate.getMonth() == today.getMonth() && | |
someDate.getFullYear() == today.getFullYear() | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment