-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1132 from hchiam/dmy-experiment
fix(plugins/dates): add dmy option to fix #1131
- Loading branch information
Showing
5 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import test from 'tape' | ||
import nlp from './_lib.js' | ||
|
||
test('dmy option falsy', function (t) { | ||
t.equal('March 26', nlp('03/26').dates().format('{month} {date}').text(), 'WITHOUT dmy option') | ||
t.equal('March 26', nlp('03/26').dates({dmy:false}).format('{month} {date}').text(), 'WITHOUT dmy option') | ||
t.equal('March 26', nlp('26/03').dates().format('{month} {date}').text(), 'WITHOUT dmy option') | ||
t.equal('March 26', nlp('26/03').dates({dmy:false}).format('{month} {date}').text(), 'WITHOUT dmy option') | ||
t.equal('March 4', nlp('03/04').dates().format('{month} {date}').text(), 'WITHOUT dmy option') | ||
t.equal('March 4', nlp('03/04').dates({dmy:false}).format('{month} {date}').text(), 'WITHOUT dmy option') | ||
|
||
t.end() | ||
}) | ||
|
||
test('dmy option true', function (t) { | ||
t.equal('April 3', nlp('03/04').dates({dmy: true}).format('{month} {date}').text(), 'WITH dmy option') | ||
|
||
t.end() | ||
}) |