# Date Picker

## Introduction

We used [daterangepicker](http://www.daterangepicker.com/) a JavaScript component for choosing date ranges, dates and times.

<div align="left"><img src="/files/-LRm_kSqSKzyFNpGCe7e" alt=""></div>

## How to Setup

### **HTML Structure**

```markup
<input class="form-control" type="text" name="daterange" value="01/01/2018 - 01/15/2018" />
```

## Dependency

### CSS

```markup
<!-- Daterangepicker CSS -->
<link href="vendors/daterangepicker/daterangepicker.css" rel="stylesheet" type="text/css" />
```

### JS

```markup
<!-- Daterangepicker JavaScript -->
<script src="vendors/moment/min/moment.min.js"></script>
<script src="vendors/c/daterangepicker.js"></script>
<script src="dist/js/daterangepicker-data.js"></script>
```

### Initialize daterangepicker JS

```javascript
/* Date range with a callback*/
$('input[name="daterange"]').daterangepicker({
	opens: 'left',
	"cancelClass": "btn-secondary",
}, function(start, end, label) {
	console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
});
```


---

# 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://hencework.gitbook.io/pangong/forms/date-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.
