(matcher, string)
| 17538 | var chunkOffset = /([\+\-]|\d\d)/gi; |
| 17539 | |
| 17540 | function offsetFromString(matcher, string) { |
| 17541 | var matches = (string || '').match(matcher); |
| 17542 | |
| 17543 | if (matches === null) { |
| 17544 | return null; |
| 17545 | } |
| 17546 | |
| 17547 | var chunk = matches[matches.length - 1] || []; |
| 17548 | var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; |
| 17549 | var minutes = +(parts[1] * 60) + toInt(parts[2]); |
| 17550 | |
| 17551 | return minutes === 0 ? |
| 17552 | 0 : |
| 17553 | parts[0] === '+' ? minutes : -minutes; |
| 17554 | } |
| 17555 | |
| 17556 | // Return a moment from input, that is local/utc/zone equivalent to model. |
| 17557 | function cloneWithOffset(input, model) { |
no test coverage detected