@@ -387,8 +387,8 @@ function normalizeUnitWithLocalWeeks(unit) {
387
387
// single timestamp for all zones to make things a bit more predictable.
388
388
//
389
389
// This is safe for quickDT (used by local() and utc()) because we don't fill in
390
- // higher-order units from tsNow (as we do in fromObject, this requires that
391
- // offset is calculated from tsNow ).
390
+ // higher-order units from tsRef (as we do in fromObject, this requires that
391
+ // offset is calculated from tsRef ).
392
392
function guessOffsetForZone ( zone ) {
393
393
if ( ! zoneOffsetGuessCache [ zone ] ) {
394
394
if ( zoneOffsetTs === undefined ) {
@@ -768,12 +768,12 @@ export default class DateTime {
768
768
const normalized = normalizeObject ( obj , normalizeUnitWithLocalWeeks ) ;
769
769
const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues ( normalized , loc ) ;
770
770
771
- const tsNow = isUndefined ( opts . referenceDate )
772
- ? friendlyDateTime ( opts . referenceDate ) . toUnixInteger ( )
773
- : opts . referenceDate ,
771
+ const tsRef = isUndefined ( opts . referenceDate )
772
+ ? Settings . now ( )
773
+ : friendlyDateTime ( opts . referenceDate ) . toUnixInteger ( ) ,
774
774
offsetProvis = ! isUndefined ( opts . specificOffset )
775
775
? opts . specificOffset
776
- : zoneToUse . offset ( tsNow ) ,
776
+ : zoneToUse . offset ( tsRef ) ,
777
777
containsOrdinal = ! isUndefined ( normalized . ordinal ) ,
778
778
containsGregorYear = ! isUndefined ( normalized . year ) ,
779
779
containsGregorMD = ! isUndefined ( normalized . month ) || ! isUndefined ( normalized . day ) ,
@@ -801,7 +801,7 @@ export default class DateTime {
801
801
// configure ourselves to deal with gregorian dates or week stuff
802
802
let units ,
803
803
defaultValues ,
804
- objNow = tsToObj ( tsNow , offsetProvis ) ;
804
+ objNow = tsToObj ( tsRef , offsetProvis ) ;
805
805
if ( useWeekData ) {
806
806
units = orderedWeekUnits ;
807
807
defaultValues = defaultWeekUnitValues ;
0 commit comments