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) {
50
50
if ( str . length > 100 ) {
51
51
return ;
52
52
}
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 (
54
54
str
55
55
) ;
56
56
if ( ! match ) {
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ describe('ms(string)', function() {
71
71
72
72
it ( 'should work with negative decimals' , function ( ) {
73
73
expect ( ms ( '-1.5h' ) ) . to . be ( - 5400000 ) ;
74
+ expect ( ms ( '-10.5h' ) ) . to . be ( - 37800000 ) ;
74
75
} ) ;
75
76
76
77
it ( 'should work with negative decimals starting with "."' , function ( ) {
You can’t perform that action at this time.
0 commit comments