Matterway
    Preparing search index...

    Function dateField

    • Date field component for date input.

      Parameters

      • props: UiDateFieldProps

        Configuration object

        • name

          Name of the component

        • label

          Label text

        • type

          Type of the date field (date, datetime-local, month, time, week, multiple, range)

        • placeholder

          Placeholder text

        • defaultValue

          Default value for the date field

        • required

          If true, the field is required

        • disabled

          If true, the field is disabled

        • invalid

          If false/undefined the field is valid. If a string is provided, it will be used as the validation message

      Returns Element

      Basic usage with required props

      dateField({
      name: 'birthDate',
      label: 'Birth Date',
      type: 'date'
      });

      Usage with default value

      dateField({
      name: 'appointmentDate',
      label: 'Appointment Date',
      type: 'datetime-local',
      defaultValue: '2024-01-15T10:00',
      placeholder: 'Select appointment date and time',
      required: true,
      disabled: false
      });

      Usage with multiple date selection

      dateField({
      name: 'availableDates',
      label: 'Available Dates',
      type: 'multiple',
      defaultValue: ['2024-01-15', '2024-01-16'],
      placeholder: 'Select multiple dates'
      });

      Usage with date range selection

      dateField({
      name: 'vacationPeriod',
      label: 'Vacation Period',
      type: 'range',
      defaultValue: { from: '2024-01-15', to: '2024-01-20' },
      placeholder: 'Select date range'
      });