Class DateRangeInputBuilder


public class DateRangeInputBuilder extends AbstractInputBuilder<DateRangeInputBuilder,String[]>
Builder class for input type DateRangeUserEntry InputType.DATERANGEUSERENTRY.
  • Constructor Details

  • Method Details

    • setFrom

      public DateRangeInputBuilder setFrom(String from)
      Sets the from value of the date range input field.

      Minimum date to be selected from the DateRangeUserEntry dropdown

      Accepts only Strings in format 'YYYY-MM-DD', if other provided InputBuilderExceptions.InvalidDateException is thrown.

      If date from value is after to the InputBuilderExceptions.InvalidDateException is thrown

      Example:

      
       api.inputBuilderFactory()
            .createDateRangeUserEntry('dateRange')
            .setFrom('2019-10-01')  // date before 2019-10-01 will not be available to select
            .setTo('2019-11-01')    // date after 2019-11-01 will not be available to select
            .buildContextParameter()
       
      Parameters:
      from - Date from / minimum, as a String
      Returns:
      DateRangeInputBuilder with the updated PriceFxInterface.FIELD_CONTEXTPARAM_CONFIG_FROM
      See Also:
    • setTo

      public DateRangeInputBuilder setTo(String to)
      Set to value of the date range input field.

      Maximum date to be selected from the DateRangeUserEntry dropdown.

      Accepts only Strings in format 'YYYY-MM-DD', if other provided InputBuilderExceptions.InvalidDateException is thrown.

      If date to value is before from the InputBuilderExceptions.InvalidDateException is thrown

      Example:

      
       api.inputBuilderFactory()
            .createDateRangeUserEntry('dateRange')
            .setFrom('2019-10-01')  // date before 2019-10-01 will not be available to select
            .setTo('2019-11-01')    // date after 2019-11-01 will not be available to select
            .buildContextParameter()
       
      Parameters:
      to - Date to / maximum, as a String
      Returns:
      DateRangeInputBuilder with the updated PriceFxInterface.FIELD_CONTEXTPARAM_CONFIG_TO
      See Also:
    • setPickerFormat

      public DateRangeInputBuilder setPickerFormat(DateRangeInputBuilder.Period period)
      Sets the date picker format with predefined value
      NOTE:
      - DateRangeInputBuilder.Period import is needed to properly recognise the enum value as the method's argument
      - if null is passed, the period is not configured and will not work.

      Example:
      
       import net.pricefx.formulaengine.scripting.inputbuilder.DateRangeInputBuilder.Period
      
       if (api.isInputGenerationExecution()) {
        return api.inputBuilderFactory()
            .createDateRangeUserEntry('dateRangePicker')
            .setPickerFormat(Period.MONTH)
            .getInput()
       }
      
       return input.dateRangePicker
      
       
      Parameters:
      period - DateRangeInputBuilder.Period to be used in the picker, available values are:
      Returns:
      DateRangeInputBuilder with the updated PriceFxInterface.FIELD_CONTEXTPARAM_PICKER_PERIOD
      Since:
      14.0 - Caribou Lou
      See Also:
    • _getInput

      protected Object _getInput()
      Specified by:
      _getInput in class AbstractInputBuilder<DateRangeInputBuilder,String[]>