Snapshot of dangrossman/daterangepicker: 11.0k★, JavaScript. JavaScript Date Range, Date and Time Picker Component
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
This date range picker component creates a dropdown menu from which a user can
select a range of dates. I created it while building the UI for Improvely,
which needed a way to select date ranges for reports.
Features include limiting the selectable date range, localizable strings and date formats,
a single date picker mode, a time picker, and predefined date ranges.
Browser setup
Copy daterangepicker.js and daterangepicker.css to your site.
Create the picker after its element mounts and call picker.remove() when it unmounts. In React, create it in useEffect and return the cleanup function. In Vue, use onMounted and onBeforeUnmount. In Angular, use ngAfterViewInit and ngOnDestroy. Importing the module is safe during server rendering. TypeScript declarations ship with the package. CommonJS callers can use require('daterangepicker'). Browser modules can import the standalone daterangepicker.mjs directly.
Use setStartDate, setEndDate and setRanges to update a mounted picker. Pass null to setRanges to remove the preset list. A second constructor call on the same element replaces the first picker. DateRangePicker.getInstance(element) returns its current instance.
Existing installations
Keep the application's existing jQuery and Moment script tags when replacing the picker file. The classic build registers $.fn.daterangepicker and the lowercase window.daterangepicker constructor. With Moment available, callbacks and date properties use genuine Moment objects with the application's locale and plugins. CommonJS also discovers installed legacy peers. Applications that use these libraries directly should declare them as their own dependencies.
For ES modules that keep jQuery or Moment private to the module, register the imported copies once before initializing legacy widgets:
import $ from 'jquery';
import moment from 'moment';
import DateRangePicker from 'daterangepicker';
DateRangePicker.installJQuery($, moment);
$('#dates').daterangepicker(options);
The plugin supports chaining, $.fn.daterangepicker.defaultOptions, .data('daterangepicker'), and namespaced events with the picker as the second argument. Native listeners receive the picker in event.detail. A committed input value dispatches a bubbling change event. Standalone date values support mutable date arithmetic, comparisons, cloning, formatting, and conversion to JavaScript dates with toDate().
Additional options and interactions
singleCalendar: true displays one calendar for selecting both ends of a range. Both time selectors remain available when time selection is enabled.
minSpan sets the minimum elapsed span in the same units as maxSpan. For example, { days: 2 } makes Wednesday the earliest end for a Monday start. Use compatible minimum and maximum spans. The configured maximum date and maximum span take precedence if the bounds conflict.
applyOnRangeClick: false lets the user adjust a preset before pressing Apply. Presets apply immediately by default. Date-only auto-apply mode always commits the preset.
selectStart.daterangepicker and selectEnd.daterangepicker expose in-progress calendar selections. calendarRendered.daterangepicker fires after both month grids have been drawn.
Press Down Arrow from the input to focus the calendar or preset list. Use the arrow keys to move between days and Enter or Space to select. Escape in the calendar cancels the edit.
Set options with HTML data attributes such as data-single-date-picker="true". JavaScript options override the attributes.
Development
Edit src/picker.js for picker behavior and src/dates.js for standalone date handling. Run npm ci, npm run build, and npm test to rebuild both distributions and exercise the browser and legacy interfaces.
Documentation website
Set the HTTP server's document root to website/ and open / to see the v4 documentation. The checked-in files serve directly without a build or redirect. The framework demos ship with local browser bundles. Their source and rebuild commands are in the examples guide.
Install the documentation build dependencies with npm ci and npm --prefix example/integrations ci. Run npm run docs:build to refresh the library files, demos and downloadable archive in website/. The build also exports the same layout to dist/docs/.
The public documentation is available at daterangepicker.com.
See It In a Live Application
License
The MIT License (MIT)
Copyright (c) 2012-2026 Dan Grossman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
TopGit's last sync did not record any GitHub topics for dangrossman/daterangepicker. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on dangrossman/daterangepicker?
The most recent commit recorded on dangrossman/daterangepicker was 13 days ago, based on the GitHub push timestamp. The repository has 3.2k forks — one of the better signals of community interest.
How many stars does dangrossman/daterangepicker have?
dangrossman/daterangepicker has 11.0k GitHub stars — refresh the page for the live number, or check github.com/dangrossman/daterangepicker. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is dangrossman/daterangepicker written in?
dangrossman/daterangepicker is written primarily in JavaScript. GitHub's language field is based on the largest share of bytes in the default branch.
Where can I see dangrossman/daterangepicker in action?
The project maintains a homepage at http://www.daterangepicker.com. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about dangrossman/daterangepicker?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/dangrossman/daterangepicker is the definitive source.
Read full README in the tab above.
Want a second opinion on daterangepicker?
Ask an AI that can read this page — one click and you get its take on daterangepicker.