0.1.1 • Published 1 year ago

shopify-polaris-datetime-picker v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Shopify Polaris DateTime Picker

npm.io

Installation

# NPM
npm i shopify-polaris-datetime-picker

# Yarn
yarn add shopify-polaris-datetime-picker

Usage

  1. Import the component
// es6
import DateTimePicker from "shopify-polaris-datetime-picker";

//es5
const DateTimePicker = require("shopify-polaris-datetime-picker");
  1. Use it
const SomeComponent = () => {
  // ...
  return (
    // ...
    <DateTimePicker {...props} />
  );
};

Props

Prop NameTypeDescriptionRequiredDefault
initialValueNumberUNIX timestamp in millisecondsfalseDate.now()
dateLabelStringLabel of date inputfalse"Date"
timeLabelStringLabel of time inputfalse"Time"
onChangeFunctionCalled when datetime is changed Returns Date object of new datetimefalse() => {}