Skip to content

Commit

Permalink
fix(en): "1 week" should be treated like "in 1 weeks"
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstenson committed Oct 17, 2018
1 parent 540b8ad commit 9a71168
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/language/en/week.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function(language) {
.add([ 'previous week' ], previousWeek)

.add([ 'week', ordinal ], v => ({ week: v[0].value }))
.add([ ordinal, 'week' ], v => ({ week: v[0].value }))
.add([ GraphBuilder.result(ordinal, v => v.type === 'specific'), 'week' ], v => ({ week: v[0].value }))

.mapResults(map)
.onlyBest()
Expand Down
7 changes: 6 additions & 1 deletion test/language/en/date.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,19 @@ describe('English', function() {
day: 15
});


test('in 2wks', { now: new Date(2010, 0, 1) }, {
period: 'week',
year: 2010,
month: 0,
day: 15
});

test('1 week', { now: new Date(2010, 0, 1) }, {
period: 'week',
year: 2010,
month: 0,
day: 8
});

test('2nd this month', { now: new Date(2010, 0, 1) }, {
period: 'day',
Expand Down

0 comments on commit 9a71168

Please sign in to comment.