Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@commercetools-uikit/date-input

Package Overview
Dependencies
Maintainers
3
Versions
1082
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools-uikit/date-input

## Usage

  • 0.0.0-canary-2020620194052
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-66.74%
Maintainers
3
Weekly downloads
 
Created
Source

Dates: DateInput

Usage

import { DateInput } from '@commercetools-frontend/ui-kit';
Description

The DateInput component allows the user to select a date. It formats the selected date depending on the users' locale.

Usage
<DateInput
  placeholder="Select a date..."
  value="2017-12-31"
  onChange={() => {}}
/>
Properties
PropsTypeRequiredValuesDefaultDescription
horizontalConstraintobject-m, l, xl, scalescaleHorizontal size limit of the input field.
valuestring--The selected date, must either be an empty string or a date formatted as "YYYY-MM-DD".
onChangefunc--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".
onFocusfunc---Called when the date input gains focus.
onBlurfunc---Called when the date input loses focus.
idstring---Used as the HTML id attribute.
namestring---Used as the HTML name attribute.
placeholderstring---Placeholder value to show in the input field
isDisabledbool--falseDisables the date picker
isReadOnlybool--falseDisables the date picker menu and makes input field read-only
hasErrorbool---Indicates the input field has an error
hasWarningbool---Indicates the input field has a warning
minValuestring---A minimum selectable date. Must either be an empty string or a date formatted as "YYYY-MM-DD".
maxValuestring---A maximum selectable date. Must either be an empty string or a date formatted as "YYYY-MM-DD".

Static methods

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

Package last updated on 20 Jul 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc