MCPcopy Index your code
hub / github.com/csev/py4e / cloneWithOffset

Function cloneWithOffset

code/gmane/Chart.bundle.js:3119–3131  ·  view source on GitHub ↗
(input, model)

Source from the content-addressed store, hash-verified

3117
3118 // Return a moment from input, that is local/utc/zone equivalent to model.
3119 function cloneWithOffset(input, model) {
3120 var res, diff;
3121 if (model._isUTC) {
3122 res = model.clone();
3123 diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);
3124 // Use low-level api, because this fn is low-level api.
3125 res._d.setTime(+res._d + diff);
3126 utils_hooks__hooks.updateOffset(res, false);
3127 return res;
3128 } else {
3129 return local__createLocal(input).local();
3130 }
3131 }
3132
3133 function getDateOffset (m) {
3134 // On Firefox.24 Date#getTimezoneOffset returns a floating point.

Callers 3

momentsDifferenceFunction · 0.85
diffFunction · 0.85

Calls 4

isMomentFunction · 0.85
isDateFunction · 0.85
local__createLocalFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected