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

mui-date-time-range-picker

v0.8.0

Published

Free single-popover date range picker for MUI v5 and MUI X Date Pickers v6 (dayjs).

Readme

mui-date-time-range-picker

Free date range picker for MUI v5 and MUI X Date Pickers v6 (dayjs): one popover with one or two months, presets, keyboard-editable start/end inputs and optional time. Built only from free MIT components (DateCalendar, PickersDay, DateField, TimeField).

It has no dependencies of its own. It uses your app's React, MUI, MUI X and dayjs, so it takes its look from your MUI theme.

Install

npm i mui-date-time-range-picker

Peer dependencies: react 17–18, @mui/material ^5.15, @mui/x-date-pickers ^6.19, dayjs ^1.11.

Usage

import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
import { DateTimeRangePicker, DateRangeValue } from 'mui-date-time-range-picker'

const [range, setRange] = useState<DateRangeValue>([null, null])

<LocalizationProvider adapterLocale="uk" dateAdapter={AdapterDayjs}>
  <DateTimeRangePicker value={range} onChange={setRange} presets={['this-week', 'last-7-days', 'this-month']} />
</LocalizationProvider>

The picker must be inside MUI's LocalizationProvider with AdapterDayjs. Import the dayjs locales you use (e.g. import 'dayjs/locale/uk').

Props

| Prop | Type | Default | | | --- | --- | --- | --- | | value | [Dayjs \| null, Dayjs \| null] | — | Required. | | onChange | (value) => void | — | Called on Apply, on a click outside with a complete range, and on Clear. | | minDate, maxDate | Dayjs | — | Days outside are disabled; presets are cut to these bounds. | | maxRange | { amount, unit: 'day' | 'week' | 'month' | 'year' } | — | Longest range. After the first click, later days further than this are disabled; the end input rejects them; longer presets keep their end and move their start. | | shouldDisableDate | (day, { rangeStart }) => boolean | — | Extra disabled days. rangeStart is the first picked day while the end is being chosen, otherwise null. | | selectionUnit | 'day' \| 'week' \| 'month' \| 'year' | 'day' | What one click picks. 'week': whole weeks (the hovered week row is highlighted; the start is the first day of its week, the end the last day of its week). 'month': a grid of months per year instead of days; inputs edit month and year (e.g. MM.YYYY). 'year': a grid of 12 years per page (e.g. 2016–2027) with arrows to switch pages; inputs edit the year only (YYYY). The month and year formats are derived from format. Typed dates and presets are widened to whole units. A week, month or year is disabled only when all its days are disabled by minDate/maxDate/maxRange/shouldDisableDate. onChange gets [first day, last day] of the units at the start of the day. | | withTime | boolean | false | Adds start/end time fields. Only with selectionUnit 'day'. | | ampm | boolean | false | 12-hour time. | | presets | (DateRangePresetKey \| DateRangePreset)[] | [] | Built-in keys and/or custom { key, label, getValue }, in display order. | | calendars | 1 \| 2 | 2 | Always 1 on small screens. | | showDaysOutsideCurrentMonth | boolean | true | | | placeholder | string | locale text | Button text when empty. | | clearable | boolean | true | | | buttonProps | ButtonProps | — | Passed to the trigger button. | | sx | SxProps<Theme> | — | Styles of the trigger button (margins, width, etc.). Applied after buttonProps.sx. | | locale | string | adapterLocale | dayjs locale for month names, week start and texts. | | format | string | locale L format | Date format of the button and inputs. | | localeText | partial texts | — | Overrides built-in texts, including fieldPlaceholders of the empty date/time inputs. | | icons | { calendar, expand, previous, next, separator } | Material icons | Any of them can be replaced with a ReactNode. |

Built-in preset keys: today, yesterday, this-week, last-week, last-7-days, last-30-days, this-month, last-month, this-year, last-year.

Texts

English and Ukrainian are built in and picked by locale; other locales fall back to English. Pass localeText for your own texts, for example from i18next:

<DateTimeRangePicker
  localeText={{ placeholder: t('select-period'), apply: t('ok'), presets: { today: t('today') } }}
  {...props}
/>

Empty date and time inputs show section placeholders from localeText.fieldPlaceholders: DD.MM.YYYY hh:mm in English, ДД.ММ.РРРР гг:хх in Ukrainian. year is cut to the digits of the format, so YY shows two letters:

<DateTimeRangePicker
  localeText={{ fieldPlaceholders: { day: 'TT', month: 'MM', year: 'JJJJ' } }}
  {...props}
/>

Week start

The picker (including selectionUnit="week") follows the locale's weekStart. To make weeks start on Monday in English too, set it in your app:

import updateLocale from 'dayjs/plugin/updateLocale'
dayjs.extend(updateLocale)
dayjs.updateLocale('en', { weekStart: 1 })

Development

npm i
npm run dev        # playground on http://localhost:5180
npm run typecheck
npm run build      # dist/ (ESM + CJS + types)