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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@atom-design-mog/datepicker

v1.0.2

Published

A versatile React Native DatePicker component supporting date, time, datetime, and range selection.

Readme

@atom-design-mog/datepicker

A powerful, flexible, and clean Date / Time / DateTime / Range Picker component for React Native. Built as part of the Atom Design System, with full support for both iOS and Android.

Supports:

  • Single Date
  • Time Picker
  • DateTime Picker (with Android fallback handling)
  • Date Range Selection

🚀 Installation

Install using npm:

npm install @atom-design-mog/datepicker

Or with yarn:

yarn add @atom-design-mog/datepicker

📦 Peer Dependency

This package requires the native datetime picker:

npm install @react-native-community/datetimepicker
# or
pnpm add @react-native-community/datetimepicker

📸 Features

  • 📅 Single date selection
  • 🕒 Time selection
  • 📆 DateTime picker (full on iOS, fallback flow on Android)
  • 🔁 Date range selection (start → end flow)
  • ⚙ Fully controlled component
  • 🚫 Disabled state support
  • 💬 Helper / hint text
  • 🧩 Clean Atom-style UI
  • 🗓 Auto formatting for date / time / datetime displays

🎨 Usage Example

import React, { useState } from 'react';
import { ScrollView, View } from 'react-native';
import DatePicker from '@atom-design-mog/datepicker';

export default function TestDatePickersScreen() {
  const [singleDate, setSingleDate] = useState(null);
  const [dateRange, setDateRange] = useState({ start: null, end: null });
  const [dateTime, setDateTime] = useState(null);
  const [time, setTime] = useState(null);

  return (
    <ScrollView style={{ flex: 1 }}>
      <View style={{ padding: 20, gap: 20 }}>
        <DatePicker
          label="Single Date Picker"
          placeholder="Select date"
          value={singleDate}
          onChange={setSingleDate}
          hint="MM/DD/YYYY"
        />

        <DatePicker
          type="range"
          label="Date Range Picker"
          placeholder="Select date range"
          value={dateRange}
          onChange={setDateRange}
          hint="MM/DD/YYYY – MM/DD/YYYY"
        />

        <DatePicker
          type="datetime"
          label="Date Time Picker"
          placeholder="Choose a date"
          value={dateTime}
          onChange={setDateTime}
        />

        <DatePicker
          type="time"
          label="Time Picker"
          placeholder="Select time"
          value={time}
          onChange={setTime}
        />

        <DatePicker
          label="Disabled Date Picker"
          placeholder="Select date"
          disabled
        />
      </View>
    </ScrollView>
  );
}

🔧 Props API

| Prop | Type | Default | Description | | --------------- | ------------------------------------------- | --------------- | ---------------------------------------------------- | | type | "date" \| "time" \| "datetime" \| "range" | "date" | Type of picker to open | | label | string | — | Top label above the input | | placeholder | string | "Select date" | Placeholder text | | value | varies | null | Selected value (Date, or {start, end} for range) | | onChange | (value) => void | — | Returns updated date/time/range | | disabled | boolean | false | Disables the picker | | hint | string | — | Displays helper text below | | ...props | props passed to DateTimePicker | — | Additional native picker props |


🧠 Component Behavior

  • Date (default): returns a single Date object.
  • Range: two-step selection (start → end). Returns { start: Date, end: Date }.
  • Time: returns a Date object representing the selected time.
  • DateTime:
    • iOS: opens full datetime picker.
    • Android: fallback two-step flow (date then time); component combines both into a single Date.

📄 Formatting

Displays are formatted using the locale en-US:

  • toLocaleDateString('en-US')
  • toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })
  • toLocaleString('en-US')

🎛 Styles Included

  • Bordered input field
  • Inline calendar / clock icon
  • Disabled UI styling
  • Label + hint text
  • Atom Design-based visual treatment

📝 Notes

  • Always provide date strings/objects in a consistent format when wiring to external systems.
  • For range mode, the component expects value to be an object: { start: Date|null, end: Date|null }.
  • On Android, the datetime type uses a two-step picker (date → time). The component merges both steps before calling onChange.
  • Ensure @react-native-community/datetimepicker is installed and properly linked in native projects.

👤 Author

Avi Gupta