@jswork/react-ant-date-picker
v1.0.0
Published
React ant date picker.
Downloads
4
Readme
react-ant-date-picker
React ant date picker.
installation
npm install -S @jswork/react-ant-date-picker
properties
| Name | Type | Required | Default | Description | | --------- | ------ | -------- | ------------ | ------------------------------------- | | className | string | false | - | The extended className for component. | | value | string | false | - | The changed value. | | onChange | func | false | noop | The change handler. | | format | string | false | 'YYYY-MM-DD' | The datepicker format. |
usage
- import css
@import "~@jswork/react-ant-date-picker/dist/style.css";
// or use sass
@import "~@jswork/react-ant-date-picker/dist/style.scss";
// customize your styles:
$react-ant-date-picker-options: ()
- import js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactAntDatePicker from '@jswork/react-ant-date-picker';
import './assets/style.scss';
class App extends React.Component {
state = {
value: '2021-05-21 15:19:15'
};
render() {
return (
<ReactDemokit
className="p-3 app-container"
url="https://github.com/afeiship/react-ant-date-picker">
<ReactAntDatePicker
format="YYYY-MM-DD HH:mm:ss"
value={this.state.value}
onChange={(e) => {
console.log('event :=>', e.target.value);
}}
className="mb-5 has-text-white"
/>
<button className="button is-primary is-fullwidth">Start~</button>
</ReactDemokit>
);
}
}
ReactDOM.render(<App />, document.getElementById('app'));
documentation
- https://afeiship.github.io/react-ant-date-picker/
license
Code released under the MIT license.