convertDistanceToSchedule() {
    if (this.timeType !== TimeTypes.distance) {
      return this;
    }

    const currentTime = new Date();
    const scheduledTimeMills = currentTime.getTime() + this.totalMillisecondsShift;
    const scheduledTime = new Date(scheduledTimeMills);

    const scheduleArg = new TimeArg(this.langManager);
    scheduleArg.setTimeType(TimeTypes.schedule);
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getFullYear(), shiftType: ShiftTypes.years });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getMonth(), shiftType: ShiftTypes.months });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getDate(), shiftType: ShiftTypes.days });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getHours(), shiftType: ShiftTypes.hours });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getMinutes(), shiftType: ShiftTypes.minutes });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getSeconds(), shiftType: ShiftTypes.seconds });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getMilliseconds(), shiftType: ShiftTypes.milliseconds });

    return scheduleArg;
  }
/**
   * Create a new TimeArg of one-shot schedult type based on this distance-type argument.
   * @return {TimeArg} the new time argument of the one-shot schedule type
   */
Create a new TimeArg of one-shot schedult type based on this distance-type argument.
@return {TimeArg} the new time argument of the one-shot schedule type
Create a new TimeArg of one - shot schedult type based on this distance - type argument . @return { TimeArg } the new time argument of the one - shot schedule type
convertDistanceToSchedule() {
    if (this.timeType !== TimeTypes.distance) {
      return this;
    }
    const currentTime = new Date();
    const scheduledTimeMills = currentTime.getTime() + this.totalMillisecondsShift;
    const scheduledTime = new Date(scheduledTimeMills);
    const scheduleArg = new TimeArg(this.langManager);
    scheduleArg.setTimeType(TimeTypes.schedule);
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getFullYear(), shiftType: ShiftTypes.years });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getMonth(), shiftType: ShiftTypes.months });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getDate(), shiftType: ShiftTypes.days });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getHours(), shiftType: ShiftTypes.hours });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getMinutes(), shiftType: ShiftTypes.minutes });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getSeconds(), shiftType: ShiftTypes.seconds });
    scheduleArg.addParsedDefinition({ amount: scheduledTime.getMilliseconds(), shiftType: ShiftTypes.milliseconds });
    return scheduleArg;
  }
convertDistanceToSchedule ( ) { if ( this . timeType !== TimeTypes . distance ) { return this ; } const currentTime = new Date ( ) ; const scheduledTimeMills = currentTime . getTime ( ) + this . totalMillisecondsShift ; const scheduledTime = new Date ( scheduledTimeMills ) ; const scheduleArg = new TimeArg ( this . langManager ) ; scheduleArg . setTimeType ( TimeTypes . schedule ) ; scheduleArg . addParsedDefinition ( { amount : scheduledTime . getFullYear ( ) , shiftType : ShiftTypes . years } ) ; scheduleArg . addParsedDefinition ( { amount : scheduledTime . getMonth ( ) , shiftType : ShiftTypes . months } ) ; scheduleArg . addParsedDefinition ( { amount : scheduledTime . getDate ( ) , shiftType : ShiftTypes . days } ) ; scheduleArg . addParsedDefinition ( { amount : scheduledTime . getHours ( ) , shiftType : ShiftTypes . hours } ) ; scheduleArg . addParsedDefinition ( { amount : scheduledTime . getMinutes ( ) , shiftType : ShiftTypes . minutes } ) ; scheduleArg . addParsedDefinition ( { amount : scheduledTime . getSeconds ( ) , shiftType : ShiftTypes . seconds } ) ; scheduleArg . addParsedDefinition ( { amount : scheduledTime . getMilliseconds ( ) , shiftType : ShiftTypes . milliseconds } ) ; return scheduleArg ; }
Create a new TimeArg of one-shot schedult type based on this distance-type argument.
Create a new TimeArg of one - shot schedult type based on this distance - type argument .