update 1.0.8.0

Commits for version update
This commit is contained in:
Manish Verma
2016-10-17 12:02:27 +05:30
parent dec927987b
commit 76e85db070
9674 changed files with 495757 additions and 58922 deletions

View File

@@ -0,0 +1,6 @@
bower_components
node_modules
npm-debug.log
*.sublime-workspace
*.sublime-project
*.sw[onp]

View File

@@ -0,0 +1,44 @@
# Date Range Picker for Bootstrap
![Improvely.com](http://i.imgur.com/LbAMf3D.png)
This date range picker component for Bootstrap creates a dropdown menu from which a user can
select a range of dates. I created it while building the UI for [Improvely](http://www.improvely.com),
which needed a way to select date ranges for reports.
Features include limiting the selectable date range, localizable strings and date formats,
a single date picker mode, optional time picker (for e.g. making appointments or reservations),
and styles that match the default Bootstrap 3 theme.
## [Documentation and Live Usage Examples](http://www.daterangepicker.com)
## [See It In a Live Application](https://awio.iljmp.com/5/drpdemogh)
## License
This code is made available under the same license as Bootstrap. Moment.js is included in this repository
for convenience. It is available under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
--
The MIT License (MIT)
Copyright (c) 2012-2016 Dan Grossman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,20 @@
{
"name": "bootstrap-daterangepicker",
"main": [
"daterangepicker.js",
"daterangepicker.css"
],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"moment.js",
"moment.min.js"
],
"dependencies": {
"jquery": "1.9.1 - 3",
"moment": ">=2.9.0"
}
}

View File

@@ -0,0 +1,269 @@
.daterangepicker {
position: fixed;
color: inherit;
background: #fff;
border-radius: 4px;
width: 278px;
padding: 4px;
margin-top: 1px;
top: 100px;
left: 20px;
/* Calendars */ }
.daterangepicker:before, .daterangepicker:after {
position: absolute;
display: inline-block;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: ''; }
.daterangepicker:before {
top: -7px;
border-right: 7px solid transparent;
border-left: 7px solid transparent;
border-bottom: 7px solid #ccc; }
.daterangepicker:after {
top: -6px;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent; }
.daterangepicker.opensleft:before {
right: 9px; }
.daterangepicker.opensleft:after {
right: 10px; }
.daterangepicker.openscenter:before {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto; }
.daterangepicker.openscenter:after {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto; }
.daterangepicker.opensright:before {
left: 9px; }
.daterangepicker.opensright:after {
left: 10px; }
.daterangepicker.dropup {
margin-top: -5px; }
.daterangepicker.dropup:before {
top: initial;
bottom: -7px;
border-bottom: initial;
border-top: 7px solid #ccc; }
.daterangepicker.dropup:after {
top: initial;
bottom: -6px;
border-bottom: initial;
border-top: 6px solid #fff; }
.daterangepicker.dropdown-menu {
max-width: none;
z-index: 3001; }
.daterangepicker.single .ranges, .daterangepicker.single .calendar {
float: none; }
.daterangepicker.show-calendar .calendar {
display: block; }
.daterangepicker .calendar {
display: none;
max-width: 270px;
margin: 4px; }
.daterangepicker .calendar.single .calendar-table {
border: none; }
.daterangepicker .calendar th, .daterangepicker .calendar td {
white-space: nowrap;
text-align: center;
min-width: 32px; }
.daterangepicker .calendar-table {
border: 1px solid #fff;
padding: 4px;
border-radius: 4px;
background: #fff; }
.daterangepicker table {
width: 100%;
margin: 0; }
.daterangepicker td, .daterangepicker th {
text-align: center;
width: 20px;
height: 20px;
border-radius: 4px;
border: 1px solid transparent;
white-space: nowrap;
cursor: pointer; }
.daterangepicker td.available:hover, .daterangepicker th.available:hover {
background-color: #eee;
border-color: transparent;
color: inherit; }
.daterangepicker td.week, .daterangepicker th.week {
font-size: 80%;
color: #ccc; }
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
background-color: #fff;
border-color: transparent;
color: #999; }
.daterangepicker td.in-range {
background-color: #ebf4f8;
border-color: transparent;
color: #000;
border-radius: 0; }
.daterangepicker td.start-date {
border-radius: 4px 0 0 4px; }
.daterangepicker td.end-date {
border-radius: 0 4px 4px 0; }
.daterangepicker td.start-date.end-date {
border-radius: 4px; }
.daterangepicker td.active, .daterangepicker td.active:hover {
background-color: #357ebd;
border-color: transparent;
color: #fff; }
.daterangepicker th.month {
width: auto; }
.daterangepicker td.disabled, .daterangepicker option.disabled {
color: #999;
cursor: not-allowed;
text-decoration: line-through; }
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
font-size: 12px;
padding: 1px;
height: auto;
margin: 0;
cursor: default; }
.daterangepicker select.monthselect {
margin-right: 2%;
width: 56%; }
.daterangepicker select.yearselect {
width: 40%; }
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
width: 50px;
margin-bottom: 0; }
.daterangepicker .input-mini {
border: 1px solid #ccc;
border-radius: 4px;
color: #555;
height: 30px;
line-height: 30px;
display: block;
vertical-align: middle;
margin: 0 0 5px 0;
padding: 0 6px 0 28px;
width: 100%; }
.daterangepicker .input-mini.active {
border: 1px solid #08c;
border-radius: 4px; }
.daterangepicker .daterangepicker_input {
position: relative; }
.daterangepicker .daterangepicker_input i {
position: absolute;
left: 8px;
top: 8px; }
.daterangepicker.rtl .input-mini {
padding-right: 28px;
padding-left: 6px; }
.daterangepicker.rtl .daterangepicker_input i {
left: auto;
right: 8px; }
.daterangepicker .calendar-time {
text-align: center;
margin: 5px auto;
line-height: 30px;
position: relative;
padding-left: 28px; }
.daterangepicker .calendar-time select.disabled {
color: #ccc;
cursor: not-allowed; }
.ranges {
font-size: 11px;
float: none;
margin: 4px;
text-align: left; }
.ranges ul {
list-style: none;
margin: 0 auto;
padding: 0;
width: 100%; }
.ranges li {
font-size: 13px;
background: #f5f5f5;
border: 1px solid #f5f5f5;
border-radius: 4px;
color: #08c;
padding: 3px 12px;
margin-bottom: 8px;
cursor: pointer; }
.ranges li:hover {
background: #08c;
border: 1px solid #08c;
color: #fff; }
.ranges li.active {
background: #08c;
border: 1px solid #08c;
color: #fff; }
/* Larger Screen Styling */
@media (min-width: 564px) {
.daterangepicker {
width: auto; }
.daterangepicker .ranges ul {
width: 160px; }
.daterangepicker.single .ranges ul {
width: 100%; }
.daterangepicker.single .calendar.left {
clear: none; }
.daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .calendar {
float: left; }
.daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .calendar {
float: right; }
.daterangepicker.ltr {
direction: ltr;
text-align: left; }
.daterangepicker.ltr .calendar.left {
clear: left;
margin-right: 0; }
.daterangepicker.ltr .calendar.left .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.daterangepicker.ltr .calendar.right {
margin-left: 0; }
.daterangepicker.ltr .calendar.right .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0; }
.daterangepicker.ltr .left .daterangepicker_input {
padding-right: 12px; }
.daterangepicker.ltr .calendar.left .calendar-table {
padding-right: 12px; }
.daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar {
float: left; }
.daterangepicker.rtl {
direction: rtl;
text-align: right; }
.daterangepicker.rtl .calendar.left {
clear: right;
margin-left: 0; }
.daterangepicker.rtl .calendar.left .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0; }
.daterangepicker.rtl .calendar.right {
margin-right: 0; }
.daterangepicker.rtl .calendar.right .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.daterangepicker.rtl .left .daterangepicker_input {
padding-left: 12px; }
.daterangepicker.rtl .calendar.left .calendar-table {
padding-left: 12px; }
.daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar {
text-align: right;
float: right; } }
@media (min-width: 730px) {
.daterangepicker .ranges {
width: auto; }
.daterangepicker.ltr .ranges {
float: left; }
.daterangepicker.rtl .ranges {
float: right; }
.daterangepicker .calendar.left {
clear: none !important; } }

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,611 @@
//
// A stylesheet for use with Bootstrap 3.x
// @author: Dan Grossman http://www.dangrossman.info/
// @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved.
// @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
// @website: https://www.improvely.com/
//
//
// VARIABLES
//
//
// Settings
// The class name to contain everything within.
$prefix-class: daterangepicker;
$arrow-size: 7px !default;
//
// Colors
$daterangepicker-color: inherit !default;
$daterangepicker-bg-color: #fff !default;
$daterangepicker-cell-color: $daterangepicker-color !default;
$daterangepicker-cell-border-color: transparent !default;
$daterangepicker-cell-bg-color: $daterangepicker-bg-color !default;
$daterangepicker-cell-hover-color: $daterangepicker-color !default;
$daterangepicker-cell-hover-border-color: $daterangepicker-cell-border-color !default;
$daterangepicker-cell-hover-bg-color: #eee !default;
$daterangepicker-in-range-color: #000 !default;
$daterangepicker-in-range-border-color: transparent !default;
$daterangepicker-in-range-bg-color: #ebf4f8 !default;
$daterangepicker-active-color: #fff !default;
$daterangepicker-active-bg-color: #357ebd !default;
$daterangepicker-active-border-color: transparent !default;
$daterangepicker-unselected-color: #999 !default;
$daterangepicker-unselected-border-color: transparent !default;
$daterangepicker-unselected-bg-color: #fff !default;
//
// daterangepicker
$daterangepicker-width: 278px !default;
$daterangepicker-padding: 4px !default;
$daterangepicker-z-index: 3000 !default;
$daterangepicker-border-size: 1px !default;
$daterangepicker-border-color: #ccc !default;
$daterangepicker-border-radius: 4px !default;
//
// Calendar
$daterangepicker-calendar-margin: $daterangepicker-padding !default;
$daterangepicker-calendar-bg-color: $daterangepicker-bg-color !default;
$daterangepicker-calendar-border-size: 1px !default;
$daterangepicker-calendar-border-color: $daterangepicker-bg-color !default;
$daterangepicker-calendar-border-radius: $daterangepicker-border-radius !default;
//
// Calendar Cells
$daterangepicker-cell-size: 20px !default;
$daterangepicker-cell-width: $daterangepicker-cell-size !default;
$daterangepicker-cell-height: $daterangepicker-cell-size !default;
$daterangepicker-cell-border-radius: $daterangepicker-calendar-border-radius !default;
$daterangepicker-cell-border-size: 1px !default;
//
// Dropdowns
$daterangepicker-dropdown-z-index: $daterangepicker-z-index + 1 !default;
//
// Controls
$daterangepicker-control-height: 30px !default;
$daterangepicker-control-line-height: $daterangepicker-control-height !default;
$daterangepicker-control-color: #555 !default;
$daterangepicker-control-border-size: 1px !default;
$daterangepicker-control-border-color: #ccc !default;
$daterangepicker-control-border-radius: 4px !default;
$daterangepicker-control-active-border-size: 1px !default;
$daterangepicker-control-active-border-color: #08c !default;
$daterangepicker-control-active-border-radius: $daterangepicker-control-border-radius !default;
$daterangepicker-control-disabled-color: #ccc !default;
//
// Ranges
$daterangepicker-ranges-color: #08c !default;
$daterangepicker-ranges-bg-color: #f5f5f5 !default;
$daterangepicker-ranges-border-size: 1px !default;
$daterangepicker-ranges-border-color: $daterangepicker-ranges-bg-color !default;
$daterangepicker-ranges-border-radius: $daterangepicker-border-radius !default;
$daterangepicker-ranges-hover-color: #fff !default;
$daterangepicker-ranges-hover-bg-color: $daterangepicker-ranges-color !default;
$daterangepicker-ranges-hover-border-size: $daterangepicker-ranges-border-size !default;
$daterangepicker-ranges-hover-border-color: $daterangepicker-ranges-hover-bg-color !default;
$daterangepicker-ranges-hover-border-radius: $daterangepicker-border-radius !default;
$daterangepicker-ranges-active-border-size: $daterangepicker-ranges-border-size !default;
$daterangepicker-ranges-active-border-color: $daterangepicker-ranges-bg-color !default;
$daterangepicker-ranges-active-border-radius: $daterangepicker-border-radius !default;
//
// STYLESHEETS
//
.#{$prefix-class} {
position: absolute;
color: $daterangepicker-color;
background: $daterangepicker-bg-color;
border-radius: $daterangepicker-border-radius;
width: $daterangepicker-width;
padding: $daterangepicker-padding;
margin-top: $daterangepicker-border-size;
// TODO: Should these be parameterized??
top: 100px;
left: 20px;
$arrow-prefix-size: $arrow-size;
$arrow-suffix-size: ($arrow-size - $daterangepicker-border-size);
&:before, &:after {
position: absolute;
display: inline-block;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
&:before {
top: -$arrow-prefix-size;
border-right: $arrow-prefix-size solid transparent;
border-left: $arrow-prefix-size solid transparent;
border-bottom: $arrow-prefix-size solid $daterangepicker-border-color;
}
&:after {
top: -$arrow-suffix-size;
border-right: $arrow-suffix-size solid transparent;
border-bottom: $arrow-suffix-size solid $daterangepicker-bg-color;
border-left: $arrow-suffix-size solid transparent;
}
&.opensleft {
&:before {
// TODO: Make this relative to prefix size.
right: $arrow-prefix-size + 2px;
}
&:after {
// TODO: Make this relative to suffix size.
right: $arrow-suffix-size + 4px;
}
}
&.openscenter {
&:before {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto;
}
&:after {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto;
}
}
&.opensright {
&:before {
// TODO: Make this relative to prefix size.
left: $arrow-prefix-size + 2px;
}
&:after {
// TODO: Make this relative to suffix size.
left: $arrow-suffix-size + 4px;
}
}
&.dropup {
margin-top: -5px;
// NOTE: Note sure why these are special-cased.
&:before {
top: initial;
bottom: -$arrow-prefix-size;
border-bottom: initial;
border-top: $arrow-prefix-size solid $daterangepicker-border-color;
}
&:after {
top: initial;
bottom:-$arrow-suffix-size;
border-bottom: initial;
border-top: $arrow-suffix-size solid $daterangepicker-bg-color;
}
}
&.dropdown-menu {
max-width: none;
z-index: $daterangepicker-dropdown-z-index;
}
&.single {
.ranges, .calendar {
float: none;
}
}
/* Calendars */
&.show-calendar {
.calendar {
display: block;
}
}
.calendar {
display: none;
max-width: $daterangepicker-width - ($daterangepicker-calendar-margin * 2);
margin: $daterangepicker-calendar-margin;
&.single {
.calendar-table {
border: none;
}
}
th, td {
white-space: nowrap;
text-align: center;
// TODO: Should this actually be hard-coded?
min-width: 32px;
}
}
.calendar-table {
border: $daterangepicker-calendar-border-size solid $daterangepicker-calendar-border-color;
padding: $daterangepicker-calendar-margin;
border-radius: $daterangepicker-calendar-border-radius;
background: $daterangepicker-calendar-bg-color;
}
table {
width: 100%;
margin: 0;
}
td, th {
text-align: center;
width: $daterangepicker-cell-width;
height: $daterangepicker-cell-height;
border-radius: $daterangepicker-cell-border-radius;
border: $daterangepicker-cell-border-size solid $daterangepicker-cell-border-color;
white-space: nowrap;
cursor: pointer;
&.available {
&:hover {
background-color: $daterangepicker-cell-hover-bg-color;
border-color: $daterangepicker-cell-hover-border-color;
color: $daterangepicker-cell-hover-color;
}
}
&.week {
font-size: 80%;
color: #ccc;
}
}
td {
&.off {
&, &.in-range, &.start-date, &.end-date {
background-color: $daterangepicker-unselected-bg-color;
border-color: $daterangepicker-unselected-border-color;
color: $daterangepicker-unselected-color;
}
}
//
// Date Range
&.in-range {
background-color: $daterangepicker-in-range-bg-color;
border-color: $daterangepicker-in-range-border-color;
color: $daterangepicker-in-range-color;
// TODO: Should this be static or should it be parameterized?
border-radius: 0;
}
&.start-date {
border-radius: $daterangepicker-cell-border-radius 0 0 $daterangepicker-cell-border-radius;
}
&.end-date {
border-radius: 0 $daterangepicker-cell-border-radius $daterangepicker-cell-border-radius 0;
}
&.start-date.end-date {
border-radius: $daterangepicker-cell-border-radius;
}
&.active {
&, &:hover {
background-color: $daterangepicker-active-bg-color;
border-color: $daterangepicker-active-border-color;
color: $daterangepicker-active-color;
}
}
}
th {
&.month {
width: auto;
}
}
//
// Disabled Controls
//
td, option {
&.disabled {
color: #999;
cursor: not-allowed;
text-decoration: line-through;
}
}
select {
&.monthselect, &.yearselect {
font-size: 12px;
padding: 1px;
height: auto;
margin: 0;
cursor: default;
}
&.monthselect {
margin-right: 2%;
width: 56%;
}
&.yearselect {
width: 40%;
}
&.hourselect, &.minuteselect, &.secondselect, &.ampmselect {
width: 50px;
margin-bottom: 0;
}
}
//
// Text Input Controls (above calendar)
//
.input-mini {
border: $daterangepicker-control-border-size solid $daterangepicker-control-border-color;
border-radius: $daterangepicker-control-border-radius;
color: $daterangepicker-control-color;
height: $daterangepicker-control-line-height;
line-height: $daterangepicker-control-height;
display: block;
vertical-align: middle;
// TODO: Should these all be static, too??
margin: 0 0 5px 0;
padding: 0 6px 0 28px;
width: 100%;
&.active {
border: $daterangepicker-control-active-border-size solid $daterangepicker-control-active-border-color;
border-radius: $daterangepicker-control-active-border-radius;
}
}
.daterangepicker_input {
position: relative;
i {
position: absolute;
// NOTE: These appear to be eyeballed to me...
left: 8px;
top: 8px;
}
}
&.rtl {
.input-mini {
padding-right: 28px;
padding-left: 6px;
}
.daterangepicker_input i {
left: auto;
right: 8px;
}
}
//
// Time Picker
//
.calendar-time {
text-align: center;
margin: 5px auto;
line-height: $daterangepicker-control-line-height;
position: relative;
padding-left: 28px;
select {
&.disabled {
color: $daterangepicker-control-disabled-color;
cursor: not-allowed;
}
}
}
}
//
// Predefined Ranges
//
.ranges {
font-size: 11px;
float: none;
margin: 4px;
text-align: left;
ul {
list-style: none;
margin: 0 auto;
padding: 0;
width: 100%;
}
li {
font-size: 13px;
background: $daterangepicker-ranges-bg-color;
border: $daterangepicker-ranges-border-size solid $daterangepicker-ranges-border-color;
border-radius: $daterangepicker-ranges-border-radius;
color: $daterangepicker-ranges-color;
padding: 3px 12px;
margin-bottom: 8px;
cursor: pointer;
&:hover {
background: $daterangepicker-ranges-hover-bg-color;
border: $daterangepicker-ranges-hover-border-size solid $daterangepicker-ranges-hover-border-color;
color: $daterangepicker-ranges-hover-color;
}
&.active {
background: $daterangepicker-ranges-hover-bg-color;
border: $daterangepicker-ranges-hover-border-size solid $daterangepicker-ranges-hover-border-color;
color: $daterangepicker-ranges-hover-color;
}
}
}
/* Larger Screen Styling */
@media (min-width: 564px) {
.#{$prefix-class} {
width: auto;
.ranges {
ul {
width: 160px;
}
}
&.single {
.ranges {
ul {
width: 100%;
}
}
.calendar.left {
clear: none;
}
&.ltr {
.ranges, .calendar {
float:left;
}
}
&.rtl {
.ranges, .calendar {
float:right;
}
}
}
&.ltr {
direction: ltr;
text-align: left;
.calendar{
&.left {
clear: left;
margin-right: 0;
.calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
&.right {
margin-left: 0;
.calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
}
.left .daterangepicker_input {
padding-right: 12px;
}
.calendar.left .calendar-table {
padding-right: 12px;
}
.ranges, .calendar {
float: left;
}
}
&.rtl {
direction: rtl;
text-align: right;
.calendar{
&.left {
clear: right;
margin-left: 0;
.calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
&.right {
margin-right: 0;
.calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
}
.left .daterangepicker_input {
padding-left: 12px;
}
.calendar.left .calendar-table {
padding-left: 12px;
}
.ranges, .calendar {
text-align: right;
float: right;
}
}
}
}
@media (min-width: 730px) {
.#{$prefix-class} {
.ranges {
width: auto;
}
&.ltr {
.ranges {
float: left;
}
}
&.rtl {
.ranges {
float: right;
}
}
.calendar.left {
clear: none !important;
}
}
}

View File

@@ -0,0 +1,369 @@
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="UTF-8" />
<title>A date range picker for Bootstrap</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="all" href="daterangepicker.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="moment.js"></script>
<script type="text/javascript" src="daterangepicker.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body style="margin: 60px 0">
<div class="container">
<h1 style="margin: 0 0 20px 0">Configuration Builder</h1>
<div class="well configurator">
<form>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="parentEl">parentEl</label>
<input type="text" class="form-control" id="parentEl" value="" placeholder="body">
</div>
<div class="form-group">
<label for="startDate">startDate</label>
<input type="text" class="form-control" id="startDate" value="07/01/2015">
</div>
<div class="form-group">
<label for="endDate">endDate</label>
<input type="text" class="form-control" id="endDate" value="07/15/2015">
</div>
<div class="form-group">
<label for="minDate">minDate</label>
<input type="text" class="form-control" id="minDate" value="" placeholder="MM/DD/YYYY">
</div>
<div class="form-group">
<label for="maxDate">maxDate</label>
<input type="text" class="form-control" id="maxDate" value="" placeholder="MM/DD/YYYY">
</div>
</div>
<div class="col-md-4">
<div class="checkbox">
<label>
<input type="checkbox" id="autoApply"> autoApply
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="singleDatePicker"> singleDatePicker
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="showDropdowns"> showDropdowns
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="showWeekNumbers"> showWeekNumbers
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="showISOWeekNumbers"> showISOWeekNumbers
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="timePicker"> timePicker
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="timePicker24Hour"> timePicker24Hour
</label>
</div>
<div class="form-group">
<label for="timePickerIncrement">timePickerIncrement (in minutes)</label>
<input type="text" class="form-control" id="timePickerIncrement" value="1">
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="timePickerSeconds"> timePickerSeconds
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="dateLimit"> dateLimit (with example date range span)
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="ranges"> ranges (with example predefined ranges)
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="locale"> locale (with example settings)
</label>
<label id="rtl-wrap">
<input type="checkbox" id="rtl"> RTL (right-to-left)
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="alwaysShowCalendars"> alwaysShowCalendars
</label>
</div>
</div>
<div class="col-md-4">
<div class="checkbox">
<label>
<input type="checkbox" id="linkedCalendars" checked="checked"> linkedCalendars
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="autoUpdateInput" checked="checked"> autoUpdateInput
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="showCustomRangeLabel" checked="checked"> showCustomRangeLabel
</label>
</div>
<div class="form-group">
<label for="opens">opens</label>
<select id="opens" class="form-control">
<option value="right" selected>right</option>
<option value="left">left</option>
<option value="center">center</option>
</select>
</div>
<div class="form-group">
<label for="drops">drops</label>
<select id="drops" class="form-control">
<option value="down" selected>down</option>
<option value="up">up</option>
</select>
</div>
<div class="form-group">
<label for="buttonClasses">buttonClasses</label>
<input type="text" class="form-control" id="buttonClasses" value="btn btn-sm">
</div>
<div class="form-group">
<label for="applyClass">applyClass</label>
<input type="text" class="form-control" id="applyClass" value="btn-success">
</div>
<div class="form-group">
<label for="cancelClass">cancelClass</label>
<input type="text" class="form-control" id="cancelClass" value="btn-default">
</div>
</div>
</div>
</form>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-2 demo">
<h4>Your Date Range Picker</h4>
<input type="text" id="config-demo" class="form-control">
<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
</div>
<div class="col-md-6">
<h4>Configuration</h4>
<div class="well">
<textarea id="config-text" style="height: 300px; width: 100%; padding: 10px"></textarea>
</div>
</div>
</div>
</div>
<style type="text/css">
.demo { position: relative; }
.demo i {
position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#config-text').keyup(function() {
eval($(this).val());
});
$('.configurator input, .configurator select').change(function() {
updateConfig();
});
$('.demo i').click(function() {
$(this).parent().find('input').click();
});
$('#startDate').daterangepicker({
singleDatePicker: true,
startDate: moment().subtract(6, 'days')
});
$('#endDate').daterangepicker({
singleDatePicker: true,
startDate: moment()
});
updateConfig();
function updateConfig() {
var options = {};
if ($('#singleDatePicker').is(':checked'))
options.singleDatePicker = true;
if ($('#showDropdowns').is(':checked'))
options.showDropdowns = true;
if ($('#showWeekNumbers').is(':checked'))
options.showWeekNumbers = true;
if ($('#showISOWeekNumbers').is(':checked'))
options.showISOWeekNumbers = true;
if ($('#timePicker').is(':checked'))
options.timePicker = true;
if ($('#timePicker24Hour').is(':checked'))
options.timePicker24Hour = true;
if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1)
options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10);
if ($('#timePickerSeconds').is(':checked'))
options.timePickerSeconds = true;
if ($('#autoApply').is(':checked'))
options.autoApply = true;
if ($('#dateLimit').is(':checked'))
options.dateLimit = { days: 7 };
if ($('#ranges').is(':checked')) {
options.ranges = {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
};
}
if ($('#locale').is(':checked')) {
$('#rtl-wrap').show();
options.locale = {
direction: $('#rtl').is(':checked') ? 'rtl' : 'ltr',
format: 'MM/DD/YYYY HH:mm',
separator: ' - ',
applyLabel: 'Apply',
cancelLabel: 'Cancel',
fromLabel: 'From',
toLabel: 'To',
customRangeLabel: 'Custom',
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
firstDay: 1
};
} else {
$('#rtl-wrap').hide();
}
if (!$('#linkedCalendars').is(':checked'))
options.linkedCalendars = false;
if (!$('#autoUpdateInput').is(':checked'))
options.autoUpdateInput = false;
if (!$('#showCustomRangeLabel').is(':checked'))
options.showCustomRangeLabel = false;
if ($('#alwaysShowCalendars').is(':checked'))
options.alwaysShowCalendars = true;
if ($('#parentEl').val().length)
options.parentEl = $('#parentEl').val();
if ($('#startDate').val().length)
options.startDate = $('#startDate').val();
if ($('#endDate').val().length)
options.endDate = $('#endDate').val();
if ($('#minDate').val().length)
options.minDate = $('#minDate').val();
if ($('#maxDate').val().length)
options.maxDate = $('#maxDate').val();
if ($('#opens').val().length && $('#opens').val() != 'right')
options.opens = $('#opens').val();
if ($('#drops').val().length && $('#drops').val() != 'down')
options.drops = $('#drops').val();
if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm')
options.buttonClasses = $('#buttonClasses').val();
if ($('#applyClass').val().length && $('#applyClass').val() != 'btn-success')
options.applyClass = $('#applyClass').val();
if ($('#cancelClass').val().length && $('#cancelClass').val() != 'btn-default')
options.cancelClass = $('#cancelClass').val();
$('#config-text').val("$('#demo').daterangepicker(" + JSON.stringify(options, null, ' ') + ", function(start, end, label) {\n console.log(\"New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')\");\n});");
$('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); });
}
});
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,18 @@
Package.describe({
name: 'dangrossman:bootstrap-daterangepicker',
version: '2.1.24',
summary: 'Date range picker component for Bootstrap',
git: 'https://github.com/dangrossman/bootstrap-daterangepicker',
documentation: 'README.md'
});
Package.onUse(function(api) {
api.versionsFrom('METEOR@0.9.0.1');
api.use('twbs:bootstrap@3.3.4', ["client"], {weak: true});
api.use('momentjs:moment@2.10.3', ["client"]);
api.use('jquery@1.11.3_2', ["client"]);
api.addFiles('daterangepicker.js', ["client"]);
api.addFiles('daterangepicker.css', ["client"]);
});

View File

@@ -0,0 +1,32 @@
{
"name": "bootstrap-daterangepicker",
"version": "2.1.24",
"description": "Date range picker component for Bootstrap",
"main": "daterangepicker.js",
"style": "daterangepicker.css",
"scripts": {
"scss": "node-sass daterangepicker.scss > daterangepicker.css",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/dangrossman/bootstrap-daterangepicker.git"
},
"author": {
"name": "Dan Grossman",
"email": "dan@dangrossman.info",
"url": "http://www.dangrossman.info"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/dangrossman/bootstrap-daterangepicker/issues"
},
"homepage": "https://github.com/dangrossman/bootstrap-daterangepicker",
"dependencies": {
"jquery": ">=1.10",
"moment": "^2.9.0"
},
"devDependencies": {
"node-sass": "^3.4.2"
}
}