🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@axa-fr/react-toolkit-form-input-date-phone

Package Overview
Dependencies
Maintainers
6
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axa-fr/react-toolkit-form-input-date-phone

---

latest
Source
npmnpm
Version
1.4.1
Version published
Maintainers
6
Created
Source

Form Input Date

Get started

npm i @axa-fr/react-toolkit-form-input-date-phone

First to use, you have to import the component.

import { DatePhone } from '@axa-fr/react-toolkit-form-input-date-phone';
import '@axa-fr/react-toolkit-form-input-date-phone/dist/phonedate.scss';

The component reuses the native date input :

npm install moment --save

Do not forget the right local when starting your application. By default, "create-react-app" excludes locals ​​for lightening the version of your final application. Adding it explicitly allows the local file to be present in the final application.

require('moment/locale/fr.js');
// in your start application file "index.js"

The date is a special component. It actually has 2 important props:

  • viewValue: The value of the text field which is a string
  • value: The value of the date in momentjs format

This allows you to have control of what happens and to respond to all use cases. If you are an individual, you can use the "viewValue" or "value" property. In any case if "viewValue" is not a valid date in the current language, the value of "value" returned will always be "null".

For more information about style component, you can see the Form Date Style on Toolkit-core

FAQs

Package last updated on 27 Oct 2021

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