View code
JavaScript
One input for dates, times, and ranges. Drop it into a webpage or use it with your favorite framework.
Choose how to load the picker. Each example uses the same JavaScript component and stylesheet.
<link rel="stylesheet" href="./daterangepicker.css">
<label for="dates">Report dates</label>
<input id="dates">
<script src="./daterangepicker.js"></script>
<script>
new DateRangePicker('#dates');
</script>
Local v4 files JavaScript ↓ ES module ↓ CSS ↓
These jsDelivr URLs pin both files to version 4.0.2. They become available when that version is published to npm.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/daterangepicker.css">
<label for="dates">Report dates</label>
<input id="dates">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/daterangepicker.js"></script>
<script>
new DateRangePicker('#dates');
</script>Open a running app and inspect the source for mounting the picker, reading its value, and cleaning up.
Try all five pickers below. Each input has its own selection and copyable setup code.
Keep existing jQuery pickers running and migrate one page at a time.