PHPackages                             jeffwalsh/yii2-date-range - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jeffwalsh/yii2-date-range

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

jeffwalsh/yii2-date-range
=========================

An advanced Yii 2 date range picker input for based on bootstrap-daterangepicker plugin.

v1.6.9(8y ago)074BSD-3-ClauseJavaScript

Since Sep 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jeffwalsh/yii2-date-range)[ Packagist](https://packagist.org/packages/jeffwalsh/yii2-date-range)[ Docs](https://github.com/kartik-v/yii2-date-range)[ RSS](/packages/jeffwalsh-yii2-date-range/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (1)Versions (24)Used By (0)

yii2-date-range
===============

[](#yii2-date-range)

[![Latest Stable Version](https://camo.githubusercontent.com/5814577575a4bd09a3120d79364730778c8300527f6b62366125f3a059191033/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b617274696b2d762f796969322d646174652d72616e67652e737667)](https://packagist.org/packages/kartik-v/yii2-date-range)[![License](https://camo.githubusercontent.com/a708792de4d88ab7d9bd5838e7960fca2a082fa9459427d1a868e09ae80063b7/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d646174652d72616e67652f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-date-range)[![Total Downloads](https://camo.githubusercontent.com/845f63f123080e71842e311afcfe2a21cabcb02c6ea6456d49c4798ba0b419dc/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d646174652d72616e67652f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-date-range)[![Monthly Downloads](https://camo.githubusercontent.com/3ba2234b35a0eee43196bf656331a111ae090f8a5c5fb5c1255623e002bdc356/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d646174652d72616e67652f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-date-range)[![Daily Downloads](https://camo.githubusercontent.com/73ba325349c32bb1f11285a205d38cf5b23c9462aa914c0517881d6762649ea1/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d646174652d72616e67652f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-date-range)

An advanced date range picker input for Yii Framework 2 based on [dangrossman/bootstrap-daterangepicker plugin](https://github.com/dangrossman/bootstrap-daterangepicker). The date range picker widget is styled for Bootstrap 3.x and creates a dropdown menu from which a user can select a range of dates. If the plugin is invoked with no options, it will present two calendars to choose a start and end date from. Optionally, you can provide a list of date ranges the user can select from instead of choosing dates from the calendars. If attached to a text input, the selected dates will be inserted into the text box. Otherwise, you can provide a custom callback function to receive the selection.

Additional enhancements added for this widget (by Krajee):

- allows ability to work with Bootstrap input group addons and set the picker position to point at the input-group-addon icon.
- enhanced translation features using yii i18n message files.
- automatically convert format from PHP Date/time format to Moment.js Date/time format.
- automatically trigger change of base field to enforce Yii ActiveField validation
- ability to set the widget to display a preset dropdown of date options within a container (and hidden input).
- style the container options as per your need using templates
- automatically disable date-range based on disabled/readonly options.

### Demo

[](#demo)

You can see detailed [documentation](http://demos.krajee.com/date-range) on usage of the extension.

### Latest Release

[](#latest-release)

The latest version of the extension is release v1.6.6. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-date-range/blob/master/CHANGE.md) for details of various releases.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

> Note: Check the [composer.json](https://github.com/kartik-v/yii2-date-range/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

Either run

```
$ php composer.phar require kartik-v/yii2-date-range "dev-master"

```

or add

```
"kartik-v/yii2-date-range": "dev-master"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

### DateRangePicker

[](#daterangepicker)

```
use kartik\daterange\DateRangePicker;
echo DateRangePicker::widget([
    'model'=>$model,
    'attribute'=>'datetime_range',
    'convertFormat'=>true,
    'pluginOptions'=>[
        'timePicker'=>true,
        'timePickerIncrement'=>30,
        'locale'=>[
            'format'=>'Y-m-d h:i A'
        ]
    ]
]);
```

or using seperate min/max attributes on model

```
use kartik\daterange\DateRangePicker;
echo DateRangePicker::widget([
    'model'=>$model,
    'attribute'=>'datetime_range',
    'convertFormat'=>true,
    'startAttribute'=>'datetime_min',
    'endAttribute'=>'datetime_max',
    'pluginOptions'=>[
        'timePicker'=>true,
        'timePickerIncrement'=>30,
        'locale'=>[
            'format'=>'Y-m-d h:i A'
        ]
    ]
]);
```

License
-------

[](#license)

**yii2-date-range** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 69.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Recently: every ~159 days

Total

22

Last Release

3218d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b03119139788b9719eccc6c4364fe62ac64b91ffcfa5564bf52feda54171b9c8?d=identicon)[jeffwalsh](/maintainers/jeffwalsh)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (85 commits)")[![fedemotta](https://avatars.githubusercontent.com/u/250785?v=4)](https://github.com/fedemotta "fedemotta (7 commits)")[![ToRvaLDz](https://avatars.githubusercontent.com/u/1643636?v=4)](https://github.com/ToRvaLDz "ToRvaLDz (4 commits)")[![leandrogehlen](https://avatars.githubusercontent.com/u/1750751?v=4)](https://github.com/leandrogehlen "leandrogehlen (3 commits)")[![mikk150](https://avatars.githubusercontent.com/u/4953629?v=4)](https://github.com/mikk150 "mikk150 (3 commits)")[![tranch](https://avatars.githubusercontent.com/u/5999732?v=4)](https://github.com/tranch "tranch (2 commits)")[![andredp](https://avatars.githubusercontent.com/u/1479304?v=4)](https://github.com/andredp "andredp (2 commits)")[![Edofre](https://avatars.githubusercontent.com/u/710429?v=4)](https://github.com/Edofre "Edofre (2 commits)")[![githubjeka](https://avatars.githubusercontent.com/u/874234?v=4)](https://github.com/githubjeka "githubjeka (2 commits)")[![jeffwalsh](https://avatars.githubusercontent.com/u/8369508?v=4)](https://github.com/jeffwalsh "jeffwalsh (2 commits)")[![gvasilopulos](https://avatars.githubusercontent.com/u/7271039?v=4)](https://github.com/gvasilopulos "gvasilopulos (1 commits)")[![kksudo](https://avatars.githubusercontent.com/u/8701324?v=4)](https://github.com/kksudo "kksudo (1 commits)")[![gitnchez](https://avatars.githubusercontent.com/u/169731?v=4)](https://github.com/gitnchez "gitnchez (1 commits)")[![ljames604](https://avatars.githubusercontent.com/u/13054155?v=4)](https://github.com/ljames604 "ljames604 (1 commits)")[![madand](https://avatars.githubusercontent.com/u/2280844?v=4)](https://github.com/madand "madand (1 commits)")[![ekawalec](https://avatars.githubusercontent.com/u/9531269?v=4)](https://github.com/ekawalec "ekawalec (1 commits)")[![pc-brainy](https://avatars.githubusercontent.com/u/13269904?v=4)](https://github.com/pc-brainy "pc-brainy (1 commits)")[![samkoch](https://avatars.githubusercontent.com/u/5182129?v=4)](https://github.com/samkoch "samkoch (1 commits)")[![tibee](https://avatars.githubusercontent.com/u/3636947?v=4)](https://github.com/tibee "tibee (1 commits)")[![dogrocker](https://avatars.githubusercontent.com/u/8379027?v=4)](https://github.com/dogrocker "dogrocker (1 commits)")

---

Tags

timedateyii2extensionwidgetbootstraprangebootstrap 3date-range

### Embed Badge

![Health badge](/badges/jeffwalsh-yii2-date-range/health.svg)

```
[![Health](https://phpackages.com/badges/jeffwalsh-yii2-date-range/health.svg)](https://phpackages.com/packages/jeffwalsh-yii2-date-range)
```

###  Alternatives

[kartik-v/yii2-date-range

An advanced Yii 2 date range picker input for based on bootstrap-daterangepicker plugin.

894.4M42](/packages/kartik-v-yii2-date-range)[kartik-v/yii2-field-range

Easily manage Yii 2 ActiveField ranges (from/to) with Bootstrap 3 addons markup and more

232.1M26](/packages/kartik-v-yii2-field-range)[kartik-v/yii2-widget-timepicker

Enhanced Yii2 wrapper for the bootstrap timepicker plugin (sub repo split from yii2-widgets)

404.9M14](/packages/kartik-v-yii2-widget-timepicker)[kartik-v/yii2-sortable

Create sortable lists and grids using HTML5 drag and drop API for Yii 2.0.

433.8M13](/packages/kartik-v-yii2-sortable)[kartik-v/yii2-widget-datepicker

Enhanced Yii2 wrapper for the bootstrap datepicker plugin (sub repo split from yii2-widgets).

1097.0M60](/packages/kartik-v-yii2-widget-datepicker)[kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

29915.4k10](/packages/kartik-v-yii2-money)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
