Socket
Book a DemoInstallSign in
Socket

@wedgekit/date-picker

Package Overview
Dependencies
Maintainers
15
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wedgekit/date-picker

## Description

latest
npmnpm
Version
3.3.0
Version published
Maintainers
15
Created
Source

@wedgekit/date-picker

Description

@wedgekit/date-picker provides a calendar and a context provider for coordinating date/time fields when picking dates.

Examples

Single Date

import { DateTimePicker, Date, Time } from '@wedgekit/date-picker';

const Example = () => {
  const [value, setValue] = React.useState('');

  return (
    <DateTimePicker value={value} onChange={setValue}>
      <Date label="Date" />
      <Time label="Time" />
    </DateTimePicker>
  );
};

render(<Example />);

Range

import { DateTimePicker, Date, Time } from '@wedgekit/date-picker';

const Example = () => {
  const [value, setValue] = React.useState([]);

  return (
    <DateTimePicker range value={value} onChange={setValue}>
      <Date label="Start" position="start" />
      <Time label="Time Start" labelHidden position="start" />
      <Date label="End" position="end" />
      <Time label="Time End" labelHidden position="end" />
    </DateTimePicker>
  );
};

render(<Example />);

Props

range

Indicates if the DatePicker value is a range of dates.

Type: boolean

Required: ✅

value

The date value. If range is true it will be a tuple; otherwise it is a single date.

Type: ISO8601String | [ISO8601String, ISO8601String]

Required: ✅

onChange

Callback for when the value changes. If range is true it takes a tuple; otherwise takes a single date.

Required: ✅

Type: (ISO8601String | [ISO8601String, ISO8601String]) => void

timezone

Timezone the value should be displayed in. This will default to the browser's timezone.

Required: ❌

Type: IANA Timezone Name

Further Reading

Documentation for more specialized use cases can be found here

FAQs

Package last updated on 12 May 2023

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