MCPcopy Index your code
hub / github.com/feiyu563/PrometheusAlert / offsetFromString

Function offsetFromString

static/plugins/chart.js/Chart.bundle.js:17540–17554  ·  view source on GitHub ↗
(matcher, string)

Source from the content-addressed store, hash-verified

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) {

Callers 3

Chart.bundle.jsFile · 0.85
getSetOffsetFunction · 0.85
setOffsetToParsedOffsetFunction · 0.85

Calls 1

toIntFunction · 0.85

Tested by

no test coverage detected