# NPM
npm i shopify-polaris-datetime-picker
# Yarn
yarn add shopify-polaris-datetime-picker
- 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} />
);
};
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 | () => {} |