java.lang.Object
de.agilecoders.wicket.jquery.CombinableConfig
de.agilecoders.wicket.jquery.AbstractConfig
de.agilecoders.wicket.extensions.markup.html.bootstrap.form.tempusdominus.TempusDominusConfig
All Implemented Interfaces:
de.agilecoders.wicket.jquery.Config, Serializable, IClusterable

public class TempusDominusConfig extends de.agilecoders.wicket.jquery.AbstractConfig
Config of datetime picker plugin.
See Also:
  • Constructor Details

    • TempusDominusConfig

      public TempusDominusConfig()
      Construct config
  • Method Details

    • withClass

      public <T extends Temporal> TempusDominusConfig withClass(Class<T> clazz)
      Will add restrictions based on class Date/LocalDate/LocalTime/LocalDateTime etc.
      Parameters:
      clazz - Class of DateTime object to set restrictions
      Returns:
      current instance
    • withAllowInputToggle

      public TempusDominusConfig withAllowInputToggle(boolean allow)
      Parameters:
      allow - If true, the picker will show on textbox focus.
      Returns:
      current instance
    • withContainer

      public TempusDominusConfig withContainer(String container)
      Parameters:
      container - Change the target container to use for the widget instead of body (In case of application using shadow DOM for example).
      Returns:
      current instance
    • withDateRange

      public TempusDominusConfig withDateRange(boolean dateRange)
      Parameters:
      dateRange - Date Range work similar to multi date. You should also set multiDateSeparator with what you want the two values to be separated with. This option allows the user to select two dates and highlights all the dates in range between. Validation still takes place. The range will be consider invalid if any of the dates in the range are disabled.
      Returns:
      current instance
    • withDefaultDate

      public <T extends Temporal> TempusDominusConfig withDefaultDate(T defDate)
      Parameters:
      defDate - Sets the picker default date/time. Overrides useCurrent
      Returns:
      current instance
    • withDefaultDate

      public TempusDominusConfig withDefaultDate(Date defDate)
      Parameters:
      defDate - Sets the picker default date/time. Overrides useCurrent
      Returns:
      current instance
    • withDisplay

      public TempusDominusConfig withDisplay(Consumer<TempusDominusDisplayConfig> cfgUpdater)
      Parameters:
      cfgUpdater - Consumer accepting TempusDominusDisplayConfig so it can be updated: The display options allow you to control much of the picker's look and feel. You can disable components, buttons and change the default icons.
      Returns:
      current instance
    • withIcons

      public TempusDominusConfig withIcons(Consumer<TempusDominusIconConfig> cfgUpdater)
      Shortcut for Display -> Icons
      Parameters:
      cfgUpdater - Consumer accepting TempusDominusIconConfig so it can be updated: The display options allow you to control much of the picker's look and feel. You can disable components, buttons and change the default icons.
      Returns:
      current instance
    • withKeepInvalid

      public TempusDominusConfig withKeepInvalid(boolean keep)
      Parameters:
      keep - Allows for the user to select a date that is invalid according to the rules.
      Returns:
      current instance
    • withLocalization

      public TempusDominusConfig withLocalization(Consumer<TempusDominusLocalizationConfig> cfgUpdater)
      Parameters:
      cfgUpdater - Consumer accepting TempusDominusDisplayConfig so it can be updated: Most of the localization options are for title tooltips over icons.
      Returns:
      current instance
    • withMeta

      public TempusDominusConfig withMeta(Map<String,Object> map)
      Parameters:
      map - This property is to provide developers a place to store extra information about the picker.
      Returns:
      current instance
    • withMultipleDates

      public TempusDominusConfig withMultipleDates(boolean multiple)
      Parameters:
      multiple - Allows multiple dates to be selected.
      Returns:
      current instance
    • withMultipleDatesSeparator

      public TempusDominusConfig withMultipleDatesSeparator(String separator)
      Parameters:
      separator - When multipleDates is enabled, this value wil be used to separate the selected dates.
      Returns:
      current instance
    • withPromptTimeOnDateChange

      public TempusDominusConfig withPromptTimeOnDateChange(boolean prompt)
      Parameters:
      prompt - If enabled and any of the time components are enabled, when a user selects a date the picker will automatically display the clock view after `promptTimeOnDateChangeTransitionDelay`.
      Returns:
      current instance
    • withPromptTimeOnDateChangeTransitionDelay

      public TempusDominusConfig withPromptTimeOnDateChangeTransitionDelay(int delay)
      Parameters:
      delay - Used with promptTimeOnDateChange. The number of milliseconds before the picker will display the clock view.
      Returns:
      current instance
    • withRestrictions

      public TempusDominusConfig withRestrictions(Consumer<TempusDominusRestrictionsConfig> cfgUpdater)
      Parameters:
      cfgUpdater - Consumer accepting TempusDominusDisplayConfig so it can be updated: Restrictions allow you to prevent users from selected dates or times based on a set of rules.
      Returns:
      current instance
    • withStepping

      public TempusDominusConfig withStepping(int step)
      Parameters:
      step - Controls how much the minutes are changed by. This also changes the minute selection grid to step by this amount.
      Returns:
      current instance
    • withUseCurrent

      public TempusDominusConfig withUseCurrent(boolean use)
      Parameters:
      use - Determines if the current date/time should be used as the default value when the picker is opened.
      Returns:
      current instance
    • withViewDate

      public <T extends Temporal> TempusDominusConfig withViewDate(T date)
      Parameters:
      date - Set the view date of the picker. Setting this will not change the selected date(s).
      Returns:
      current instance
    • withViewDate

      public TempusDominusConfig withViewDate(Date date)
      Parameters:
      date - Set the view date of the picker. Setting this will not change the selected date(s).
      Returns:
      current instance
    • getFormat

      @Deprecated(since="7.0.7", forRemoval=true) public String getFormat()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method was initially designed to return Java-based Date format But it has the same name as "localisation->format"

      Please use getJavaFormat() instead.

      Returns:
      Date format pattern set for Java-based formatters
    • getJavaFormat

      public String getJavaFormat()
      Returns:
      Date format pattern set for Java-based formatters
    • getLocale

      public Locale getLocale()
      Returns:
      Date format pattern set for TempusDominusLocalizationConfig.getFormat()
    • formatDateISO

      public static <U> String formatDateISO(U date)