Skip to content

Commit

Permalink
feat: list understands 1y or 2year (#26)
Browse files Browse the repository at this point in the history
closes #26
  • Loading branch information
Ephigenia committed Sep 29, 2020
1 parent a0cfd65 commit 14d0140
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/mite-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ function getRequestOptions(period, program) {
case 'month':
from.setMonth(from.getMonth() - parseInt(matches[1], 10));
break;
case 'y':
case 'year':
from.setFullYear(from.getFullYear() - parseInt(matches[1], 10));
break;
}
program.from = from.toISOString().substr(0, 10);
program.to = (new Date).toISOString().substr(0, 10);
Expand Down

0 comments on commit 14d0140

Please sign in to comment.