# Date Range Picker

![Date Range Picker for WireBootstrap](/files/-MLU9A90_7TBn8Q9T-BU)

[Date Range Picker](http://www.daterangepicker.com) can be attached to any webpage element to pop up one or two calendars for selecting dates, times, or predefined ranges like "Last 30 Days".

Date Range Picker for WireBootstrap brings Date Range Picker into the WireBootstrap framework providing a powerful way of filtering data by dates in applications developed with Bootstrap themes.

## Installation

The Date Range Picker for WireBootstrap library is located in `wire-daterangepicker.js`.  This and other other related files can be installed from the NPM package registry at`@wirebootstrap/wire-daterangepicker`.

```javascript
npm install @wirebootstrap/wire-daterangepicker
```

Date Range Picker for WireBootstrap will load `daterangepicker.js` from a [CDN](https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.js) if it's not found on the page. &#x20;

Date Range Picker for WireBootstrap will load `daterangepicker.min.css` from a [CDN](https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.css) if it not found on the page. &#x20;

### Moment.js

Date Range Picker has a dependency on [moment.js](https://momentjs.com).  If not found on the page, the component will load moment.js from a [CDN](https://cdn.jsdelivr.net/momentjs/latest/moment.min.js).

## Class

Date Range Picker for WireBootstrap extends the [wire.ui.component](https://docs.wirebootstrap.com/wirebootstrap/reference/wire.ui/wire.ui.component) class.  As such, it inherits all the base functionality of that class.

To create a new instance of the Date Range Picker for WireBootstrap component, use the `wire.daterangepicker` class.

```javascript
const myPicker = new wire.daterangepicker();
```

## Render

Render the component using an HTML `input` element.

{% tabs %}
{% tab title="JavaScript" %}

```html
<input id="date-range" class="form-control">
<script>
    new wire.daterangepicker().render("#date-range", {});
</script>
```

{% endtab %}

{% tab title="Web Components" %}

```html
<wire-daterangepicker wr-config="" css="form-control"></wire-daterangepicker>
```

{% endtab %}

{% tab title="React" %}

```html
<WireComponent component="wire.daterangepicker" config={}>
    <input id="date-range" class="form-control">
</WireComponent>
```

{% endtab %}

{% tab title="Vue" %}

```html
<input 
    wire-component="wire.daterangepicker" 
    v-wire-config="" 
    class="form-control">
```

{% endtab %}

{% tab title="Angular" %}

```html
<input 
    wire-component="wire.daterangepicker" 
    [config]="" 
    class="form-control">
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wirebootstrap.com/pro-pack/date-range-picker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
