PHPackages                             marekpetras/daterangepicker - 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. marekpetras/daterangepicker

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

marekpetras/daterangepicker
===========================

Bootstrap Date Range Picker widget for Yii 2 Framework

0295HTML

Since Aug 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/marekpetras/daterangepicker)[ Packagist](https://packagist.org/packages/marekpetras/daterangepicker)[ RSS](/packages/marekpetras-daterangepicker/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

About
=====

[](#about)

Forked from outdated

Bootstrap Date Range Picker widget for Yii 2 Framework

It is actually a Yii 2 wrapper for famous  extension.

This widget uses 3.0 Bootstrap CSS since Bootstrap 3.0 is included to Yii 2 as extension.

To learn more details about options JS please visit read ://github.com/dangrossman/bootstrap-daterangepicker documentation.

Usage Example
=============

[](#usage-example)

```
// You can just use the defaults and only run the widget
echo marekpetras\daterangepicker\DateRangePicker::widget();

// this will render the date range picker with defaults (see code) and two hidden html inputs which are updated on change and then submitted with the form

// or specify more options
use marekpetras\daterangepicker\DateRangePicker as DateRangePicker;
// Include namespace

// Define  ranges correctly
$ranges = new \yii\web\JsExpression("{
                    'Today'        : [Date.today(), Date.today()],
                    'Yesterday'    : [Date.today().add({ days: -1 }), Date.today().add({ days: -1 })],
                    'Last 7 Days'  : [Date.today().add({ days: -6 }), Date.today()],
                    'Last 30 Days' : [Date.today().add({ days: -29 }), Date.today()],
                    'This Month'   : [Date.today().moveToFirstDayOfMonth(), Date.today().moveToLastDayOfMonth()],
                    'This Year'    : [Date.today().moveToMonth(0,-1).moveToFirstDayOfMonth(), Date.today()],
                    'Last Month'   : [Date.today().moveToFirstDayOfMonth().add({ months: -1 }), Date.today().moveToFirstDayOfMonth().add({ days: -1 })]
                }");

// Define empty callback fust for fun
$callback = new \yii\web\JsExpression("function(){}");

// Provide required parameters and render the widget
  echo DateRangePicker::widget([
        'callback' => $callback,
        'options'  => [
           'ranges' => $ranges,
           'locale' => [
            'firstDay' => 1
           ]
        ],
        'htmlOptions' => [
        'name'        => 'daterange',
        'class'       => 'form-control',
        'placeholder' => 'Select Date Range',
        'style'       => 'width:190px;',
        ]
    ]);

```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/51d0477d95b89a51dbf452b3356561cbcdf127ffca1fcdf80109da35421e0d3e?d=identicon)[marekpetras](/maintainers/marekpetras)

---

Top Contributors

[![bburim](https://avatars.githubusercontent.com/u/3586848?v=4)](https://github.com/bburim "bburim (4 commits)")[![marekpetras](https://avatars.githubusercontent.com/u/8991813?v=4)](https://github.com/marekpetras "marekpetras (4 commits)")

### Embed Badge

![Health badge](/badges/marekpetras-daterangepicker/health.svg)

```
[![Health](https://phpackages.com/badges/marekpetras-daterangepicker/health.svg)](https://phpackages.com/packages/marekpetras-daterangepicker)
```

PHPackages © 2026

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