npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-lightweight-datetime-ui

v1.0.9

Published

A highly customizable and beautiful date-time picker component for React

Readme

React Lightweight DateTime UI

A highly customizable and beautiful date-time picker component for React applications. This component provides a modern, wheel-based time picker with a calendar date picker, all with extensive customization options.

React Lightweight DateTime UI

Features

  • 🎨 Fully customizable colors - Customize every aspect of the component's appearance
  • 🕒 12/24 hour format support - Choose between 12-hour and 24-hour time formats
  • 🌐 Timezone support - Format dates with specific timezones
  • ⏱️ Configurable time step - Set custom minute/second increments
  • 📅 Date range restrictions - Disable past/future dates or set min/max date ranges
  • 📱 Responsive design - Works great on both desktop and mobile devices
  • 🔄 ISO string support - Get dates in ISO format for easy API integration
  • 🎡 Smooth wheel time picker - Intuitive and engaging time selection experience

Installation

npm install react-lightweight-datetime-picker
# or
yarn add react-lightweight-datetime-picker

Quick Start

import React, { useState } from "react";
import { DateTime } from "react-lightweight-datetime-picker";

function App() {
  const [selectedDate, setSelectedDate] = useState(null);

  return (
    <div className="App">
      <h1>Date Time Picker Example</h1>
      <DateTime
        value={selectedDate}
        onChange={(date) => setSelectedDate(date)}
        placeholder="Select date and time"
      />

      {selectedDate && <p>Selected: {selectedDate.toString()}</p>}
    </div>
  );
}

export default App;

Props

| Prop | Type | Default | Description | | --------------- | ------------------------------------------------------------------ | ------------------------ | ----------------------------------------- | | value | Date | null | null | The currently selected date and time | | onChange | (date: Date \| null, isoString?: string) => void | - | Callback when date/time changes | | placeholder | string | "Select date and time" | Placeholder text when no date is selected | | format | "12" | "24" | "12" | Time format (12 or 24 hour) | | showSeconds | boolean | false | Whether to show seconds in time picker | | timeStep | number | 1 | Step increment for minutes (1-60) | | colors | Partial<DateTimeColors> | {} | Custom color overrides | | size | "sm" | "md" | "lg" | "md" | Size of the date-time picker | | disabled | boolean | false | Whether the picker is disabled | | disablePast | boolean | false | Disable selecting dates in the past | | disableFuture | boolean | false | Disable selecting dates in the future | | minDate | Date | undefined | Minimum selectable date | | maxDate | Date | undefined | Maximum selectable date | | position | "bottom-start" | "bottom-end" | "top-start" | "top-end" | "bottom-start" | Position of the popup | | className | string | "" | Additional CSS class names | | returnISO | boolean | false | Return ISO string in onChange callback | | timezone | string | undefined | Timezone for ISO string formatting |

Color Customization

You can customize all colors by passing a colors prop:

<DateTime
  value={date}
  onChange={setDate}
  colors={{
    primary: "#3B82F6", // Main accent color
    primaryHover: "#2563EB", // Hover state for primary color
    selected: "#3B82F6", // Selected date background
    selectedText: "#FFFFFF", // Selected date text
    hover: "#EFF6FF", // Hover background
    hoverText: "#1E3A8A", // Hover text
    disabled: "#E5E7EB", // Disabled state background
    disabledText: "#9CA3AF", // Disabled state text
    border: "#D1D5DB", // Border color
    background: "#FFFFFF", // Background color
    text: "#1F2937", // Text color
  }}
/>

Advanced Usage

With ISO String Return

import React, { useState } from "react";
import { DateTime } from "react-lightweight-datetime-picker";

function ISOExample() {
  const [selectedDate, setSelectedDate] = useState(null);
  const [isoString, setIsoString] = useState("");

  const handleDateChange = (date, iso) => {
    setSelectedDate(date);
    setIsoString(iso);
  };

  return (
    <div>
      <DateTime
        value={selectedDate}
        onChange={handleDateChange}
        returnISO={true}
        timezone="UTC"
      />

      {isoString && <p>ISO String: {isoString}</p>}
    </div>
  );
}

With Date Range Restrictions

<DateTime
  value={date}
  onChange={setDate}
  disablePast={true}
  maxDate={new Date(2025, 11, 31)}
/>

Custom Time Step

<DateTime
  value={date}
  onChange={setDate}
  timeStep={15} // 15-minute increments
  showSeconds={true}
/>

TypeScript Support

This package includes TypeScript definitions. You can import types as follows:

import {
  DateTime,
  DateTimeColors,
  DateTimeProps,
} from "react-lightweight-date-time-ui";

Browser Support

The component is compatible with all modern browsers and IE11+ (with appropriate polyfills).

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT