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

Commit d660726

Browse files
committed
Update dateparser.js
fix(dateparser): Optional loeading '0' in 'M' and 'd' dateparser
1 parent 03b7c69 commit d660726

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/dateparser/dateparser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ angular.module('ui.bootstrap.dateparser', [])
3030
apply: function(value) { this.month = value - 1; }
3131
},
3232
'M': {
33-
regex: '[1-9]|1[0-2]',
33+
regex: '0?[1-9]|1[0-2]',
3434
apply: function(value) { this.month = value - 1; }
3535
},
3636
'dd': {
3737
regex: '[0-2][0-9]{1}|3[0-1]{1}',
3838
apply: function(value) { this.date = +value; }
3939
},
4040
'd': {
41-
regex: '[1-2]?[0-9]{1}|3[0-1]{1}',
41+
regex: '0?[1-2]?[0-9]{1}|3[0-1]{1}',
4242
apply: function(value) { this.date = +value; }
4343
},
4444
'EEEE': {

0 commit comments

Comments
 (0)