Hierarchy

  • UpDateTimeMainEditControl
    • Date

Accessors

  • get required(): boolean
  • Gets the control's required state.

    Returns boolean

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    console.log(ctrl.required);
  • set required(value): void
  • Sets the control's required state

    Parameters

    • value: boolean

    Returns void

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    ctrl.required = false;

Methods

  • Checks if the value matches the format and is in range of values.

    Returns Promise<ValidationInfo>

    Example

    const validityResult = await ix.api.dom.getControl("<GUID>").checkValidity();

    // example of `validityResult` - the entered value has wrong format
    ValidationInfo {
    valStatus: false,
    valMessage: 'Entry does not correspond to required format. Format: dd.MM.yyyy',
    valType: 'pattern'
    }
  • Closes the picker.

    Returns void

  • Get the current value of the control or given value as JavaScript date object.

    Parameters

    • Optional value: string

    Returns undefined | Date

    Example

    ix.api.dom.getControl("<GUID>").getDateObject("22.02.2022");

    // Returns a date object:
    `Tue Feb 22 2022 00:00:00 GMT+0100 (Central European Standard Time)`
  • Retrieves the current value of the control.

    This method returns the current value of the control as a string. If the control does not have a value, it returns an empty string.

    Returns string

    The current value of the control, or an empty string if no value is set.

    Example

    // Get the control by its element GUID and retrieve the value
    const value = ix.api.dom.getControl("<ELEMENT-GUID>").getValue();
    console.log(value); // Outputs the value to the console
  • Opens the picker.

    Returns void

  • Set value of the control.

    Parameters

    • val: Date
    • Optional settings: {
          triggerOnchange?: "disabled" | "strict" | "always";
      }
      • Optional triggerOnchange?: "disabled" | "strict" | "always"

    Returns void

    Deprecated

    Please use setValue instead!

  • Sets a value for the control.

    Parameters

    • value: string | Date

      The value must be either a string (in the same format the field is configured with) or an date object.
      NOTE: If the value dosen't match the field's format, no value will be set.

    • Optional settings: {
          triggerOnchange?: "disabled" | "strict" | "always";
      }
      • Optional triggerOnchange?: "disabled" | "strict" | "always"

    Returns void

  • Converts a JavaScript date object to a string like 22.02.2022.

    Parameters

    • date: Date

    Returns string

    Note

    The output depends on the field's format settings.

    Example

    // convert a given date object
    ix.api.dom.getControl("<GUID>").toLocalFormat(new Date(2022, 01, 22));

    // returns
    '22.02.2022'