src/datetime.js
function adjustTime(inst, dur) {
  const oPre = inst.o,
    year = inst.c.year + dur.years,
    month = inst.c.month + dur.months + dur.quarters * 3,
    c = Object.assign({}, inst.c, {
      year,
      month,
      day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
    }),
    millisToAdd = Duration.fromObject({
      hours: dur.hours,
      minutes: dur.minutes,
      seconds: dur.seconds,
      milliseconds: dur.milliseconds
    }).as("milliseconds"),
    localTS = objToLocalTS(c);

  let [ts, o] = fixOffset(localTS, oPre, inst.zone);

  if (millisToAdd !== 0) {
    ts += millisToAdd;
    // that could have changed the offset by going over a DST, but we want to keep the ts the same
    o = inst.zone.offset(ts);
  }

  return { ts, o };
}
function adjustTime(inst, dur) {
  const oPre = inst.o,
    year = inst.c.year + dur.years,
    month = inst.c.month + dur.months + dur.quarters * 3,
    c = Object.assign({}, inst.c, {
      year,
      month,
      day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
    }),
    millisToAdd = Duration.fromObject({
      hours: dur.hours,
      minutes: dur.minutes,
      seconds: dur.seconds,
      milliseconds: dur.milliseconds
    }).as("milliseconds"),
    localTS = objToLocalTS(c);

  let [ts, o] = fixOffset(localTS, oPre, inst.zone);

  if (millisToAdd !== 0) {
    ts += millisToAdd;
    // that could have changed the offset by going over a DST, but we want to keep the ts the same
    o = inst.zone.offset(ts);
  }

  return { ts, o };
}
function adjustTime ( inst , dur ) { const oPre = inst . o , year = inst . c . year + dur . years , month = inst . c . month + dur . months + dur . quarters * 3 , c = Object . assign ( { } , inst . c , { year , month , day : Math . min ( inst . c . day , daysInMonth ( year , month ) ) + dur . days + dur . weeks * 7 } ) , millisToAdd = Duration . fromObject ( { hours : dur . hours , minutes : dur . minutes , seconds : dur . seconds , milliseconds : dur . milliseconds } ) . as ( "milliseconds" ) , localTS = objToLocalTS ( c ) ; let [ ts , o ] = fixOffset ( localTS , oPre , inst . zone ) ; if ( millisToAdd !== 0 ) { ts += millisToAdd ; // that could have changed the offset by going over a DST, but we want to keep the ts the same o = inst . zone . offset ( ts ) ; } return { ts , o } ; }
create a new DT instance by adding a duration, adjusting for DSTs
create a new DT instance by adding a duration adjusting for DSTs