(input, model)
| 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. |
no test coverage detected