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

Function cloneWithOffset

static/plugins/chart.js/Chart.bundle.js:17557–17569  ·  view source on GitHub ↗
(input, model)

Source from the content-addressed store, hash-verified

17555
17556 // Return a moment from input, that is local/utc/zone equivalent to model.
17557 function cloneWithOffset(input, model) {
17558 var res, diff;
17559 if (model._isUTC) {
17560 res = model.clone();
17561 diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
17562 // Use low-level api, because this fn is low-level api.
17563 res._d.setTime(res._d.valueOf() + diff);
17564 hooks.updateOffset(res, false);
17565 return res;
17566 } else {
17567 return createLocal(input).local();
17568 }
17569 }
17570
17571 function getDateOffset (m) {
17572 // On Firefox.24 Date#getTimezoneOffset returns a floating point.

Callers 3

momentsDifferenceFunction · 0.85
calendar$1Function · 0.85
diffFunction · 0.85

Calls 3

isMomentFunction · 0.85
createLocalFunction · 0.85
isDateFunction · 0.70

Tested by

no test coverage detected