Skip to main content

Date Format

Returns a date in an ISO date format. Eg. converts return value 10/01/2020 to 2020-01-10.

Installation

Install

yarn add @iag/chroma-react-ui.components

Import

import { DateFormat } from '@iag/chroma-react-ui.components';

Accessibility

Accessibility Documentation(opens in new window)

Default

Error

Valid

Disabled

Properties

Name
Description
  • className
    stringAdditional CSS classes to be applied
  • disabled
    booleanSpecifies whether the input is disabled.
  • error
    booleanSpecifies whether an error state should be displayed.
  • id
    stringHTML id attribute for the component
  • name
    stringThe name attribute for the input element.
  • onChange*
    (event: ChangeEvent<HTMLInputElement>, isValidDate: string) => voidCallback function triggered when the input value changes. @param event - The change event of the input. @param isValidDate - The formatted and validated date string.
  • valid
    booleanSpecifies whether the input value is valid.
  • value*
    stringThe value of the input.