Skip to content
This repository was archived by the owner on Dec 26, 2019. It is now read-only.

Commit d18f02f

Browse files
committed
add test for customParser
1 parent 6cc800d commit d18f02f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/unit/components/bootstrap-datepicker-test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@ test('resets date when input is cleared', function(assert) {
5555
assert.equal(this.$().datepicker('getDate'), null, 'value is reset when input is cleared');
5656
});
5757

58+
test('should use customParser if provided', function(assert) {
59+
assert.expect(1);
60+
61+
this.subject({
62+
value: '2015-09-14T16:59:01+02:00',
63+
customParser: function(value) {
64+
return new Date(value);
65+
}
66+
});
67+
68+
assert.equal(this.$().val(), '09/14/2015');
69+
});
70+
5871
test('sets dates provided by value (multidate, default multidateSeparator)', function(assert) {
5972
this.subject({
6073
value: [new Date(2015, 0, 13), new Date(2015, 0, 7), new Date(2015, 0, 15)],

0 commit comments

Comments
 (0)