File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function parse(str) {
5050 if ( str . length > 100 ) {
5151 return ;
5252 }
53- var match = / ^ ( (?: \d + ) ? \- ? \d ? \. ? \d + ) * ( m i l l i s e c o n d s ? | m s e c s ? | m s | s e c o n d s ? | s e c s ? | s | m i n u t e s ? | m i n s ? | m | h o u r s ? | h r s ? | h | d a y s ? | d | w e e k s ? | w | y e a r s ? | y r s ? | y ) ? $ / i. exec (
53+ var match = / ^ ( (?: \d + ) ? - ? (?: \d + ) ? \. ? \d + ) * ( m i l l i s e c o n d s ? | m s e c s ? | m s | s e c o n d s ? | s e c s ? | s | m i n u t e s ? | m i n s ? | m | h o u r s ? | h r s ? | h | d a y s ? | d | w e e k s ? | w | y e a r s ? | y r s ? | y ) ? $ / i. exec (
5454 str
5555 ) ;
5656 if ( ! match ) {
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ describe('ms(string)', function() {
7171
7272 it ( 'should work with negative decimals' , function ( ) {
7373 expect ( ms ( '-1.5h' ) ) . to . be ( - 5400000 ) ;
74+ expect ( ms ( '-10.5h' ) ) . to . be ( - 37800000 ) ;
7475 } ) ;
7576
7677 it ( 'should work with negative decimals starting with "."' , function ( ) {
You can’t perform that action at this time.
0 commit comments