Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@commercetools-uikit/date-input
Advanced tools
The `DateInput` component allows the user to select a date. It formats the selected date depending on the users' locale.
The `DateInput` component allows the user to select a date. It formats the selected date depending on the users' locale.
yarn add @commercetools-uikit/date-input
npm --save install @commercetools-uikit/date-input
Additionally install the peer dependencies (if not present)
yarn add moment react react-intl
npm --save install moment react react-intl
import DateInput from '@commercetools-uikit/date-input';
const Example = () => (
<DateInput
placeholder="Select a date..."
value="2017-12-31"
onChange={() => {}}
/>
);
export default Example;
Props | Type | Required | Default | Description |
---|---|---|---|---|
horizontalConstraint | union Possible values: , 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto' | Horizontal size limit of the input field. | ||
value | string | ✅ | The selected date, must either be an empty string or a date formatted as "YYYY-MM-DD". | |
onChange | Function See signature. | Called when the date changes. Called with an event containing either an empty string (no value) or a string in this format: "YYYY-MM-DD". | ||
onFocus | FocusEventHandler | Called when the date input gains focus. | ||
onBlur | Function See signature. | Called when the date input loses focus. | ||
id | string | Used as the HTML id attribute. | ||
aria-invalid | boolean | Indicate if the value entered in the input is invalid. | ||
aria-errormessage | string | HTML ID of an element containing an error message related to the input. | ||
name | string | Used as the HTML name attribute. | ||
placeholder | string | Placeholder value to show in the input field | ||
isCondensed | boolean | Use this property to reduce the paddings of the component for a ui compact variant | ||
isDisabled | boolean | Disables the date picker | ||
isReadOnly | boolean | Disables the date picker menu and makes input field read-only | ||
hasError | boolean | Indicates the input field has an error | ||
hasWarning | boolean | Indicates the input field has a warning | ||
minValue | string | A minimum selectable date. Must either be an empty string or a date formatted as "YYYY-MM-DD". | ||
maxValue | string | A maximum selectable date. Must either be an empty string or a date formatted as "YYYY-MM-DD". |
onChange
(event: TCustomEvent) => void
onBlur
(event: TCustomEvent) => void
DateInput.isEmpty
Returns true
when the value is considered empty, which is when the value is an empty string.
DateInput.isEmpty(''); // -> true
DateInput.isEmpty('2018-09-20'); // -> false
FAQs
The `DateInput` component allows the user to select a date. It formats the selected date depending on the users' locale.
The npm package @commercetools-uikit/date-input receives a total of 3,009 weekly downloads. As such, @commercetools-uikit/date-input popularity was classified as popular.
We found that @commercetools-uikit/date-input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.