shopify-polaris-datetime-picker
v0.1.1
Published
Datetime Picker React Component made with Shopify Polaris framework
Downloads
39
Maintainers
Readme
Shopify Polaris DateTime Picker
Installation
# NPM
npm i shopify-polaris-datetime-picker
# Yarn
yarn add shopify-polaris-datetime-picker
Usage
- Import the component
// es6
import DateTimePicker from "shopify-polaris-datetime-picker";
//es5
const DateTimePicker = require("shopify-polaris-datetime-picker");
- Use it
const SomeComponent = () => {
// ...
return (
// ...
<DateTimePicker {...props} />
);
};
Props
| Prop Name | Type | Description | Required | Default |
|--------------|----------|-----------------------------------------------------------------|----------|------------|
| initialValue | Number | UNIX timestamp in milliseconds | false | Date.now()
|
| dateLabel | String | Label of date input | false | "Date" |
| timeLabel | String | Label of time input | false | "Time" |
| onChange | Function | Called when datetime is changed Returns Date object of new datetime | false | () => {}
|