(input, model)
| 3258 | |
| 3259 | // Return a moment from input, that is local/utc/zone equivalent to model. |
| 3260 | function cloneWithOffset(input, model) { |
| 3261 | var res, diff; |
| 3262 | if (model._isUTC) { |
| 3263 | res = model.clone(); |
| 3264 | diff = |
| 3265 | (isMoment(input) || isDate(input) |
| 3266 | ? input.valueOf() |
| 3267 | : createLocal(input).valueOf()) - res.valueOf(); |
| 3268 | // Use low-level api, because this fn is low-level api. |
| 3269 | res._d.setTime(res._d.valueOf() + diff); |
| 3270 | hooks.updateOffset(res, false); |
| 3271 | return res; |
| 3272 | } else { |
| 3273 | return createLocal(input).local(); |
| 3274 | } |
| 3275 | } |
| 3276 | |
| 3277 | function getDateOffset(m) { |
| 3278 | // On Firefox.24 Date#getTimezoneOffset returns a floating point. |
no test coverage detected