Quintiq file version 2.0
#parent: #root
Method UISetLabelTimeUnitHorizon (
  Boolean isInit,
  String timeunitScrValue
) id:Method_DialogCreateEditPostponementSpecification_UISetLabelTimeUnitHorizon
{
  #keys: '[135040.0.274683431]'
  Body:
  [*
    // Set labels time unit for different time unit selected
    // ***timeunitScrValue has to be an argument because getting it inside this method directly causing error (via StringListHorizonTimeUnit.Text())
    data     := DataHolderDialogData.Data().WrappedInstance();
    
    //set horizon label
    horizonDataValue   := guard(data.HorizonTimeUnit(), Translations::MP_GlobalParameters_Day() ); //default is Day
    horizonScrValue    := guard( timeunitScrValue, "" );
    horizonValue := ifexpr( isInit,
                            horizonDataValue,
                            horizonScrValue );
    
    NumberPickerNrOfTimeUnit.Label( Translations::MP_Designer_Duration_with_time_unit( horizonValue ) );
  *]
}
