first commit, after modifying client section

This commit is contained in:
Kwesi Banson
2023-02-22 07:48:50 +00:00
commit ad0dd6a6e1
1880 changed files with 538494 additions and 0 deletions

4255
public/assets/build/css/custom.css vendored Executable file

File diff suppressed because it is too large Load Diff

7
public/assets/build/css/custom.min.css vendored Executable file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

5046
public/assets/build/js/custom.js vendored Executable file

File diff suppressed because it is too large Load Diff

3
public/assets/build/js/custom.min.js vendored Executable file

File diff suppressed because one or more lines are too long

28
public/assets/css/click.css vendored Executable file
View File

@@ -0,0 +1,28 @@
.column-title{
/*style: width: 50%;*/
}
.frame {
overflow-y: auto;
/*border: 1px solid lightgreen;*/
height: 15em;
/*width: 10em;*/
/*line-height: 1em;*/
}
.frame::-webkit-scrollbar {
-webkit-appearance: none;
}
.frame::-webkit-scrollbar:vertical {
width: 11px;
}
.frame::-webkit-scrollbar:horizontal {
height: 11px;
}
.frame::-webkit-scrollbar-thumb {
border-radius: 8px;
border: 2px solid white; /* should match background, can't be transparent */
background-color: rgba(0, 0, 0, .5);
}

57
public/assets/css/demo.css vendored Executable file
View File

@@ -0,0 +1,57 @@
body {
font-family : Ubuntu, SansSerif;
width : 1000px;
}
h1 {
font-size : 1.3em;
padding-bottom : 10px;
}
h2 {
font-size : 1em;
margin-top : 0px;
margin-bottom : 8px;
}
p {
margin : 0px;
padding : 0px;
line-height : 1.5em;
}
div#left {
font-size : small;
position : fixed;
left : 0;
top : 0;
width : 300px;
}
div#content {
position : relative;
left : 300px;
}
div.text {
padding : 10px;
}
div#left a {
color : #0000a0;
}
div.orgChart a {
color : black;
text-decoration : none;
}
div.orgChart a:hover {
color : black;
text-decoration : underline;
}
img.star {
width : 16px;
height : 16px;
}

5
public/assets/css/fontawesome.css vendored Executable file

File diff suppressed because one or more lines are too long

99
public/assets/css/jq-orgchart.css vendored Executable file
View File

@@ -0,0 +1,99 @@
div.orgChart {
border : 1px solid #cccccc;
background-color : #ffffe8;
margin : 10px;
padding : 20px;
}
div.orgChart h2 {
margin : 0px;
font-size : 1em;
border-bottom : none;
}
div.orgChart ul {
list-style : none;
margin : 4px;
padding : 0px;
font-size : 0.8em;
text-align : left;
}
div.orgChart ul.stack,
div.orgChart ul.stack ul {
text-align : center;
}
div.orgChart table {
width : 100%;
}
div.orgChart tr.lines td.line {
width : 1px;
height : 20px;
}
div.orgChart tr.lines td.top {
border-top : 3px solid black;
}
div.orgChart tr.lines td.left {
border-right : 2px solid black;
}
div.orgChart tr.lines td.right {
border-left : 2px solid black;
}
div.orgChart td {
text-align : center;
vertical-align : top;
padding : 0px 2px;
}
div.orgChart div.node {
cursor : default;
border : 2px solid black;
display : inline-block;
padding : 0 4px;
width : 96px;
height : 60px;
background-color : #ffffcf;
line-height : 1.3em;
border-radius : 8px;
box-shadow : 4px 4px 6px #888888;
-moz-border-radius : 8px;
-moz-box-shadow : 4px 4px 6px #888888;
-webkit-border-radius : 8px;
-webkit-box-shadow : 4px 4px 6px #888888;
}
div.orgChart div.hasChildren {
background-color : #ffff98;
}
div.orgChart.interactive div.hasChildren {
cursor : pointer;
}
div.orgChart div.node.hover {
background-color : white;
}
div.orgChart div.adjunct.node {
position : absolute;
margin-top : 8px;
margin-left : -110px;
width : 80px;
height : 40px;
background-color : #efefef;
}
div.orgChart div.adjunct-link {
display : inline-block;
position : absolute;
margin-left : -20px;
margin-top : 25px;
width : 20px;
border : 1px dashed black;
}

File diff suppressed because one or more lines are too long

2
public/assets/css/orgchart.css vendored Executable file

File diff suppressed because one or more lines are too long

622
public/assets/css/report.css vendored Executable file
View File

@@ -0,0 +1,622 @@
/*
Icon Font: fontcustom
*/
@font-face {
font-family: "fontcustom";
src: url("./fontcustom_511999ab39d2316d71a49245451dd766.eot");
src: url("./fontcustom_511999ab39d2316d71a49245451dd766.eot?#iefix")
format("embedded-opentype"),
url("./fontcustom_511999ab39d2316d71a49245451dd766.woff") format("woff"),
url("./fontcustom_511999ab39d2316d71a49245451dd766.ttf") format("truetype"),
url("./fontcustom_511999ab39d2316d71a49245451dd766.svg#fontcustom")
format("svg");
font-weight: normal;
font-style: normal;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
@font-face {
font-family: "fontcustom";
src: url("./fontcustom_511999ab39d2316d71a49245451dd766.svg#fontcustom")
format("svg");
}
}
[data-icon]:before {
content: attr(data-icon);
}
[data-icon]:before,
.icon-arrow:before,
.icon-degraded:before,
.icon-help:before,
.icon-menu:before,
.icon-operational:before,
.icon-outage:before,
.icon-partial:before {
display: inline-block;
font-family: "fontcustom";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
text-rendering: optimizeLegibility;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
}
.icon-arrow:before {
content: "\f107";
}
.icon-degraded:before {
content: "\f108";
}
.icon-help:before {
content: "\f109";
}
.icon-menu:before {
content: "\f10a";
}
.icon-operational:before {
content: "\f10b";
}
.icon-outage:before {
content: "\f10c";
}
.icon-partial:before {
content: "\f10d";
}
/* Menu Icon Animation */
#hamburger {
width: 18px;
height: 14px;
position: relative;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: 0.5s ease-in-out;
-moz-transition: 0.5s ease-in-out;
-o-transition: 0.5s ease-in-out;
transition: 0.5s ease-in-out;
cursor: pointer;
}
#hamburger span {
display: block;
position: absolute;
height: 3px;
width: 100%;
background: #ffffff;
border-radius: 1px;
opacity: 1;
left: 0;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: 0.25s ease-in-out;
-moz-transition: 0.25s ease-in-out;
-o-transition: 0.25s ease-in-out;
transition: 0.25s ease-in-out;
}
#hamburger span:nth-child(1) {
top: 1px;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
#hamburger span:nth-child(2) {
top: 7px;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
#hamburger span:nth-child(3) {
top: 13px;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
#hamburger.open span:nth-child(1) {
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
top: 1;
left: 3px;
}
#hamburger.open span:nth-child(2) {
width: 0%;
opacity: 0;
}
#hamburger.open span:nth-child(3) {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
top: 14px;
left: 3px;
}
@charset "UTF-8";
@font-face {
font-family: "fontcustom";
src: url("fonts/fontcustom_511999ab39d2316d71a49245451dd766.eot");
src: url("fonts/fontcustom_511999ab39d2316d71a49245451dd766.eot?#iefix")
format("embedded-opentype"),
url("fonts/fontcustom_511999ab39d2316d71a49245451dd766.woff") format("woff"),
url("fonts/fontcustom_511999ab39d2316d71a49245451dd766.ttf")
format("truetype"),
url("fonts/fontcustom_511999ab39d2316d71a49245451dd766.svg#fontcustom")
format("svg");
font-weight: normal;
font-style: normal;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
@font-face {
font-family: "fontcustom";
src: url("fonts/fontcustom_511999ab39d2316d71a49245451dd766.svg#fontcustom")
format("svg");
}
}
[data-icon]:before {
content: attr(data-icon);
display: inline-block;
font-family: "fontcustom";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
text-rendering: optimizeLegibility;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
}
.icon-arrow:before,
.header .breadcrumb ul li:not(:last-child) i:before,
.icon-degraded:before,
.icon-help:before,
.icon-menu:before,
.icon-operational:before,
.icon-outage:before,
.icon-partial:before {
display: inline-block;
font-family: "fontcustom";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
text-rendering: optimizeLegibility;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
}
.icon-arrow:before,
.header .breadcrumb ul li:not(:last-child) i:before {
content: "";
}
.icon-degraded:before {
content: "";
}
.icon-help:before {
content: "";
}
.icon-menu:before {
content: "";
}
.icon-operational:before {
content: "";
}
.icon-outage:before {
content: "";
}
.icon-partial:before {
content: "";
}
.green {
background-color: #c7e58f;
color: #006837;
}
.yellow {
background-color: #fff1ac;
color: #9c8100;
}
.orange {
background-color: #ffddad;
color: #994e17;
}
.red {
background-color: #ffd8dc;
color: #9c1a2c;
}
.grey {
background-color: #cfcfcf;
color: #4f4f4f;
}
body {
font-family: "Avenir Next", "Avenir", "Roboto", "Helvetica", sans-serif;
color: #666666;
font-size: 14px;
font-weight: 400;
}
@media screen and (max-width: 460px) {
body {
font-size: 16px;
}
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
font-weight: 400;
line-height: 1.5em;
margin: 0;
}
h1 {
font-size: 2em;
}
h2 {
font-size: 1.75em;
}
h3 {
font-size: 1.5em;
}
h4 {
font-size: 1.25em;
}
h5 {
font-size: 1em;
}
h6 {
font-size: 0.75em;
}
p {
font-size: 1em;
line-height: 1.5em;
}
ul {
margin: 1em 0;
}
b {
font-weight: 600;
}
code,
pre {
font-size: 1em;
padding: 2px 10px 3px 10px;
border-radius: 5px;
background-color: #3b3b3b;
color: #f3f3f3;
font-family: "Source Code Pro", "Ubuntu Mono", "Consolas", unicode;
}
pre {
padding: 9px 10px;
margin: 2em 0;
}
hr {
border: none;
height: 1px;
margin: 2em 0;
background-color: #bababa;
}
.groups li i {
font-size: 10px;
margin-right: 15px;
}
@media screen and (max-width: 460px) {
.groups li i {
font-size: 12px;
}
}
.groups li i.icon-help:before {
padding-left: 5px;
}
i.icon-operational:before {
color: #8cc63f;
}
i.icon-degraded:before {
color: #f7d21b;
}
i.icon-partial:before {
color: #fc9a40;
}
i.icon-outage:before {
color: #d1434f;
}
a:link,
a:visited {
color: #666666;
}
a:hover {
color: #000000;
}
a:active {
color: #00adee;
}
* {
box-sizing: border-box;
}
@media screen and (max-width: 640px) {
body.open {
max-width: 100vw;
max-height: 100vh;
overflow-x: hidden;
position: static;
}
}
.content,
.header,
.content-area {
position: static;
}
.header {
position: fixed;
top: 0;
}
@media screen and (max-width: 320px) {
.header {
z-index: 99999;
}
}
.content-area {
position: static;
}
.content-area section {
width: 100%;
clear: both;
}
@media screen and (max-width: 320px) {
.open .content-area {
display: none;
max-height: 1px;
}
}
.overlay {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
-webkit-overflow-scrolling: touch;
-webkit-backface-visibility: hidden;
z-index: 1;
position: fixed;
top: 0;
left: 0;
bottom: 0;
min-height: 100vh;
height: 100vh;
width: 300px;
margin-left: -300px;
background-color: rgba(243, 243, 243, 0.75);
}
.open .overlay {
box-shadow: 2px 0 15px -2px rgba(0, 0, 0, 0.2);
}
@media screen and (max-width: 320px) {
.overlay {
margin-left: 0;
width: 100vw;
height: auto;
position: static;
display: block;
clear: both;
display: none;
}
.open .overlay {
display: block;
}
}
.groups {
margin: 0;
padding: 0;
position: static;
}
.overlay .groups {
height: 100vh;
overflow-y: scroll;
}
@media screen and (max-width: 320px) {
.overlay .groups {
height: auto;
overflow: auto;
display: block;
clear: both;
}
}
.groups li {
height: 50px;
min-height: 50px;
display: -webkit-flex;
display: -webkit-box;
display: -ms-flexbox;
display: -moz-box;
display: flex;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
white-space: nowrap;
overflow: hidden;
}
.overlay .groups li {
background-color: #f3f3f3;
padding: 15px 20px;
border-bottom: 1px solid #e5e5e5;
}
.overlay .groups li.active {
background-color: #e7e7e7;
}
.overlay .groups li:first-of-type {
min-height: 57px;
box-sizing: border-box;
}
.overlay .groups li:hover {
background-color: #ededed;
cursor: pointer;
}
[rel="groups"] .groups li {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
display: inline-block;
background-color: #ffffff;
border: 1px solid #e5e5e5;
border-radius: 5px;
margin: 0;
margin-bottom: 15px;
padding: 15px 20px;
float: left;
width: 49%;
}
[rel="groups"] .groups li:hover {
background-color: #fbfbfb;
cursor: pointer;
}
[rel="groups"] .groups li:nth-child(2n) {
margin-left: 2%;
}
@media screen and (max-width: 640px) {
[rel="groups"] .groups li {
width: 100%;
}
[rel="groups"] .groups li:nth-child(2n) {
margin-left: 0;
}
}
@media screen and (max-width: 640px) {
[rel="report"] {
display: block;
}
}
[rel="report"] .mobile {
display: -webkit-flex;
display: -webkit-box;
display: -ms-flexbox;
display: -moz-box;
display: flex;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
}
[rel="report"] .mobile .block {
order: 1;
-webkit-order: 1;
}
[rel="report"] .mobile .links {
order: 99;
-webkit-order: 99;
}
[rel="report"] .mobile .notification {
order: -99;
-webkit-order: -99;
}
[rel="report"] .web {
display: -webkit-flex;
display: -webkit-box;
display: -ms-flexbox;
display: -moz-box;
display: flex;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
flex-direction: row;
}
[rel="report"] .web aside {
width: 29%;
margin-right: 2%;
}
[rel="report"] .web summary {
width: 71%;
}
@media screen and (max-width: 640px) {
[rel="report"] .web aside,
[rel="report"] .web summary {
width: 100%;
margin: 0;
}
}
[rel="report"] .block {
background-color: #ffffff;
border: 1px solid #e5e5e5;
border-radius: 5px;
margin-bottom: 15px;
overflow: hidden;
}
[rel="report"] .block .bit {
padding: 20px;
}
[rel="report"] .block .bit:not(:last-child) {
border-bottom: 1px solid #e5e5e5;
}
[rel="report"] .block.links .bit:hover {
cursor: pointer;
background-color: #fbfbfb;
}
[rel="report"] .block h6 {
color: #bababa;
margin-bottom: 1em;
}

268
public/assets/css/servers.css vendored Executable file
View File

@@ -0,0 +1,268 @@
/* RESET STYLES & HELPER CLASSES
*/
:root {
--level-1: #8dccad;
--level-2: #f5cc7f;
--level-3: #7b9fe0;
--level-4: #f27c8d;
--black: black;
}
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
ol {
list-style: none;
}
body {
margin: 50px 0 100px;
text-align: center;
font-family: "Inter", sans-serif;
}
.container {
max-width: 1000px;
padding: 0 10px;
margin: 0 auto;
}
.rectangle {
position: relative;
padding: 20px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}
/* LEVEL-1 STYLES
*/
.level-1 {
width: 50%;
margin: 0 auto 40px;
background: var(--level-1);
}
.level-1::before {
content: "";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
width: 2px;
height: 20px;
background: var(--black);
}
/* LEVEL-2 STYLES
*/
.level-2-wrapper {
position: relative;
display: grid;
grid-template-columns: repeat(4, 1fr);
}
.level-2-wrapper::before {
content: "";
position: absolute;
top: -20px;
left: 25%;
width: 50%;
height: 2px;
background: var(--black);
}
.level-2-wrapper::after {
display: none;
content: "";
position: absolute;
left: -20px;
bottom: -20px;
width: calc(100% + 20px);
height: 2px;
background: var(--black);
}
.level-2-wrapper li {
position: relative;
}
.level-2-wrapper > li::before {
content: "";
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
width: 2px;
height: 20px;
background: var(--black);
}
.level-2 {
width: 70%;
margin: 0 auto 40px;
background: var(--level-2);
}
.level-2::before {
content: "";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
width: 2px;
height: 20px;
background: var(--black);
}
.level-2::after {
display: none;
content: "";
position: absolute;
top: 50%;
left: 0%;
transform: translate(-100%, -50%);
width: 20px;
height: 2px;
background: var(--black);
}
/* LEVEL-3 STYLES
*/
.level-3-wrapper {
position: relative;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-column-gap: 20px;
width: 90%;
margin: 0 auto;
}
.level-3-wrapper::before {
content: "";
position: absolute;
top: -20px;
left: calc(25% - 5px);
width: calc(50% + 10px);
height: 2px;
background: var(--black);
}
.level-3-wrapper > li::before {
content: "";
position: absolute;
top: 0;
left: 50%;
transform: translate(-50%, -100%);
width: 2px;
height: 20px;
background: var(--black);
}
.level-3 {
margin-bottom: 20px;
background: var(--level-3);
}
/* LEVEL-4 STYLES
*/
.level-4-wrapper {
position: relative;
width: 80%;
margin-left: auto;
}
.level-4-wrapper::before {
content: "";
position: absolute;
top: -20px;
left: -20px;
width: 2px;
height: calc(100% + 20px);
background: var(--black);
}
.level-4-wrapper li + li {
margin-top: 20px;
}
.level-4 {
font-weight: normal;
background: var(--level-4);
}
.level-4::before {
content: "";
position: absolute;
top: 50%;
left: 0%;
transform: translate(-100%, -50%);
width: 20px;
height: 2px;
background: var(--black);
}
/* MQ STYLES
*/
@media screen and (max-width: 700px) {
.rectangle {
padding: 20px 10px;
}
.level-1,
.level-2 {
width: 100%;
}
.level-1 {
margin-bottom: 20px;
}
.level-1::before,
.level-2-wrapper > li::before {
display: none;
}
.level-2-wrapper,
.level-2-wrapper::after,
.level-2::after {
display: block;
}
.level-2-wrapper {
width: 90%;
margin-left: 10%;
}
.level-2-wrapper::before {
left: -20px;
width: 2px;
height: calc(100% + 40px);
}
.level-2-wrapper > li:not(:first-child) {
margin-top: 50px;
}
}
/* FOOTER
*/
.page-footer {
position: fixed;
right: 0;
bottom: 20px;
display: flex;
align-items: center;
padding: 5px;
}
.page-footer a {
margin-left: 4px;
}

686
public/assets/css/sweetalert.css vendored Executable file
View File

@@ -0,0 +1,686 @@
@keyframes showSweetAlert {
0% {
transform: scale(0.7);
}
45% {
transform: scale(1.05);
}
80% {
transform: scale(0.95);
}
100% {
transform: scale(1);
}
}
@keyframes hideSweetAlert {
0% {
transform: scale(1);
}
100% {
transform: scale(0.5);
}
}
@keyframes slideFromTop {
0% {
top: 0%;
}
100% {
top: 50%;
}
}
@keyframes slideToTop {
0% {
top: 50%;
}
100% {
top: 0%;
}
}
@keyframes slideFromBottom {
0% {
top: 70%;
}
100% {
top: 50%;
}
}
@keyframes slideToBottom {
0% {
top: 50%;
}
100% {
top: 70%;
}
}
.showSweetAlert {
animation: showSweetAlert 0.3s;
}
.showSweetAlert[data-animation=none] {
animation: none;
}
.showSweetAlert[data-animation=slide-from-top] {
animation: slideFromTop 0.3s;
}
.showSweetAlert[data-animation=slide-from-bottom] {
animation: slideFromBottom 0.3s;
}
.hideSweetAlert {
animation: hideSweetAlert 0.3s;
}
.hideSweetAlert[data-animation=none] {
animation: none;
}
.hideSweetAlert[data-animation=slide-from-top] {
animation: slideToTop 0.3s;
}
.hideSweetAlert[data-animation=slide-from-bottom] {
animation: slideToBottom 0.3s;
}
@keyframes animateSuccessTip {
0% {
width: 0;
left: 1px;
top: 19px;
}
54% {
width: 0;
left: 1px;
top: 19px;
}
70% {
width: 50px;
left: -8px;
top: 37px;
}
84% {
width: 17px;
left: 21px;
top: 48px;
}
100% {
width: 25px;
left: 14px;
top: 45px;
}
}
@keyframes animateSuccessLong {
0% {
width: 0;
right: 46px;
top: 54px;
}
65% {
width: 0;
right: 46px;
top: 54px;
}
84% {
width: 55px;
right: 0px;
top: 35px;
}
100% {
width: 47px;
right: 8px;
top: 38px;
}
}
@keyframes rotatePlaceholder {
0% {
transform: rotate(-45deg);
}
5% {
transform: rotate(-45deg);
}
12% {
transform: rotate(-405deg);
}
100% {
transform: rotate(-405deg);
}
}
.animateSuccessTip {
animation: animateSuccessTip 0.75s;
}
.animateSuccessLong {
animation: animateSuccessLong 0.75s;
}
.sa-icon.sa-success.animate::after {
animation: rotatePlaceholder 4.25s ease-in;
}
@keyframes animateErrorIcon {
0% {
transform: rotateX(100deg);
opacity: 0;
}
100% {
transform: rotateX(0deg);
opacity: 1;
}
}
.animateErrorIcon {
animation: animateErrorIcon 0.5s;
}
@keyframes animateXMark {
0% {
transform: scale(0.4);
margin-top: 26px;
opacity: 0;
}
50% {
transform: scale(0.4);
margin-top: 26px;
opacity: 0;
}
80% {
transform: scale(1.15);
margin-top: -6px;
}
100% {
transform: scale(1);
margin-top: 0;
opacity: 1;
}
}
.animateXMark {
animation: animateXMark 0.5s;
}
@keyframes pulseWarning {
0% {
border-color: #F8D486;
}
100% {
border-color: #F8BB86;
}
}
.pulseWarning {
animation: pulseWarning 0.75s infinite alternate;
}
@keyframes pulseWarningIns {
0% {
background-color: #F8D486;
}
100% {
background-color: #F8BB86;
}
}
.pulseWarningIns {
animation: pulseWarningIns 0.75s infinite alternate;
}
@keyframes rotate-loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
body.stop-scrolling {
height: 100%;
overflow: hidden;
}
.sweet-overlay {
background-color: rgba(0, 0, 0, 0.4);
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: none;
z-index: 1040;
}
.sweet-alert {
background-color: #ffffff;
width: 478px;
padding: 17px;
border-radius: 5px;
text-align: center;
position: fixed;
left: 50%;
top: 50%;
margin-left: -256px;
margin-top: -200px;
overflow: hidden;
display: none;
z-index: 2000;
}
@media all and (max-width: 767px) {
.sweet-alert {
width: auto;
margin-left: 0;
margin-right: 0;
left: 15px;
right: 15px;
}
}
.sweet-alert .form-group {
display: none;
}
.sweet-alert .form-group .sa-input-error {
display: none;
}
.sweet-alert.show-input .form-group {
display: block;
}
.sweet-alert .sa-confirm-button-container {
display: inline-block;
position: relative;
}
.sweet-alert .la-ball-fall {
position: absolute;
left: 50%;
top: 50%;
margin-left: -27px;
margin-top: -9px;
opacity: 0;
visibility: hidden;
}
.sweet-alert button[disabled] {
opacity: .6;
cursor: default;
}
.sweet-alert button.confirm[disabled] {
color: transparent;
}
.sweet-alert button.confirm[disabled] ~ .la-ball-fall {
opacity: 1;
visibility: visible;
transition-delay: 0s;
}
.sweet-alert .sa-icon {
width: 80px;
height: 80px;
border: 4px solid gray;
border-radius: 50%;
margin: 20px auto;
position: relative;
box-sizing: content-box;
}
.sweet-alert .sa-icon.sa-error {
border-color: #d43f3a;
}
.sweet-alert .sa-icon.sa-error .sa-x-mark {
position: relative;
display: block;
}
.sweet-alert .sa-icon.sa-error .sa-line {
position: absolute;
height: 5px;
width: 47px;
background-color: #d9534f;
display: block;
top: 37px;
border-radius: 2px;
}
.sweet-alert .sa-icon.sa-error .sa-line.sa-left {
transform: rotate(45deg);
left: 17px;
}
.sweet-alert .sa-icon.sa-error .sa-line.sa-right {
transform: rotate(-45deg);
right: 16px;
}
.sweet-alert .sa-icon.sa-warning {
border-color: #eea236;
}
.sweet-alert .sa-icon.sa-warning .sa-body {
position: absolute;
width: 5px;
height: 47px;
left: 50%;
top: 10px;
border-radius: 2px;
margin-left: -2px;
background-color: #f0ad4e;
}
.sweet-alert .sa-icon.sa-warning .sa-dot {
position: absolute;
width: 7px;
height: 7px;
border-radius: 50%;
margin-left: -3px;
left: 50%;
bottom: 10px;
background-color: #f0ad4e;
}
.sweet-alert .sa-icon.sa-info {
border-color: #46b8da;
}
.sweet-alert .sa-icon.sa-info::before {
content: "";
position: absolute;
width: 5px;
height: 29px;
left: 50%;
bottom: 17px;
border-radius: 2px;
margin-left: -2px;
background-color: #5bc0de;
}
.sweet-alert .sa-icon.sa-info::after {
content: "";
position: absolute;
width: 7px;
height: 7px;
border-radius: 50%;
margin-left: -3px;
top: 19px;
background-color: #5bc0de;
}
.sweet-alert .sa-icon.sa-success {
border-color: #4cae4c;
}
.sweet-alert .sa-icon.sa-success::before,
.sweet-alert .sa-icon.sa-success::after {
content: '';
border-radius: 50%;
position: absolute;
width: 60px;
height: 120px;
background: #ffffff;
transform: rotate(45deg);
}
.sweet-alert .sa-icon.sa-success::before {
border-radius: 120px 0 0 120px;
top: -7px;
left: -33px;
transform: rotate(-45deg);
transform-origin: 60px 60px;
}
.sweet-alert .sa-icon.sa-success::after {
border-radius: 0 120px 120px 0;
top: -11px;
left: 30px;
transform: rotate(-45deg);
transform-origin: 0px 60px;
}
.sweet-alert .sa-icon.sa-success .sa-placeholder {
width: 80px;
height: 80px;
border: 4px solid rgba(92, 184, 92, 0.2);
border-radius: 50%;
box-sizing: content-box;
position: absolute;
left: -4px;
top: -4px;
z-index: 2;
}
.sweet-alert .sa-icon.sa-success .sa-fix {
width: 5px;
height: 90px;
background-color: #ffffff;
position: absolute;
left: 28px;
top: 8px;
z-index: 1;
transform: rotate(-45deg);
}
.sweet-alert .sa-icon.sa-success .sa-line {
height: 5px;
background-color: #5cb85c;
display: block;
border-radius: 2px;
position: absolute;
z-index: 2;
}
.sweet-alert .sa-icon.sa-success .sa-line.sa-tip {
width: 25px;
left: 14px;
top: 46px;
transform: rotate(45deg);
}
.sweet-alert .sa-icon.sa-success .sa-line.sa-long {
width: 47px;
right: 8px;
top: 38px;
transform: rotate(-45deg);
}
.sweet-alert .sa-icon.sa-custom {
background-size: contain;
border-radius: 0;
border: none;
background-position: center center;
background-repeat: no-repeat;
}
.sweet-alert .btn-default:focus {
border-color: #cccccc;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(204, 204, 204, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(204, 204, 204, 0.6);
}
.sweet-alert .btn-success:focus {
border-color: #4cae4c;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(76, 174, 76, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(76, 174, 76, 0.6);
}
.sweet-alert .btn-info:focus {
border-color: #46b8da;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(70, 184, 218, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(70, 184, 218, 0.6);
}
.sweet-alert .btn-danger:focus {
border-color: #d43f3a;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(212, 63, 58, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(212, 63, 58, 0.6);
}
.sweet-alert .btn-warning:focus {
border-color: #eea236;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238, 162, 54, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238, 162, 54, 0.6);
}
.sweet-alert button::-moz-focus-inner {
border: 0;
}
/*!
* Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/)
* Copyright 2015 Daniel Cardoso <@DanielCardoso>
* Licensed under MIT
*/
.la-ball-fall,
.la-ball-fall > div {
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.la-ball-fall {
display: block;
font-size: 0;
color: #fff;
}
.la-ball-fall.la-dark {
color: #333;
}
.la-ball-fall > div {
display: inline-block;
float: none;
background-color: currentColor;
border: 0 solid currentColor;
}
.la-ball-fall {
width: 54px;
height: 18px;
}
.la-ball-fall > div {
width: 10px;
height: 10px;
margin: 4px;
border-radius: 100%;
opacity: 0;
-webkit-animation: ball-fall 1s ease-in-out infinite;
-moz-animation: ball-fall 1s ease-in-out infinite;
-o-animation: ball-fall 1s ease-in-out infinite;
animation: ball-fall 1s ease-in-out infinite;
}
.la-ball-fall > div:nth-child(1) {
-webkit-animation-delay: -200ms;
-moz-animation-delay: -200ms;
-o-animation-delay: -200ms;
animation-delay: -200ms;
}
.la-ball-fall > div:nth-child(2) {
-webkit-animation-delay: -100ms;
-moz-animation-delay: -100ms;
-o-animation-delay: -100ms;
animation-delay: -100ms;
}
.la-ball-fall > div:nth-child(3) {
-webkit-animation-delay: 0ms;
-moz-animation-delay: 0ms;
-o-animation-delay: 0ms;
animation-delay: 0ms;
}
.la-ball-fall.la-sm {
width: 26px;
height: 8px;
}
.la-ball-fall.la-sm > div {
width: 4px;
height: 4px;
margin: 2px;
}
.la-ball-fall.la-2x {
width: 108px;
height: 36px;
}
.la-ball-fall.la-2x > div {
width: 20px;
height: 20px;
margin: 8px;
}
.la-ball-fall.la-3x {
width: 162px;
height: 54px;
}
.la-ball-fall.la-3x > div {
width: 30px;
height: 30px;
margin: 12px;
}
/*
* Animation
*/
@-webkit-keyframes ball-fall {
0% {
opacity: 0;
-webkit-transform: translateY(-145%);
transform: translateY(-145%);
}
10% {
opacity: .5;
}
20% {
opacity: 1;
-webkit-transform: translateY(0);
transform: translateY(0);
}
80% {
opacity: 1;
-webkit-transform: translateY(0);
transform: translateY(0);
}
90% {
opacity: .5;
}
100% {
opacity: 0;
-webkit-transform: translateY(145%);
transform: translateY(145%);
}
}
@-moz-keyframes ball-fall {
0% {
opacity: 0;
-moz-transform: translateY(-145%);
transform: translateY(-145%);
}
10% {
opacity: .5;
}
20% {
opacity: 1;
-moz-transform: translateY(0);
transform: translateY(0);
}
80% {
opacity: 1;
-moz-transform: translateY(0);
transform: translateY(0);
}
90% {
opacity: .5;
}
100% {
opacity: 0;
-moz-transform: translateY(145%);
transform: translateY(145%);
}
}
@-o-keyframes ball-fall {
0% {
opacity: 0;
-o-transform: translateY(-145%);
transform: translateY(-145%);
}
10% {
opacity: .5;
}
20% {
opacity: 1;
-o-transform: translateY(0);
transform: translateY(0);
}
80% {
opacity: 1;
-o-transform: translateY(0);
transform: translateY(0);
}
90% {
opacity: .5;
}
100% {
opacity: 0;
-o-transform: translateY(145%);
transform: translateY(145%);
}
}
@keyframes ball-fall {
0% {
opacity: 0;
-webkit-transform: translateY(-145%);
-moz-transform: translateY(-145%);
-o-transform: translateY(-145%);
transform: translateY(-145%);
}
10% {
opacity: .5;
}
20% {
opacity: 1;
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0);
}
80% {
opacity: 1;
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0);
}
90% {
opacity: .5;
}
100% {
opacity: 0;
-webkit-transform: translateY(145%);
-moz-transform: translateY(145%);
-o-transform: translateY(145%);
transform: translateY(145%);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
public/assets/img/loadinggif.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
public/assets/img/overview.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
public/assets/img/star-half.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

BIN
public/assets/img/star-one.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

BIN
public/assets/img/star-zero.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

BIN
public/assets/img/user.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

218
public/assets/js/jq-orgchart.js vendored Executable file
View File

@@ -0,0 +1,218 @@
/**
* JQuery Organisation Chart Plugin.
*
* Author: Mark Lee
* Copyright (C)2013-2015 Caprica Software Limited
* http://www.capricasoftware.co.uk
*
* Contributions by: Paul Lautman <paul.lautman at gmail.com>
*
* This software is licensed under the Creative Commons Attribution-ShareAlike 3.0 License,
* see here for license terms:
*
* http://creativecommons.org/licenses/by-sa/3.0
*/
(function($) {
$.fn.orgChart = function(options) {
var opts = $.extend({}, $.fn.orgChart.defaults, options);
return this.each(function() {
var $chartSource = $(this);
// Clone the source list hierarchy so levels can be non-destructively removed if needed
// before creating the chart
$this = $chartSource.clone();
if (opts.levels > -1) {
$this.find("ul").andSelf().filter(function() {return $chartSource.parents("ul").length+1 > opts.levels;}).remove();
}
// Store the original element
$this.data("chart-source", $chartSource);
// Build the chart...
var $container = $("<div class='" + opts.chartClass + "'/>");
if (opts.interactive) {
$container.addClass("interactive");
}
// The chart may be sourced from either a "ul", or an "li" element...
var $root;
if ($this.is("ul")) {
$root = $this.find("li:first");
}
else if ($this.is("li")) {
$root = $this;
}
if ($root) {
buildNode($root, $container, 0, 0, opts);
// Special case for any hyperlink anchor in the chart to prevent the click on the node itself from propagating
$container.find("div.node a").click(function(evt) {
evt.stopImmediatePropagation();
});
if(opts.replace) {
opts.container.empty();
}
opts.container.append($container);
}
});
};
$.fn.orgChart.defaults = {
container : $("body"),
depth : -1,
levels : -1,
showLevels : -1,
stack : false,
chartClass : "orgChart",
hoverClass : "hover",
nodeText : function($node) {return $node.clone().children("ul,li").remove().end().html();},
interactive: false,
fade : false,
speed : "slow",
nodeClicked: function($node) {},
copyClasses: true,
copyData : true,
copyStyles : true,
copyTitle : true,
replace : true
};
function buildNode($node, $appendTo, level, index, opts) {
var $table = $("<table cellpadding='0' cellspacing='0' border='0'/>");
var $tbody = $("<tbody/>");
// Make this node...
var $nodeRow = $("<tr/>").addClass("nodes");
var $nodeCell = $("<td/>").addClass("node").attr("colspan", 2);
var $childNodes = $node.children("ul:first").children("li");
if ($childNodes.length > 1) {
$nodeCell.attr("colspan", $childNodes.length*2);
}
var $adjunct = $node.children("adjunct").eq(0);
if ($adjunct.length > 0) {
var $adjunctDiv = $("<div>").addClass("adjunct node").addClass("level"+level).addClass("node"+index).addClass("level"+level+"-node"+index).append(opts.nodeText($adjunct));
$adjunctDiv.appendTo($nodeCell);
var $linkDiv = $("<div>").addClass("adjunct-link");
$linkDiv.appendTo($nodeCell);
$adjunct.remove();
}
var $heading = $("<h2>").html(opts.nodeText($node));
var $nodeDiv = $("<div>").addClass("node").addClass("level"+level).addClass("node"+index).addClass("level"+level+"-node"+index).append($heading);
// Copy classes from the source list to the chart node
if (opts.copyClasses) {
$nodeDiv.addClass($node.attr("class"));
}
// Copy data from the source list to the chart node
if (opts.copyData) {
$nodeDiv.data($node.data());
}
// Copy CSS styles from the source list to the chart node
if (opts.copyStyles) {
$nodeDiv.attr("style", $node.attr("style"));
}
// Copy the title attribute from the source list to the chart node
if (opts.copyTitle) {
$nodeDiv.attr("title", $node.attr("title"));
}
$nodeDiv.data("orgchart-level", level).data("orgchart-node", $node);
$nodeCell.append($nodeDiv);
$nodeRow.append($nodeCell);
$tbody.append($nodeRow);
$nodeDiv.click(function() {
var $this = $(this);
opts.nodeClicked($this.data("orgchart-node"), $this);
if (opts.interactive) {
var $row = $this.closest("tr");
if ($row.next("tr").is(":visible")) {
if (opts.fade) {
$row.nextAll("tr").fadeOut(opts.speed);
}
else {
$row.nextAll("tr").hide();
}
$this.removeClass("shownChildren").addClass("hiddenChildren");
}
else {
$this.removeClass("hiddenChildren").addClass("shownChildren");
if (opts.fade) {
$row.nextAll("tr").fadeIn(opts.speed);
}
else {
$row.nextAll("tr").show();
}
}
}
});
if ($childNodes.length > 0) {
if (opts.depth == -1 || level+1 < opts.depth) {
var $downLineRow = $("<tr/>").addClass("lines");
var $downLineCell = $("<td/>").attr("colspan", $childNodes.length*2);
$downLineRow.append($downLineCell);
var $downLineTable = $("<table cellpadding='0' cellspacing='0' border='0'>");
$downLineTable.append("<tbody>");
var $downLineLine = $("<tr/>").addClass("lines x");
var $downLeft = $("<td>").addClass("line left");
var $downRight = $("<td>").addClass("line right");
$downLineLine.append($downLeft).append($downRight);
$downLineTable.children("tbody").append($downLineLine);
$downLineCell.append($downLineTable);
$tbody.append($downLineRow);
if ($childNodes.length > 0) {
$nodeDiv.addClass("hasChildren");
if (opts.showLevels == -1 || level < opts.showLevels-1) {
$nodeDiv.addClass("shownChildren");
}
else {
$nodeDiv.addClass("hiddenChildren");
}
if (opts.interactive) {
$nodeDiv.hover(function() {$(this).addClass(opts.hoverClass);}, function() {$(this).removeClass(opts.hoverClass)});
}
}
// Recursively make child nodes...
var $linesRow = $("<tr/>").addClass("lines v");
$childNodes.each(function() {
var $left = $("<td/>").addClass("line left top");
var $right = $("<td/>").addClass("line right top");
$linesRow.append($left).append($right);
});
$linesRow.find("td:first").removeClass("top");
$linesRow.find("td:last").removeClass("top");
$tbody.append($linesRow);
var $childNodesRow = $("<tr/>");
$childNodes.each(function(index) {
var $td = $("<td/>");
$td.attr("colspan", 2);
buildNode($(this), $td, level+1, index, opts);
$childNodesRow.append($td);
});
$tbody.append($childNodesRow);
}
else if (opts.stack) {
var $stackNodes = $childNodes.clone();
var $list = $("<ul class='stack'>").append($stackNodes).addClass("level"+level).addClass("node"+index).addClass("level"+level+"-node"+index);
var $stackContainer = $("<div class='stack-container'>").append($list);
$nodeDiv.after($stackContainer);
}
}
if (opts.showLevels > -1 && level >= opts.showLevels-1) {
$nodeRow.nextAll("tr").hide();
}
$table.append($tbody);
$appendTo.append($table);
};
})(jQuery);

10
public/assets/js/jquery-confirm.min.js vendored Normal file

File diff suppressed because one or more lines are too long

3
public/assets/js/jquery3.3.min.js vendored Executable file

File diff suppressed because one or more lines are too long

3
public/assets/js/orgchart.js vendored Executable file

File diff suppressed because one or more lines are too long

1
public/assets/js/sweetalert.min.js vendored Executable file

File diff suppressed because one or more lines are too long

23
public/assets/vendors/animate.css/.bower.json vendored Executable file
View File

@@ -0,0 +1,23 @@
{
"name": "animate.css",
"main": "./animate.css",
"ignore": [
".*",
"source",
"*.yml",
"Gemfile",
"Gemfile.lock",
"*.md"
],
"homepage": "https://github.com/daneden/animate.css",
"version": "3.5.1",
"_release": "3.5.1",
"_resolution": {
"type": "version",
"tag": "3.5.1",
"commit": "c7084f820bf65063b4e3fb6293ffe5df9eed1398"
},
"_source": "https://github.com/daneden/animate.css.git",
"_target": "^3.5.1",
"_originalSource": "animate.css"
}

View File

@@ -0,0 +1,120 @@
{
"attention_seekers": [
"bounce",
"flash",
"pulse",
"rubberBand",
"shake",
"headShake",
"swing",
"tada",
"wobble",
"jello"
],
"bouncing_entrances": [
"bounceIn",
"bounceInDown",
"bounceInLeft",
"bounceInRight",
"bounceInUp"
],
"bouncing_exits": [
"bounceOut",
"bounceOutDown",
"bounceOutLeft",
"bounceOutRight",
"bounceOutUp"
],
"fading_entrances": [
"fadeIn",
"fadeInDown",
"fadeInDownBig",
"fadeInLeft",
"fadeInLeftBig",
"fadeInRight",
"fadeInRightBig",
"fadeInUp",
"fadeInUpBig"
],
"fading_exits": [
"fadeOut",
"fadeOutDown",
"fadeOutDownBig",
"fadeOutLeft",
"fadeOutLeftBig",
"fadeOutRight",
"fadeOutRightBig",
"fadeOutUp",
"fadeOutUpBig"
],
"flippers": [
"flip",
"flipInX",
"flipInY",
"flipOutX",
"flipOutY"
],
"lightspeed": [
"lightSpeedIn",
"lightSpeedOut"
],
"rotating_entrances": [
"rotateIn",
"rotateInDownLeft",
"rotateInDownRight",
"rotateInUpLeft",
"rotateInUpRight"
],
"rotating_exits": [
"rotateOut",
"rotateOutDownLeft",
"rotateOutDownRight",
"rotateOutUpLeft",
"rotateOutUpRight"
],
"specials": [
"hinge",
"rollIn",
"rollOut"
],
"zooming_entrances": [
"zoomIn",
"zoomInDown",
"zoomInLeft",
"zoomInRight",
"zoomInUp"
],
"zooming_exits": [
"zoomOut",
"zoomOutDown",
"zoomOutLeft",
"zoomOutRight",
"zoomOutUp"
],
"sliding_entrances": [
"slideInDown",
"slideInLeft",
"slideInRight",
"slideInUp"
],
"sliding_exits": [
"slideOutDown",
"slideOutLeft",
"slideOutRight",
"slideOutUp"
]
}

3340
public/assets/vendors/animate.css/animate.css vendored Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

12
public/assets/vendors/animate.css/bower.json vendored Executable file
View File

@@ -0,0 +1,12 @@
{
"name": "animate.css",
"main": "./animate.css",
"ignore": [
".*",
"source",
"*.yml",
"Gemfile",
"Gemfile.lock",
"*.md"
]
}

99
public/assets/vendors/animate.css/gulpfile.js vendored Executable file
View File

@@ -0,0 +1,99 @@
// Utilities
var fs = require('fs');
// Gulp
var gulp = require('gulp');
// Gulp plugins
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var header = require('gulp-header');
var autoprefixer = require('gulp-autoprefixer');
var runSequence = require('run-sequence');
var minify = require('gulp-cssnano');
var rename = require('gulp-rename');
// Misc/global vars
var pkg = JSON.parse(fs.readFileSync('package.json'));
var activatedAnimations = activateAnimations();
// Task options
var opts = {
destPath: './',
concatName: 'animate.css',
autoprefixer: {
browsers: ['last 2 versions'],
cascade: false
},
minRename: {
suffix: '.min'
},
banner: [
'@charset "UTF-8";\n',
'/*!',
' * <%= name %> -<%= homepage %>',
' * Version - <%= version %>',
' * Licensed under the MIT license - http://opensource.org/licenses/MIT',
' *',
' * Copyright (c) <%= new Date().getFullYear() %> <%= author.name %>',
' */\n\n'
].join('\n')
};
// ----------------------------
// Gulp task definitions
// ----------------------------
gulp.task('default', function() {
runSequence('createCSS', 'addHeader');
});
gulp.task('createCSS', function() {
return gulp.src(activatedAnimations)
.pipe(concat(opts.concatName))
.pipe(autoprefixer(opts.autoprefixer))
.pipe(gulp.dest(opts.destPath))
.pipe(rename(opts.minRename))
.pipe(minify({reduceIdents: {keyframes: false}}))
.pipe(gulp.dest(opts.destPath));
});
gulp.task('addHeader', function() {
return gulp.src('*.css')
.pipe(header(opts.banner, pkg))
.pipe(gulp.dest(opts.destPath));
});
// ----------------------------
// Helpers/functions
// ----------------------------
// Read the config file and return an array of the animations to be activated
function activateAnimations() {
var categories = JSON.parse(fs.readFileSync('animate-config.json')),
category, files, file,
target = [ 'source/_base.css' ],
count = 0;
for (category in categories) {
if (categories.hasOwnProperty(category)) {
files = categories[category];
for (var i = 0; i < files.length; ++i) {
target.push('source/' + category + '/' + files[i] + '.css');
count += 1;
}
}
}
if (!count) {
gutil.log('No animations activated.');
} else {
gutil.log(count + (count > 1 ? ' animations' : ' animation') + ' activated.');
}
return target;
}

View File

@@ -0,0 +1,35 @@
{
"name": "animate.css",
"version": "3.5.0",
"main": "animate.css",
"repository": {
"type": "git",
"url": "https://github.com/daneden/animate.css.git"
},
"author": {
"name": "Daniel Eden"
},
"homepage": "http://daneden.me/animate",
"license": "MIT",
"style": "./animate.css",
"jspm": {
"main": "animate.css!",
"format": "global",
"directories": {
"lib": "./"
}
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.0.0",
"gulp-header": "^1.7.1",
"gulp-rename": "^1.2.2",
"gulp-util": "^3.0.7",
"run-sequence": "^1.1.5"
},
"spm": {
"main": "./animate.css"
}
}

39
public/assets/vendors/autosize/.bower.json vendored Executable file
View File

@@ -0,0 +1,39 @@
{
"name": "autosize",
"description": "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.",
"dependencies": {},
"keywords": [
"textarea",
"form",
"ui"
],
"authors": [
{
"name": "Jack Moore",
"url": "http://www.jacklmoore.com",
"email": "hello@jacklmoore.com"
}
],
"license": "MIT",
"homepage": "http://www.jacklmoore.com/autosize",
"ignore": [],
"repository": {
"type": "git",
"url": "http://github.com/jackmoore/autosize.git"
},
"main": "dist/autosize.js",
"moduleType": [
"amd",
"node"
],
"version": "3.0.15",
"_release": "3.0.15",
"_resolution": {
"type": "version",
"tag": "3.0.15",
"commit": "82ba655a20a5939e93d967c883a3c413973bc480"
},
"_source": "https://github.com/jackmoore/autosize.git",
"_target": "^3.0.15",
"_originalSource": "autosize"
}

2
public/assets/vendors/autosize/.gitignore vendored Executable file
View File

@@ -0,0 +1,2 @@
node_modules/*
test/*

21
public/assets/vendors/autosize/LICENSE.md vendored Executable file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Jack Moore
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.

29
public/assets/vendors/autosize/bower.json vendored Executable file
View File

@@ -0,0 +1,29 @@
{
"name": "autosize",
"description": "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.",
"dependencies": {},
"keywords": [
"textarea",
"form",
"ui"
],
"authors": [
{
"name": "Jack Moore",
"url": "http://www.jacklmoore.com",
"email": "hello@jacklmoore.com"
}
],
"license": "MIT",
"homepage": "http://www.jacklmoore.com/autosize",
"ignore": [],
"repository": {
"type": "git",
"url": "http://github.com/jackmoore/autosize.git"
},
"main": "dist/autosize.js",
"moduleType": [
"amd",
"node"
]
}

87
public/assets/vendors/autosize/build.js vendored Executable file
View File

@@ -0,0 +1,87 @@
var pkg = require('./package.json');
var fs = require('fs');
var ugly = require('uglify-js');
var jshint = require('jshint').JSHINT;
var babel = require('babel');
var gaze = require('gaze');
function writeBower() {
var bower = {
name: pkg.config.bower.name,
description: pkg.description,
dependencies: pkg.dependencies,
keywords: pkg.keywords,
authors: [pkg.author],
license: pkg.license,
homepage: pkg.homepage,
ignore: pkg.config.bower.ignore,
repository: pkg.repository,
main: pkg.main,
moduleType: pkg.config.bower.moduleType,
};
fs.writeFile('bower.json', JSON.stringify(bower, null, '\t'));
return true;
}
function lint(full) {
jshint(full.toString(), {
browser: true,
undef: true,
unused: true,
immed: true,
eqeqeq: true,
eqnull: true,
noarg: true,
predef: ['define', 'module', 'exports', 'Set']
});
if (jshint.errors.length) {
jshint.errors.forEach(function (err) {
console.log(err.line+':'+err.character+' '+err.reason);
});
} else {
console.log('linted')
}
return true;
}
function build(code) {
var minified = ugly.minify(code, {fromString: true}).code;
var header = [
'/*!',
' '+pkg.config.title+' '+pkg.version,
' license: MIT',
' '+pkg.homepage,
'*/',
''
].join('\n');
fs.writeFile('dist/'+pkg.config.filename+'.js', header+code);
fs.writeFile('dist/'+pkg.config.filename+'.min.js', header+minified);
writeBower();
console.log('dist built');
}
function transform(filepath) {
babel.transformFile(filepath, {modules: 'umd'}, function (err,res) {
if (err) {
return console.log(err);
} else {
lint(res.code);
build(res.code);
}
});
}
gaze('src/'+pkg.config.filename+'.js', function(err, watcher){
// On file changed
this.on('changed', function(filepath) {
transform(filepath);
});
console.log('watching');
});
transform('src/'+pkg.config.filename+'.js');

72
public/assets/vendors/autosize/changelog.md vendored Executable file
View File

@@ -0,0 +1,72 @@
## Changelog
##### v.3.0.15 - 2016-1-26
* Used newer Event constructor, when available. Fixes #280.
##### v.3.0.14 - 2015-11-11
* Fixed memory leak on destroy. Merged #271, fixes #270.
* Fixed bug in old versions of Firefox (1-5), fixes #246.
##### v.3.0.13 - 2015-09-26
* Fixed scroll-bar jumpiness in iOS. Merged #261, fixes #207.
* Fixed reflowing of initial text in Chrome and Safari.
##### v.3.0.12 - 2015-09-14
* Merged changes were discarded when building new dist files. Merged #255, Fixes #257 for real this time.
##### v.3.0.11 - 2015-09-14
* Fixed regression from 3.0.10 that caused an error with ES5 browsers. Merged #255, Fixes #257.
##### v.3.0.10 - 2015-09-10
* Removed data attribute as a way of tracking which elements autosize has been assigned to. fixes #254, fixes #200.
##### v.3.0.9 - 2015-09-02
* Fixed issue with assigning autosize to detached nodes. Merged #253, Fixes #234.
##### v.3.0.8 - 2015-06-29
* Fixed the `autosize:resized` event not being triggered when the overflow changes. Fixes #244.
##### v.3.0.7 - 2015-06-29
* Fixed jumpy behavior in Windows 8.1 mobile. Fixes #239.
##### v.3.0.6 - 2015-05-19
* Renamed 'dest' folder to 'dist' to follow common conventions.
##### v.3.0.5 - 2015-05-18
* Do nothing in Node.js environment.
##### v.3.0.4 - 2015-05-05
* Added options object for indicating if the script should set the overflowX and overflowY. The default behavior lets the script control the overflows, which will normalize the appearance between browsers. Fixes #220.
##### v.3.0.3 - 2015-04-23
* Avoided adjusting the height for hidden textarea elements. Fixes #155.
##### v.3.0.2 - 2015-04-23
* Reworked to respect max-height of any unit-type. Fixes #191.
##### v.3.0.1 - 2015-04-23
* Fixed the destroy event so that it removes its own event handler. Fixes #218.
##### v.3.0.0 - 2015-04-15
* Added new methods for updating and destroying:
* autosize.update(elements)
* autosize.destroy(elements)
* Renamed custom events as to not use jQuery's custom events namespace:
* autosize.resized renamed to autosize:resized
* autosize.update renamed to autosize:update
* autosize.destroy renamed to autosize:destroy
##### v.2.0.1 - 2015-04-15
* Version bump for NPM publishing purposes
##### v.2.0.0 - 2015-02-25
* Smaller, simplier code-base
* New API. Example usage: `autosize(document.querySelectorAll(textarea));`
* Dropped jQuery dependency
* Dropped IE7-IE8 support
* Dropped optional parameters
* Closes #98, closes #106, closes #123, fixes #129, fixes #132, fixes #139, closes #140, closes #166, closes #168, closes #192, closes #193, closes #197

View File

@@ -0,0 +1,254 @@
/*!
Autosize 3.0.15
license: MIT
http://www.jacklmoore.com/autosize
*/
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define(['exports', 'module'], factory);
} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
factory(exports, module);
} else {
var mod = {
exports: {}
};
factory(mod.exports, mod);
global.autosize = mod.exports;
}
})(this, function (exports, module) {
'use strict';
var set = typeof Set === 'function' ? new Set() : (function () {
var list = [];
return {
has: function has(key) {
return Boolean(list.indexOf(key) > -1);
},
add: function add(key) {
list.push(key);
},
'delete': function _delete(key) {
list.splice(list.indexOf(key), 1);
} };
})();
var createEvent = function createEvent(name) {
return new Event(name);
};
try {
new Event('test');
} catch (e) {
// IE does not support `new Event()`
createEvent = function (name) {
var evt = document.createEvent('Event');
evt.initEvent(name, true, false);
return evt;
};
}
function assign(ta) {
var _ref = arguments[1] === undefined ? {} : arguments[1];
var _ref$setOverflowX = _ref.setOverflowX;
var setOverflowX = _ref$setOverflowX === undefined ? true : _ref$setOverflowX;
var _ref$setOverflowY = _ref.setOverflowY;
var setOverflowY = _ref$setOverflowY === undefined ? true : _ref$setOverflowY;
if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || set.has(ta)) return;
var heightOffset = null;
var overflowY = null;
var clientWidth = ta.clientWidth;
function init() {
var style = window.getComputedStyle(ta, null);
overflowY = style.overflowY;
if (style.resize === 'vertical') {
ta.style.resize = 'none';
} else if (style.resize === 'both') {
ta.style.resize = 'horizontal';
}
if (style.boxSizing === 'content-box') {
heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
} else {
heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
}
// Fix when a textarea is not on document body and heightOffset is Not a Number
if (isNaN(heightOffset)) {
heightOffset = 0;
}
update();
}
function changeOverflow(value) {
{
// Chrome/Safari-specific fix:
// When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
// made available by removing the scrollbar. The following forces the necessary text reflow.
var width = ta.style.width;
ta.style.width = '0px';
// Force reflow:
/* jshint ignore:start */
ta.offsetWidth;
/* jshint ignore:end */
ta.style.width = width;
}
overflowY = value;
if (setOverflowY) {
ta.style.overflowY = value;
}
resize();
}
function resize() {
var htmlTop = window.pageYOffset;
var bodyTop = document.body.scrollTop;
var originalHeight = ta.style.height;
ta.style.height = 'auto';
var endHeight = ta.scrollHeight + heightOffset;
if (ta.scrollHeight === 0) {
// If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
ta.style.height = originalHeight;
return;
}
ta.style.height = endHeight + 'px';
// used to check if an update is actually necessary on window.resize
clientWidth = ta.clientWidth;
// prevents scroll-position jumping
document.documentElement.scrollTop = htmlTop;
document.body.scrollTop = bodyTop;
}
function update() {
var startHeight = ta.style.height;
resize();
var style = window.getComputedStyle(ta, null);
if (style.height !== ta.style.height) {
if (overflowY !== 'visible') {
changeOverflow('visible');
}
} else {
if (overflowY !== 'hidden') {
changeOverflow('hidden');
}
}
if (startHeight !== ta.style.height) {
var evt = createEvent('autosize:resized');
ta.dispatchEvent(evt);
}
}
var pageResize = function pageResize() {
if (ta.clientWidth !== clientWidth) {
update();
}
};
var destroy = (function (style) {
window.removeEventListener('resize', pageResize, false);
ta.removeEventListener('input', update, false);
ta.removeEventListener('keyup', update, false);
ta.removeEventListener('autosize:destroy', destroy, false);
ta.removeEventListener('autosize:update', update, false);
set['delete'](ta);
Object.keys(style).forEach(function (key) {
ta.style[key] = style[key];
});
}).bind(ta, {
height: ta.style.height,
resize: ta.style.resize,
overflowY: ta.style.overflowY,
overflowX: ta.style.overflowX,
wordWrap: ta.style.wordWrap });
ta.addEventListener('autosize:destroy', destroy, false);
// IE9 does not fire onpropertychange or oninput for deletions,
// so binding to onkeyup to catch most of those events.
// There is no way that I know of to detect something like 'cut' in IE9.
if ('onpropertychange' in ta && 'oninput' in ta) {
ta.addEventListener('keyup', update, false);
}
window.addEventListener('resize', pageResize, false);
ta.addEventListener('input', update, false);
ta.addEventListener('autosize:update', update, false);
set.add(ta);
if (setOverflowX) {
ta.style.overflowX = 'hidden';
ta.style.wordWrap = 'break-word';
}
init();
}
function destroy(ta) {
if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
var evt = createEvent('autosize:destroy');
ta.dispatchEvent(evt);
}
function update(ta) {
if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
var evt = createEvent('autosize:update');
ta.dispatchEvent(evt);
}
var autosize = null;
// Do nothing in Node.js environment and IE8 (or lower)
if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
autosize = function (el) {
return el;
};
autosize.destroy = function (el) {
return el;
};
autosize.update = function (el) {
return el;
};
} else {
autosize = function (el, options) {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], function (x) {
return assign(x, options);
});
}
return el;
};
autosize.destroy = function (el) {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], destroy);
}
return el;
};
autosize.update = function (el) {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], update);
}
return el;
};
}
module.exports = autosize;
});

View File

@@ -0,0 +1,6 @@
/*!
Autosize 3.0.15
license: MIT
http://www.jacklmoore.com/autosize
*/
!function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.autosize=n.exports}}(this,function(e,t){"use strict";function n(e){function t(){var t=window.getComputedStyle(e,null);p=t.overflowY,"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),c="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(c)&&(c=0),i()}function n(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,p=t,f&&(e.style.overflowY=t),o()}function o(){var t=window.pageYOffset,n=document.body.scrollTop,o=e.style.height;e.style.height="auto";var i=e.scrollHeight+c;return 0===e.scrollHeight?void(e.style.height=o):(e.style.height=i+"px",v=e.clientWidth,document.documentElement.scrollTop=t,void(document.body.scrollTop=n))}function i(){var t=e.style.height;o();var i=window.getComputedStyle(e,null);if(i.height!==e.style.height?"visible"!==p&&n("visible"):"hidden"!==p&&n("hidden"),t!==e.style.height){var r=d("autosize:resized");e.dispatchEvent(r)}}var s=void 0===arguments[1]?{}:arguments[1],a=s.setOverflowX,l=void 0===a?!0:a,u=s.setOverflowY,f=void 0===u?!0:u;if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var c=null,p=null,v=e.clientWidth,h=function(){e.clientWidth!==v&&i()},y=function(t){window.removeEventListener("resize",h,!1),e.removeEventListener("input",i,!1),e.removeEventListener("keyup",i,!1),e.removeEventListener("autosize:destroy",y,!1),e.removeEventListener("autosize:update",i,!1),r["delete"](e),Object.keys(t).forEach(function(n){e.style[n]=t[n]})}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",y,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",i,!1),window.addEventListener("resize",h,!1),e.addEventListener("input",i,!1),e.addEventListener("autosize:update",i,!1),r.add(e),l&&(e.style.overflowX="hidden",e.style.wordWrap="break-word"),t()}}function o(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=d("autosize:destroy");e.dispatchEvent(t)}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=d("autosize:update");e.dispatchEvent(t)}}var r="function"==typeof Set?new Set:function(){var e=[];return{has:function(t){return Boolean(e.indexOf(t)>-1)},add:function(t){e.push(t)},"delete":function(t){e.splice(e.indexOf(t),1)}}}(),d=function(e){return new Event(e)};try{new Event("test")}catch(s){d=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var a=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(a=function(e){return e},a.destroy=function(e){return e},a.update=function(e){return e}):(a=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e,t)}),e},a.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e},a.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e}),t.exports=a});

View File

@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>Simple Autosize for textareas</title>
<style>
textarea {
padding: 10px;
vertical-align: top;
width: 200px;
}
textarea:focus {
outline-style: solid;
outline-width: 2px;
}
</style>
</head>
<body>
<h3>max-height 300px</h3>
<textarea style='max-height: 300px'>The coconut palm (also, cocoanut), Cocos nucifera, is a member of the family Arecaceae (palm family). It is the only accepted species in the genus Cocos.[2] The term coconut can refer to the entire coconut palm, the seed, or the fruit, which, botanically, is a drupe, not a nut. The spelling cocoanut is an archaic form of the word.[3] The term is derived from 16th-century Portuguese and Spanish coco, meaning "head" or "skull",[4] from the three small holes on the coconut shell that resemble human facial features.</textarea>
<h3>no max-height</h3>
<textarea>The coconut palm (also, cocoanut), Cocos nucifera, is a member of the family Arecaceae (palm family). It is the only accepted species in the genus Cocos.[2] The term coconut can refer to the entire coconut palm, the seed, or the fruit, which, botanically, is a drupe, not a nut. The spelling cocoanut is an archaic form of the word.[3] The term is derived from 16th-century Portuguese and Spanish coco, meaning "head" or "skull",[4] from the three small holes on the coconut shell that resemble human facial features.</textarea>
</body>
<script src='../dist/autosize.js'></script>
<script>
autosize(document.querySelectorAll('textarea'));
</script>
</html>

49
public/assets/vendors/autosize/package.json vendored Executable file
View File

@@ -0,0 +1,49 @@
{
"name": "autosize",
"description": "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.",
"version": "3.0.15",
"keywords": [
"textarea",
"form",
"ui"
],
"files": [
"dist",
"src"
],
"author": {
"name": "Jack Moore",
"url": "http://www.jacklmoore.com",
"email": "hello@jacklmoore.com"
},
"main": "dist/autosize.js",
"license": "MIT",
"homepage": "http://www.jacklmoore.com/autosize",
"demo": "http://www.jacklmoore.com/autosize",
"repository": {
"type": "git",
"url": "http://github.com/jackmoore/autosize.git"
},
"dependencies": {},
"devDependencies": {
"babel": "^5.4.3",
"gaze": "^0.5.1",
"jshint": "^2.5.6",
"uglify-js": "^2.4.22"
},
"config": {
"bower": {
"name": "autosize",
"ignore": [],
"moduleType": [
"amd",
"node"
]
},
"title": "Autosize",
"filename": "autosize"
},
"scripts": {
"build": "node build"
}
}

35
public/assets/vendors/autosize/readme.md vendored Executable file
View File

@@ -0,0 +1,35 @@
## Summary
Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.
#### Demo
Full documentation and a demo can be found at [jacklmoore.com/autosize](http://jacklmoore.com/autosize)
#### Install via NPM
```bash
npm install autosize
```
#### Browser compatibility
Chrome | Firefox | IE | Safari | iOS Safari | Android | Opera Mini | Windows Phone IE
------ | --------|----|--------|------------|---------|------------|------------------
yes | yes | 9 | yes | yes | 4 | ? | 8.1
#### Usage
The autosize function accepts a single textarea element, or an array or array-like object (such as a NodeList or jQuery collection) of textarea elements.
```javascript
// from a NodeList
autosize(document.querySelectorAll('textarea'));
// from a single Node
autosize(document.querySelector('textarea'));
// from a jQuery collection
autosize($('textarea'));
```
Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php)

218
public/assets/vendors/autosize/src/autosize.js vendored Executable file
View File

@@ -0,0 +1,218 @@
const set = (typeof Set === "function") ? new Set() : (function () {
const list = [];
return {
has(key) {
return Boolean(list.indexOf(key) > -1);
},
add(key) {
list.push(key);
},
delete(key) {
list.splice(list.indexOf(key), 1);
},
}
})();
let createEvent = (name)=> new Event(name);
try {
new Event('test');
} catch(e) {
// IE does not support `new Event()`
createEvent = (name)=> {
const evt = document.createEvent('Event');
evt.initEvent(name, true, false);
return evt;
};
}
function assign(ta, {setOverflowX = true, setOverflowY = true} = {}) {
if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || set.has(ta)) return;
let heightOffset = null;
let overflowY = null;
let clientWidth = ta.clientWidth;
function init() {
const style = window.getComputedStyle(ta, null);
overflowY = style.overflowY;
if (style.resize === 'vertical') {
ta.style.resize = 'none';
} else if (style.resize === 'both') {
ta.style.resize = 'horizontal';
}
if (style.boxSizing === 'content-box') {
heightOffset = -(parseFloat(style.paddingTop)+parseFloat(style.paddingBottom));
} else {
heightOffset = parseFloat(style.borderTopWidth)+parseFloat(style.borderBottomWidth);
}
// Fix when a textarea is not on document body and heightOffset is Not a Number
if (isNaN(heightOffset)) {
heightOffset = 0;
}
update();
}
function changeOverflow(value) {
{
// Chrome/Safari-specific fix:
// When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
// made available by removing the scrollbar. The following forces the necessary text reflow.
const width = ta.style.width;
ta.style.width = '0px';
// Force reflow:
/* jshint ignore:start */
ta.offsetWidth;
/* jshint ignore:end */
ta.style.width = width;
}
overflowY = value;
if (setOverflowY) {
ta.style.overflowY = value;
}
resize();
}
function resize() {
const htmlTop = window.pageYOffset;
const bodyTop = document.body.scrollTop;
const originalHeight = ta.style.height;
ta.style.height = 'auto';
let endHeight = ta.scrollHeight+heightOffset;
if (ta.scrollHeight === 0) {
// If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
ta.style.height = originalHeight;
return;
}
ta.style.height = endHeight+'px';
// used to check if an update is actually necessary on window.resize
clientWidth = ta.clientWidth;
// prevents scroll-position jumping
document.documentElement.scrollTop = htmlTop;
document.body.scrollTop = bodyTop;
}
function update() {
const startHeight = ta.style.height;
resize();
const style = window.getComputedStyle(ta, null);
if (style.height !== ta.style.height) {
if (overflowY !== 'visible') {
changeOverflow('visible');
}
} else {
if (overflowY !== 'hidden') {
changeOverflow('hidden');
}
}
if (startHeight !== ta.style.height) {
const evt = createEvent('autosize:resized');
ta.dispatchEvent(evt);
}
}
const pageResize = () => {
if (ta.clientWidth !== clientWidth) {
update();
}
};
const destroy = style => {
window.removeEventListener('resize', pageResize, false);
ta.removeEventListener('input', update, false);
ta.removeEventListener('keyup', update, false);
ta.removeEventListener('autosize:destroy', destroy, false);
ta.removeEventListener('autosize:update', update, false);
set.delete(ta);
Object.keys(style).forEach(key => {
ta.style[key] = style[key];
});
}.bind(ta, {
height: ta.style.height,
resize: ta.style.resize,
overflowY: ta.style.overflowY,
overflowX: ta.style.overflowX,
wordWrap: ta.style.wordWrap,
});
ta.addEventListener('autosize:destroy', destroy, false);
// IE9 does not fire onpropertychange or oninput for deletions,
// so binding to onkeyup to catch most of those events.
// There is no way that I know of to detect something like 'cut' in IE9.
if ('onpropertychange' in ta && 'oninput' in ta) {
ta.addEventListener('keyup', update, false);
}
window.addEventListener('resize', pageResize, false);
ta.addEventListener('input', update, false);
ta.addEventListener('autosize:update', update, false);
set.add(ta);
if (setOverflowX) {
ta.style.overflowX = 'hidden';
ta.style.wordWrap = 'break-word';
}
init();
}
function destroy(ta) {
if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
const evt = createEvent('autosize:destroy');
ta.dispatchEvent(evt);
}
function update(ta) {
if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
const evt = createEvent('autosize:update');
ta.dispatchEvent(evt);
}
let autosize = null;
// Do nothing in Node.js environment and IE8 (or lower)
if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
autosize = el => el;
autosize.destroy = el => el;
autosize.update = el => el;
} else {
autosize = (el, options) => {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], x => assign(x, options));
}
return el;
};
autosize.destroy = el => {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], destroy);
}
return el;
};
autosize.update = el => {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], update);
}
return el;
};
}
export default autosize;

View File

@@ -0,0 +1,30 @@
{
"name": "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"
},
"homepage": "https://github.com/dangrossman/daterangepicker",
"_release": "bc645d93e8",
"_resolution": {
"type": "branch",
"branch": "master",
"commit": "bc645d93e837905dcd38b04b8d9123978ea9f571"
},
"_source": "git@github.com:dangrossman/daterangepicker.git",
"_target": "master",
"_originalSource": "git@github.com:dangrossman/daterangepicker.git"
}

View File

@@ -0,0 +1,38 @@
# Date Range Picker
![Improvely.com](https://i.imgur.com/UTRlaar.png)
This date range picker component 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, a time picker, and predefined date ranges.
## [Documentation and Live Usage Examples](http://www.daterangepicker.com)
## [See It In a Live Application](https://awio.iljmp.com/5/drpdemogh)
## License
The MIT License (MIT)
Copyright (c) 2012-2018 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": "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,388 @@
.daterangepicker {
position: absolute;
color: inherit;
background-color: #fff;
border-radius: 4px;
border: 1px solid #ddd;
width: 278px;
max-width: none;
padding: 0;
margin-top: 7px;
top: 100px;
left: 20px;
z-index: 3001;
display: none;
font-family: arial;
font-size: 15px;
line-height: 1em;
}
.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.drop-up {
margin-top: -7px;
}
.daterangepicker.drop-up:before {
top: initial;
bottom: -7px;
border-bottom: initial;
border-top: 7px solid #ccc;
}
.daterangepicker.drop-up:after {
top: initial;
bottom: -6px;
border-bottom: initial;
border-top: 6px solid #fff;
}
.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar {
float: none;
}
.daterangepicker.single .drp-selected {
display: none;
}
.daterangepicker.show-calendar .drp-calendar {
display: block;
}
.daterangepicker.show-calendar .drp-buttons {
display: block;
}
.daterangepicker.auto-apply .drp-buttons {
display: none;
}
.daterangepicker .drp-calendar {
display: none;
max-width: 270px;
}
.daterangepicker .drp-calendar.left {
padding: 8px 0 8px 8px;
}
.daterangepicker .drp-calendar.right {
padding: 8px;
}
.daterangepicker .drp-calendar.single .calendar-table {
border: none;
}
.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span {
color: #fff;
border: solid black;
border-width: 0 2px 2px 0;
border-radius: 0;
display: inline-block;
padding: 3px;
}
.daterangepicker .calendar-table .next span {
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
.daterangepicker .calendar-table .prev span {
transform: rotate(135deg);
-webkit-transform: rotate(135deg);
}
.daterangepicker .calendar-table th, .daterangepicker .calendar-table td {
white-space: nowrap;
text-align: center;
vertical-align: middle;
min-width: 32px;
width: 32px;
height: 24px;
line-height: 24px;
font-size: 12px;
border-radius: 4px;
border: 1px solid transparent;
white-space: nowrap;
cursor: pointer;
}
.daterangepicker .calendar-table {
border: 1px solid #fff;
border-radius: 4px;
background-color: #fff;
}
.daterangepicker .calendar-table table {
width: 100%;
margin: 0;
border-spacing: 0;
border-collapse: collapse;
}
.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: 0 auto;
background: #eee;
border: 1px solid #eee;
padding: 2px;
outline: 0;
font-size: 12px;
}
.daterangepicker .calendar-time {
text-align: center;
margin: 4px auto 0 auto;
line-height: 30px;
position: relative;
}
.daterangepicker .calendar-time select.disabled {
color: #ccc;
cursor: not-allowed;
}
.daterangepicker .drp-buttons {
clear: both;
text-align: right;
padding: 8px;
border-top: 1px solid #ddd;
display: none;
line-height: 12px;
vertical-align: middle;
}
.daterangepicker .drp-selected {
display: inline-block;
font-size: 12px;
padding-right: 8px;
}
.daterangepicker .drp-buttons .btn {
margin-left: 8px;
font-size: 12px;
font-weight: bold;
padding: 4px 8px;
}
.daterangepicker.show-ranges .drp-calendar.left {
border-left: 1px solid #ddd;
}
.daterangepicker .ranges {
float: none;
text-align: left;
margin: 0;
}
.daterangepicker.show-calendar .ranges {
margin-top: 8px;
}
.daterangepicker .ranges ul {
list-style: none;
margin: 0 auto;
padding: 0;
width: 100%;
}
.daterangepicker .ranges li {
font-size: 12px;
padding: 8px 12px;
cursor: pointer;
}
.daterangepicker .ranges li:hover {
background-color: #eee;
}
.daterangepicker .ranges li.active {
background-color: #08c;
color: #fff;
}
/* Larger Screen Styling */
@media (min-width: 564px) {
.daterangepicker {
width: auto; }
.daterangepicker .ranges ul {
width: 140px; }
.daterangepicker.single .ranges ul {
width: 100%; }
.daterangepicker.single .drp-calendar.left {
clear: none; }
.daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .drp-calendar {
float: left; }
.daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .drp-calendar {
float: right; }
.daterangepicker.ltr {
direction: ltr;
text-align: left; }
.daterangepicker.ltr .drp-calendar.left {
clear: left;
margin-right: 0; }
.daterangepicker.ltr .drp-calendar.left .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.daterangepicker.ltr .drp-calendar.right {
margin-left: 0; }
.daterangepicker.ltr .drp-calendar.right .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0; }
.daterangepicker.ltr .drp-calendar.left .calendar-table {
padding-right: 8px; }
.daterangepicker.ltr .ranges, .daterangepicker.ltr .drp-calendar {
float: left; }
.daterangepicker.rtl {
direction: rtl;
text-align: right; }
.daterangepicker.rtl .drp-calendar.left {
clear: right;
margin-left: 0; }
.daterangepicker.rtl .drp-calendar.left .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0; }
.daterangepicker.rtl .drp-calendar.right {
margin-right: 0; }
.daterangepicker.rtl .drp-calendar.right .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.daterangepicker.rtl .drp-calendar.left .calendar-table {
padding-left: 12px; }
.daterangepicker.rtl .ranges, .daterangepicker.rtl .drp-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 .drp-calendar.left {
clear: none !important; } }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,374 @@
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="UTF-8" />
<title>A date range picker for Bootstrap</title>
<!--<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" />-->
<link rel="stylesheet" type="text/css" media="all" href="daterangepicker.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.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" checked="checked"> 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" checked="checked"> 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>
<center>
<input type="text" id="config-demo" class="form-control">
</center>
</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 + ')'); }).click();;
}
});
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

View File

@@ -0,0 +1,210 @@
<!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" />
<style type="text/css">
.demo { position: relative; }
.demo i {
position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;
}
</style>
</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>
</div>
<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="alwaysShowCalendars"> alwaysShowCalendars
</label>
</div>
</div>
<div class="col-md-4">
<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>
<script type="text/javascript" src="require.js" data-main="main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,141 @@
requirejs.config({
"paths": {
"jquery": "https://code.jquery.com/jquery-1.11.3.min",
"moment": "../../moment",
"daterangepicker": "../../daterangepicker"
}
});
requirejs(['jquery', 'moment', 'daterangepicker'] , function ($, moment) {
$(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')) {
options.locale = {
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
};
}
if (!$('#linkedCalendars').is(':checked'))
options.linkedCalendars = false;
if (!$('#autoUpdateInput').is(':checked'))
options.autoUpdateInput = 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 + ')'); });
}
});
});

View File

@@ -0,0 +1,36 @@
/*
RequireJS 2.2.0 Copyright jQuery Foundation and other contributors.
Released under MIT license, http://github.com/requirejs/requirejs/LICENSE
*/
var requirejs,require,define;
(function(ga){function ka(b,c,d,g){return g||""}function K(b){return"[object Function]"===Q.call(b)}function L(b){return"[object Array]"===Q.call(b)}function y(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function X(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));--d);}}function x(b,c){return la.call(b,c)}function e(b,c){return x(b,c)&&b[c]}function D(b,c){for(var d in b)if(x(b,d)&&c(b[d],d))break}function Y(b,c,d,g){c&&D(c,function(c,e){if(d||!x(b,e))!g||"object"!==
typeof c||!c||L(c)||K(c)||c instanceof RegExp?b[e]=c:(b[e]||(b[e]={}),Y(b[e],c,d,g))});return b}function z(b,c){return function(){return c.apply(b,arguments)}}function ha(b){throw b;}function ia(b){if(!b)return b;var c=ga;y(b.split("."),function(b){c=c[b]});return c}function F(b,c,d,g){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=g;d&&(c.originalError=d);return c}function ma(b){function c(a,n,b){var h,k,f,c,d,l,g,r;n=n&&n.split("/");var q=p.map,m=q&&q["*"];
if(a){a=a.split("/");k=a.length-1;p.nodeIdCompat&&U.test(a[k])&&(a[k]=a[k].replace(U,""));"."===a[0].charAt(0)&&n&&(k=n.slice(0,n.length-1),a=k.concat(a));k=a;for(f=0;f<k.length;f++)c=k[f],"."===c?(k.splice(f,1),--f):".."===c&&0!==f&&(1!==f||".."!==k[2])&&".."!==k[f-1]&&0<f&&(k.splice(f-1,2),f-=2);a=a.join("/")}if(b&&q&&(n||m)){k=a.split("/");f=k.length;a:for(;0<f;--f){d=k.slice(0,f).join("/");if(n)for(c=n.length;0<c;--c)if(b=e(q,n.slice(0,c).join("/")))if(b=e(b,d)){h=b;l=f;break a}!g&&m&&e(m,d)&&
(g=e(m,d),r=f)}!h&&g&&(h=g,l=r);h&&(k.splice(0,l,h),a=k.join("/"))}return(h=e(p.pkgs,a))?h:a}function d(a){E&&y(document.getElementsByTagName("script"),function(n){if(n.getAttribute("data-requiremodule")===a&&n.getAttribute("data-requirecontext")===l.contextName)return n.parentNode.removeChild(n),!0})}function m(a){var n=e(p.paths,a);if(n&&L(n)&&1<n.length)return n.shift(),l.require.undef(a),l.makeRequire(null,{skipMap:!0})([a]),!0}function r(a){var n,b=a?a.indexOf("!"):-1;-1<b&&(n=a.substring(0,
b),a=a.substring(b+1,a.length));return[n,a]}function q(a,n,b,h){var k,f,d=null,g=n?n.name:null,p=a,q=!0,m="";a||(q=!1,a="_@r"+(Q+=1));a=r(a);d=a[0];a=a[1];d&&(d=c(d,g,h),f=e(v,d));a&&(d?m=f&&f.normalize?f.normalize(a,function(a){return c(a,g,h)}):-1===a.indexOf("!")?c(a,g,h):a:(m=c(a,g,h),a=r(m),d=a[0],m=a[1],b=!0,k=l.nameToUrl(m)));b=!d||f||b?"":"_unnormalized"+(T+=1);return{prefix:d,name:m,parentMap:n,unnormalized:!!b,url:k,originalName:p,isDefine:q,id:(d?d+"!"+m:m)+b}}function u(a){var b=a.id,
c=e(t,b);c||(c=t[b]=new l.Module(a));return c}function w(a,b,c){var h=a.id,k=e(t,h);if(!x(v,h)||k&&!k.defineEmitComplete)if(k=u(a),k.error&&"error"===b)c(k.error);else k.on(b,c);else"defined"===b&&c(v[h])}function A(a,b){var c=a.requireModules,h=!1;if(b)b(a);else if(y(c,function(b){if(b=e(t,b))b.error=a,b.events.error&&(h=!0,b.emit("error",a))}),!h)g.onError(a)}function B(){V.length&&(y(V,function(a){var b=a[0];"string"===typeof b&&(l.defQueueMap[b]=!0);G.push(a)}),V=[])}function C(a){delete t[a];
delete Z[a]}function J(a,b,c){var h=a.map.id;a.error?a.emit("error",a.error):(b[h]=!0,y(a.depMaps,function(h,f){var d=h.id,g=e(t,d);!g||a.depMatched[f]||c[d]||(e(b,d)?(a.defineDep(f,v[d]),a.check()):J(g,b,c))}),c[h]=!0)}function H(){var a,b,c=(a=1E3*p.waitSeconds)&&l.startTime+a<(new Date).getTime(),h=[],k=[],f=!1,g=!0;if(!aa){aa=!0;D(Z,function(a){var l=a.map,e=l.id;if(a.enabled&&(l.isDefine||k.push(a),!a.error))if(!a.inited&&c)m(e)?f=b=!0:(h.push(e),d(e));else if(!a.inited&&a.fetched&&l.isDefine&&
(f=!0,!l.prefix))return g=!1});if(c&&h.length)return a=F("timeout","Load timeout for modules: "+h,null,h),a.contextName=l.contextName,A(a);g&&y(k,function(a){J(a,{},{})});c&&!b||!f||!E&&!ja||ba||(ba=setTimeout(function(){ba=0;H()},50));aa=!1}}function I(a){x(v,a[0])||u(q(a[0],null,!0)).init(a[1],a[2])}function O(a){a=a.currentTarget||a.srcElement;var b=l.onScriptLoad;a.detachEvent&&!ca?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=l.onScriptError;a.detachEvent&&!ca||a.removeEventListener("error",
b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function P(){var a;for(B();G.length;){a=G.shift();if(null===a[0])return A(F("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));I(a)}l.defQueueMap={}}var aa,da,l,R,ba,p={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},t={},Z={},ea={},G=[],v={},W={},fa={},Q=1,T=1;R={require:function(a){return a.require?a.require:a.require=l.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?
v[a.map.id]=a.exports:a.exports=v[a.map.id]={}},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return e(p.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};da=function(a){this.events=e(ea,a.id)||{};this.map=a;this.shim=e(p.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};da.prototype={init:function(a,b,c,h){h=h||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&
(c=z(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=c;this.inited=!0;this.ignore=h.ignore;h.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,--this.depCount,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;l.startTime=(new Date).getTime();var a=this.map;if(this.shim)l.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],z(this,function(){return a.prefix?this.callPlugin():
this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;W[a]||(W[a]=!0,l.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var h=this.exports,k=this.factory;if(!this.inited)x(l.defQueueMap,c)||this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(K(k)){if(this.events.error&&this.map.isDefine||g.onError!==
ha)try{h=l.execCb(c,k,b,h)}catch(d){a=d}else h=l.execCb(c,k,b,h);this.map.isDefine&&void 0===h&&((b=this.module)?h=b.exports:this.usingExports&&(h=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",A(this.error=a)}else h=k;this.exports=h;if(this.map.isDefine&&!this.ignore&&(v[c]=h,g.onResourceLoad)){var f=[];y(this.depMaps,function(a){f.push(a.normalizedMap||a)});g.onResourceLoad(l,this.map,f)}C(c);
this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var a=this.map,b=a.id,d=q(a.prefix);this.depMaps.push(d);w(d,"defined",z(this,function(h){var k,f,d=e(fa,this.map.id),M=this.map.name,r=this.map.parentMap?this.map.parentMap.name:null,m=l.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(h.normalize&&(M=h.normalize(M,function(a){return c(a,r,!0)})||
""),f=q(a.prefix+"!"+M,this.map.parentMap),w(f,"defined",z(this,function(a){this.map.normalizedMap=f;this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),h=e(t,f.id)){this.depMaps.push(f);if(this.events.error)h.on("error",z(this,function(a){this.emit("error",a)}));h.enable()}}else d?(this.map.url=l.nameToUrl(d),this.load()):(k=z(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),k.error=z(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];D(t,function(a){0===
a.map.id.indexOf(b+"_unnormalized")&&C(a.map.id)});A(a)}),k.fromText=z(this,function(h,c){var d=a.name,f=q(d),M=S;c&&(h=c);M&&(S=!1);u(f);x(p.config,b)&&(p.config[d]=p.config[b]);try{g.exec(h)}catch(e){return A(F("fromtexteval","fromText eval for "+b+" failed: "+e,e,[b]))}M&&(S=!0);this.depMaps.push(f);l.completeLoad(d);m([d],k)}),h.load(a.name,m,k,p))}));l.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){Z[this.map.id]=this;this.enabling=this.enabled=!0;y(this.depMaps,z(this,function(a,
b){var c,h;if("string"===typeof a){a=q(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=e(R,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;w(a,"defined",z(this,function(a){this.undefed||(this.defineDep(b,a),this.check())}));this.errback?w(a,"error",z(this,this.errback)):this.events.error&&w(a,"error",z(this,function(a){this.emit("error",a)}))}c=a.id;h=t[c];x(R,c)||!h||h.enabled||l.enable(a,this)}));D(this.pluginMaps,z(this,function(a){var b=e(t,a.id);
b&&!b.enabled&&l.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){y(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};l={config:p,contextName:b,registry:t,defined:v,urlFetched:W,defQueue:G,defQueueMap:{},Module:da,makeModuleMap:q,nextTick:g.nextTick,onError:A,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");if("string"===typeof a.urlArgs){var b=
a.urlArgs;a.urlArgs=function(a,c){return(-1===c.indexOf("?")?"?":"&")+b}}var c=p.shim,h={paths:!0,bundles:!0,config:!0,map:!0};D(a,function(a,b){h[b]?(p[b]||(p[b]={}),Y(p[b],a,!0,!0)):p[b]=a});a.bundles&&D(a.bundles,function(a,b){y(a,function(a){a!==b&&(fa[a]=b)})});a.shim&&(D(a.shim,function(a,b){L(a)&&(a={deps:a});!a.exports&&!a.init||a.exportsFn||(a.exportsFn=l.makeShimExports(a));c[b]=a}),p.shim=c);a.packages&&y(a.packages,function(a){var b;a="string"===typeof a?{name:a}:a;b=a.name;a.location&&
(p.paths[b]=a.location);p.pkgs[b]=a.name+"/"+(a.main||"main").replace(na,"").replace(U,"")});D(t,function(a,b){a.inited||a.map.unnormalized||(a.map=q(b,null,!0))});(a.deps||a.callback)&&l.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ga,arguments));return b||a.exports&&ia(a.exports)}},makeRequire:function(a,n){function m(c,d,f){var e,r;n.enableBuildCallback&&d&&K(d)&&(d.__requireJsBuild=!0);if("string"===typeof c){if(K(d))return A(F("requireargs",
"Invalid require call"),f);if(a&&x(R,c))return R[c](t[a.id]);if(g.get)return g.get(l,c,a,m);e=q(c,a,!1,!0);e=e.id;return x(v,e)?v[e]:A(F("notloaded",'Module name "'+e+'" has not been loaded yet for context: '+b+(a?"":". Use require([])")))}P();l.nextTick(function(){P();r=u(q(null,a));r.skipMap=n.skipMap;r.init(c,d,f,{enabled:!0});H()});return m}n=n||{};Y(m,{isBrowser:E,toUrl:function(b){var d,f=b.lastIndexOf("."),g=b.split("/")[0];-1!==f&&("."!==g&&".."!==g||1<f)&&(d=b.substring(f,b.length),b=b.substring(0,
f));return l.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return x(v,q(b,a,!1,!0).id)},specified:function(b){b=q(b,a,!1,!0).id;return x(v,b)||x(t,b)}});a||(m.undef=function(b){B();var c=q(b,a,!0),f=e(t,b);f.undefed=!0;d(b);delete v[b];delete W[c.url];delete ea[b];X(G,function(a,c){a[0]===b&&G.splice(c,1)});delete l.defQueueMap[b];f&&(f.events.defined&&(ea[b]=f.events),C(b))});return m},enable:function(a){e(t,a.id)&&u(a).enable()},completeLoad:function(a){var b,c,d=e(p.shim,a)||{},g=d.exports;
for(B();G.length;){c=G.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);I(c)}l.defQueueMap={};c=e(t,a);if(!b&&!x(v,a)&&c&&!c.inited)if(!p.enforceDefine||g&&ia(g))I([a,d.deps||[],d.exportsFn]);else return m(a)?void 0:A(F("nodefine","No define call for "+a,null,[a]));H()},nameToUrl:function(a,b,c){var d,k,f,m;(d=e(p.pkgs,a))&&(a=d);if(d=e(fa,a))return l.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=p.paths;k=a.split("/");for(f=k.length;0<f;--f)if(m=k.slice(0,f).join("/"),
m=e(d,m)){L(m)&&(m=m[0]);k.splice(0,f,m);break}d=k.join("/");d+=b||(/^data\:|^blob\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":p.baseUrl)+d}return p.urlArgs&&!/^blob\:/.test(d)?d+p.urlArgs(a,d):d},load:function(a,b){g.load(l,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||oa.test((a.currentTarget||a.srcElement).readyState))N=null,a=O(a),l.completeLoad(a.id)},onScriptError:function(a){var b=O(a);if(!m(b.id)){var c=[];
D(t,function(a,d){0!==d.indexOf("_@r")&&y(a.depMaps,function(a){if(a.id===b.id)return c.push(d),!0})});return A(F("scripterror",'Script error for "'+b.id+(c.length?'", needed by: '+c.join(", "):'"'),a,[b.id]))}}};l.require=l.makeRequire();return l}function pa(){if(N&&"interactive"===N.readyState)return N;X(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return N=b});return N}var g,B,C,H,O,I,N,P,u,T,qa=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ra=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
U=/\.js$/,na=/^\.\//;B=Object.prototype;var Q=B.toString,la=B.hasOwnProperty,E=!("undefined"===typeof window||"undefined"===typeof navigator||!window.document),ja=!E&&"undefined"!==typeof importScripts,oa=E&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,ca="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),J={},w={},V=[],S=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(K(requirejs))return;w=requirejs;requirejs=void 0}"undefined"===typeof require||
K(require)||(w=require,require=void 0);g=requirejs=function(b,c,d,m){var r,q="_";L(b)||"string"===typeof b||(r=b,L(c)?(b=c,c=d,d=m):b=[]);r&&r.context&&(q=r.context);(m=e(J,q))||(m=J[q]=g.s.newContext(q));r&&m.configure(r);return m.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.2.0";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=E;B=g.s={contexts:J,newContext:ma};g({});y(["toUrl",
"undef","defined","specified"],function(b){g[b]=function(){var c=J._;return c.require[b].apply(c,arguments)}});E&&(C=B.head=document.getElementsByTagName("head")[0],H=document.getElementsByTagName("base")[0])&&(C=B.head=H.parentNode);g.onError=ha;g.createNode=function(b,c,d){c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var m=b&&b.config||
{},e;if(E){e=g.createNode(m,c,d);e.setAttribute("data-requirecontext",b.contextName);e.setAttribute("data-requiremodule",c);!e.attachEvent||e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code")||ca?(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)):(S=!0,e.attachEvent("onreadystatechange",b.onScriptLoad));e.src=d;if(m.onNodeCreated)m.onNodeCreated(e,m,c,d);P=e;H?C.insertBefore(e,H):C.appendChild(e);P=null;return e}if(ja)try{setTimeout(function(){},
0),importScripts(d),b.completeLoad(c)}catch(q){b.onError(F("importscripts","importScripts failed for "+c+" at "+d,q,[c]))}};E&&!w.skipDataMain&&X(document.getElementsByTagName("script"),function(b){C||(C=b.parentNode);if(O=b.getAttribute("data-main"))return u=O,w.baseUrl||-1!==u.indexOf("!")||(I=u.split("/"),u=I.pop(),T=I.length?I.join("/")+"/":"./",w.baseUrl=T),u=u.replace(U,""),g.jsExtRegExp.test(u)&&(u=O),w.deps=w.deps?w.deps.concat(u):[u],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&
(d=c,c=b,b=null);L(c)||(d=c,c=null);!c&&K(d)&&(c=[],d.length&&(d.toString().replace(qa,ka).replace(ra,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));S&&(e=P||pa())&&(b||(b=e.getAttribute("data-requiremodule")),g=J[e.getAttribute("data-requirecontext")]);g?(g.defQueue.push([b,c,d]),g.defQueueMap[b]=!0):V.push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(w)}})(this);

View File

@@ -0,0 +1,11 @@
# Browserify example
Two steps need to be done for this to work
In the project root
npm install
In this folder
../../node_modules/.bin/browserify main.js -o bundle.js

View File

@@ -0,0 +1,209 @@
<!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" />
<style type="text/css">
.demo { position: relative; }
.demo i {
position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;
}
</style>
</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>
</div>
<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="alwaysShowCalendars"> alwaysShowCalendars
</label>
</div>
</div>
<div class="col-md-4">
<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>
<script type="text/javascript" src="bundle.js"></script>
</body>
</html>

View File

@@ -0,0 +1,135 @@
require('../../daterangepicker.js');
var $ = require('jquery'),
moment = require('moment');
$(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')) {
options.locale = {
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
};
}
if (!$('#linkedCalendars').is(':checked'))
options.linkedCalendars = false;
if (!$('#autoUpdateInput').is(':checked'))
options.autoUpdateInput = 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 + ')'); });
}
});

View File

@@ -0,0 +1,17 @@
Package.describe({
name: 'dangrossman:bootstrap-daterangepicker',
version: '3.0.3',
summary: 'Date range picker component',
git: 'https://github.com/dangrossman/daterangepicker',
documentation: 'README.md'
});
Package.onUse(function(api) {
api.versionsFrom('METEOR@0.9.0.1');
api.use('momentjs:moment@2.22.1', ["client"]);
api.use('jquery@3.3.1', ["client"]);
api.addFiles('daterangepicker.js', ["client"]);
api.addFiles('daterangepicker.css', ["client"]);
});

View File

@@ -0,0 +1,32 @@
{
"name": "daterangepicker",
"version": "3.0.3",
"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/daterangepicker.git"
},
"author": {
"name": "Dan Grossman",
"email": "dan@dangrossman.info",
"url": "http://www.dangrossman.info"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/dangrossman/daterangepicker/issues"
},
"homepage": "https://github.com/dangrossman/daterangepicker",
"dependencies": {
"jquery": ">=1.10",
"moment": "^2.9.0"
},
"devDependencies": {
"node-sass": "^3.4.2"
}
}

View File

@@ -0,0 +1,744 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Date Range Picker &mdash; JavaScript Date &amp; Time Picker Library</title>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/trianglify/0.2.1/trianglify.min.js"></script>
<script type="text/javascript" src="daterangepicker.js"></script>
<link rel="stylesheet" type="text/css" href="daterangepicker.css" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">
<script src="website.js"></script>
<link rel="stylesheet" type="text/css" href="website.css" />
<meta name="google-site-verification" content="1fP-Eo9i1ozV4MUlqZv2vsLv1r7tvYutUb6i38v0_vg" />
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-dark bg-dark" style="padding: 0; justify-content: space-between">
<div class="container">
<ul class="navbar-nav">
<li class="nav-item" style="padding-left: 0"><a class="nav-link" href="/" style="color: #eeeeee"><i class="fa fa-calendar"></i>&nbsp; Date Range Picker</a></li>
</ul>
<ul class="navbar-nav">
<li class="nav-item"><a class="nav-link" href="https://www.improvely.com" style="color: #33beff"><i class="fa fa-chart-bar"></i>&nbsp; Improvely</a></li>
<li class="nav-item"><a class="nav-link" href="https://www.w3counter.com" style="color: #ff9999"><i class="fa fa-chart-pie"></i>&nbsp; W3Counter</a></li>
<li class="nav-item"><a class="nav-link" href="https://www.websitegoodies.com" style="color: #f49a16"><i class="fa fa-wrench"></i>&nbsp; Website Goodies</a></li>
</ul>
</div>
</nav>
<div id="jumbo">
<div class="container">
<div class="row">
<div class="col-md-6 col-sm-12">
<h1 style="margin: 0 0 10px 0">Date Range Picker</h1>
<p style="font-size: 18px; margin-bottom: 0">
A JavaScript component for choosing date ranges,
dates and times.
</p>
</div>
<div class="col-md-6 col-sm-12" style="text-align: right; padding-right: 0">
<div style="margin-bottom: 10px; margin-right: 15px">
<a href="https://github.com/dangrossman/daterangepicker" class="btn btn-light"><i class="fab fa-github-alt"></i>&nbsp; View on GitHub</a>
&nbsp;
<a href="https://github.com/dangrossman/daterangepicker/archive/master.zip" class="btn btn-success"><i class="fas fa-download"></i>&nbsp; Download ZIP</a>
</div>
<div style="margin-right: 0px">
<iframe src="https://ghbtns.com/github-btn.html?user=dangrossman&repo=daterangepicker&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=dangrossman&repo=daterangepicker&type=watch&count=true&size=large&v=2" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=dangrossman&repo=daterangepicker&type=fork&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
</div>
</div>
</div>
</div>
</div>
<div class="container" style="padding: 0 30px" id="main">
<div class="row">
<div class="leftcol d-none d-lg-block d-xl-block">
<div id="menu" class="list-group" style="margin-bottom: 10px">
<a class="list-group-item" href="#usage">Getting Started</a>
<a class="list-group-item" href="#examples">Examples</a>
<a class="list-group-item" href="#options">Options, Methods &amp; Events</a>
<a class="list-group-item" href="#config">Configuration Generator</a>
<a class="list-group-item" href="#license">License &amp; Comments</a>
</div>
<div style="width: 300px; min-width: 300px">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- DRP Responsive -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9095657276960731"
data-ad-slot="8963174596"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
<div class="rightcol">
<p>Originally created for reports at <a href="https://www.improvely.com">Improvely</a>, the Date Range Picker can be attached to any webpage element to pop up two calendars for selecting dates, times, or predefined ranges like "Last 30 Days".</p>
<a style="display: block; height: 300px; background: url('drp.png') top right no-repeat; background-size: cover; border: 1px solid #ccc; margin-bottom: 30px" href="https://awio.iljmp.com/5/drpdemo" title="Click for a Live Demo"></a>
<h1><a id="usage" href="#usage">Getting Started</a></h1>
<p>
To get started, include jQuery, Moment.js and Date Range Picker's files in your webpage:
</p>
<script src="https://gist.github.com/dangrossman/4879503153c6a7a0b3b6ebd64e0383b7.js"></script>
<p style="margin-bottom: 10px">
Then attach a date range picker to whatever you want to trigger it:
</p>
<div class="row">
<div class="col-8">
<label>Code:</label>
<script src="https://gist.github.com/dangrossman/f460cf1243d8ffb08c749730e89c2f3d.js"></script>
</div>
<div class="col-4">
<label>Produces:</label>
<input type="text" name="dates" class="form-control pull-right" />
<script>
$(function() {
$('input[name="dates"]').daterangepicker({ startDate: moment(), endDate: moment().add(2, 'day')});
})
</script>
</div>
</div>
<p>
You can customize Date Range Picker with options, and get notified when the user chooses new dates by providing a callback function.
</p>
<h1><a id="examples" href="#examples">Examples</a></h1>
<!-- Example 1 -->
<h2><a data-toggle="nothing" href="#example1">Simple Date Range Picker With a Callback</a></h2>
<div class="collapsable" id="example1">
<div class="row">
<div class="col-8">
<label>Code:</label>
<script src="https://gist.github.com/dangrossman/e118af4dbadc5177d7494dba9d3295d1.js"></script>
</div>
<div class="col-4">
<label>Produces:</label>
<input type="text" name="daterange" class="form-control" value="1/01/2018 - 01/15/2018" />
<script>
$(function() {
$('input[name="daterange"]').daterangepicker({
opens: 'left'
}, function(start, end, label) {
console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
});
});
</script>
</div>
</div>
</div>
<!-- Example 2 -->
<h2><a data-toggle="nothing" href="#example2">Date Range Picker With Times</a></h2>
<div class="collapsable" id="example2">
<div class="row">
<div class="col-8">
<label>Code:</label>
<script src="https://gist.github.com/dangrossman/14db17599e24652db7401ed2448eb91a.js"></script>
</div>
<div class="col-4">
<label>Produces:</label>
<input type="text" name="datetimes" class="form-control pull-right" />
<script>
$(function() {
$('input[name="datetimes"]').daterangepicker({
timePicker: true,
startDate: moment().startOf('hour'),
endDate: moment().startOf('hour').add(32, 'hour'),
locale: {
format: 'M/DD hh:mm A'
}
});
});
</script>
</div>
</div>
</div>
<!-- Example 3 -->
<h2><a data-toggle="nothing" href="#example3">Single Date Picker</a></h2>
<div class="collapsable" id="example3">
<div class="row">
<div class="col-8">
<label>Code:</label>
<script src="https://gist.github.com/dangrossman/98d8f1c304328c191b1ad33ac21354fd.js"></script>
</div>
<div class="col-4">
<label>Produces:</label>
<input type="text" name="birthday" class="form-control pull-right" value="10/24/1984" />
<script>
$(function() {
$('input[name="birthday"]').daterangepicker({
singleDatePicker: true,
showDropdowns: true,
minYear: 1901,
maxYear: parseInt(moment().format('YYYY'),10)
}, function(start, end, label) {
var years = moment().diff(start, 'years');
alert("You are " + years + " years old!");
});
});
</script>
</div>
</div>
</div>
<!-- Example 4 -->
<h2><a data-toggle="nothing" href="#example4">Predefined Date Ranges</a></h2>
<div class="collapsable" id="example4">
<div class="row">
<div class="col-8">
<label>Code:</label>
<script src="https://gist.github.com/dangrossman/8c6747b82572bc860364f17258004dbb.js"></script>
</div>
<div class="col-4">
<label>Produces:</label>
<div id="reportrange" class="pull-right" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
<i class="fa fa-calendar"></i>&nbsp;
<span></span> <i class="fa fa-caret-down"></i>
</div>
<script type="text/javascript">
$(function() {
var start = moment().subtract(29, 'days');
var end = moment();
function cb(start, end) {
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
}
$('#reportrange').daterangepicker({
startDate: start,
endDate: end,
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')]
}
}, cb);
cb(start, end);
});
</script>
</div>
</div>
</div>
<!-- Example 5 -->
<h2><a data-toggle="nothing" href="#example5">Input Initially Empty</a></h2>
<div class="collapsable" id="example5">
<div class="row">
<div class="col-8">
<label>Code:</label>
<script src="https://gist.github.com/dangrossman/d50376f3467f69e7fb5570afd07dc921.js"></script>
</div>
<div class="col-4">
<label>Produces:</label>
<input type="text" name="datefilter" class="form-control pull-right" value="" />
<script type="text/javascript">
$(function() {
$('input[name="datefilter"]').daterangepicker({
autoUpdateInput: false,
locale: {
cancelLabel: 'Clear'
}
});
$('input[name="datefilter"]').on('apply.daterangepicker', function(ev, picker) {
$(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY'));
});
$('input[name="datefilter"]').on('cancel.daterangepicker', function(ev, picker) {
$(this).val('');
});
});
</script>
</div>
</div>
</div>
<h1 style="margin-top: 30px"><a id="options" href="#options">Options</a></h1>
<ul class="nobullets">
<li>
<code>startDate</code> (Date or string) The beginning date of the initially selected date range. If you provide a string, it must match the date format string set in your <code>locale</code> setting.
</li>
<li>
<code>endDate</code>: (Date or string) The end date of the initially selected date range.
</li>
<li>
<code>minDate</code>: (Date or string) The earliest date a user may select.
</li>
<li>
<code>maxDate</code>: (Date or string) The latest date a user may select.
</li>
<li>
<code>maxSpan</code>: (object) The maximum span between the selected start and end dates. Check off <code>maxSpan</code> in the configuration generator for an example of how to use this. You can provide any object the <code>moment</code> library would let you add to a date.
</li>
<li>
<code>showDropdowns</code>: (true/false) Show year and month select boxes above calendars to jump to a specific month and year.
</li>
<li>
<code>minYear</code>: (number) The minimum year shown in the dropdowns when <code>showDropdowns</code> is set to true.
</li>
<li>
<code>maxYear</code>: (number) The maximum year shown in the dropdowns when <code>showDropdowns</code> is set to true.
</li>
<li>
<code>showWeekNumbers</code>: (true/false) Show localized week numbers at the start of each week on the calendars.
</li>
<li>
<code>showISOWeekNumbers</code>: (true/false) Show ISO week numbers at the start of each week on the calendars.
</li>
<li>
<code>timePicker</code>: (true/false) Adds select boxes to choose times in addition to dates.
</li>
<li>
<code>timePickerIncrement</code>: (number) Increment of the minutes selection list for times (i.e. 30 to allow only selection of times ending in 0 or 30).
</li>
<li>
<code>timePicker24Hour</code>: (true/false) Use 24-hour instead of 12-hour times, removing the AM/PM selection.
</li>
<li>
<code>timePickerSeconds</code>: (true/false) Show seconds in the timePicker.
</li>
<li>
<code>ranges</code>: (object) Set predefined date ranges the user can select from. Each key is the label for the range, and its value an array with two dates representing the bounds of the range. Click <code>ranges</code> in the configuration generator for examples.
</li>
<li>
<code>showCustomRangeLabel</code>: (true/false) Displays "Custom Range" at
the end of the list of predefined ranges, when the <code>ranges</code> option is used.
This option will be highlighted whenever the current date range selection does not match one of the predefined ranges. Clicking it will display the calendars to select a new range.
</li>
<li>
<code>alwaysShowCalendars</code>: (true/false) Normally, if you use the <code>ranges</code> option to specify pre-defined date ranges, calendars for choosing a custom date range are not shown until the user clicks "Custom Range". When this option is set to true, the calendars for choosing a custom date range are always shown instead.
</li>
<li>
<code>opens</code>: ('left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to.
</li>
<li>
<code>drops</code>: ('down'/'up') Whether the picker appears below (default) or above the HTML element it's attached to.
</li>
<li>
<code>buttonClasses</code>: (string) CSS class names that will be added to both the apply and cancel buttons.
</li>
<li>
<code>applyButtonClasses</code>: (string) CSS class names that will be added only to the apply button.
</li>
<li>
<code>cancelButtonClasses</code>: (string) CSS class names that will be added only to the cancel button.
</li>
<li>
<code>locale</code>: (object) Allows you to provide localized strings for buttons and labels, customize the date format, and change the first day of week for the calendars.
Check off <code>locale</code> in the configuration generator to see how
to customize these options.
</li>
<li>
<code>singleDatePicker</code>: (true/false) Show only a single calendar to choose one date, instead of a range picker with two calendars. The start and end dates provided to your callback will be the same single date chosen.
</li>
<li>
<code>autoApply</code>: (true/false) Hide the apply and cancel buttons, and automatically apply a new date range as soon as two dates are clicked.
</li>
<li>
<code>linkedCalendars</code>: (true/false) When enabled, the two calendars displayed will always be for two sequential months (i.e. January and February), and both will be advanced when clicking the left or right arrows above the calendars. When disabled, the two calendars can be individually advanced and display any month/year.
</li>
<li>
<code>isInvalidDate</code>: (function) A function that is passed each date in the two
calendars before they are displayed, and may return true or false to indicate whether
that date should be available for selection or not.
</li>
<li>
<code>isCustomDate</code>: (function) A function that is passed each date in the two
calendars before they are displayed, and may return a string or array of CSS class names
to apply to that date's calendar cell.
</li>
<li>
<code>autoUpdateInput</code>: (true/false) Indicates whether the date range picker should
automatically update the value of the <code>&lt;input&gt;</code> element it's attached to at initialization and when the selected dates change.
</li>
<li>
<code>parentEl</code>: (string) jQuery selector of the parent element that the date range picker will be added to, if not provided this will be 'body'
</li>
</ul>
<h1 style="margin-top: 30px"><a id="methods" href="#methods">Methods</a></h1>
<p>
You can programmatically update the <code>startDate</code> and <code>endDate</code>
in the picker using the <code>setStartDate</code> and <code>setEndDate</code> methods.
You can access the Date Range Picker object and its functions and properties through
data properties of the element you attached it to.
</p>
<script src="https://gist.github.com/dangrossman/8ff9b1220c9b5682e8bd.js"></script>
<br/>
<ul class="nobullets">
<li>
<code>setStartDate(Date or string)</code>: Sets the date range picker's currently selected start date to the provided date
</li>
<li>
<code>setEndDate(Date or string)</code>: Sets the date range picker's currently selected end date to the provided date
</li>
</ul>
<p style="margin: 0"><b>Example usage:</b></p>
<script src="https://gist.github.com/dangrossman/e1a8effbaeacb50a1e31.js"></script>
<h1 style="margin-top: 30px"><a id="events" href="#events">Events</a></h1>
<p>
Several events are triggered on the element you attach the picker to, which you can listen for.
</p>
<ul class="nobullets">
<li>
<code>show.daterangepicker</code>: Triggered when the picker is shown
</li>
<li>
<code>hide.daterangepicker</code>: Triggered when the picker is hidden
</li>
<li>
<code>showCalendar.daterangepicker</code>: Triggered when the calendar(s) are shown
</li>
<li>
<code>hideCalendar.daterangepicker</code>: Triggered when the calendar(s) are hidden
</li>
<li>
<code>apply.daterangepicker</code>: Triggered when the apply button is clicked,
or when a predefined range is clicked
</li>
<li>
<code>cancel.daterangepicker</code>: Triggered when the cancel button is clicked
</li>
</ul>
<p>
Some applications need a "clear" instead of a "cancel" functionality, which can be achieved by changing the button label and watching for the cancel event:
</p>
<script src="https://gist.github.com/dangrossman/1bea78da703f2896564d.js"></script>
<br/>
<p>
While passing in a callback to the constructor is the easiest way to listen for changes in the selected date range, you can also do something every time the apply button is clicked even if the selection hasn't changed:
</p>
<script src="https://gist.github.com/dangrossman/0c6c911fea1459b5fd13.js"></script>
<h1 style="margin-top: 30px"><a id="config" href="#config">Configuration Generator</a></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/2017">
</div>
<div class="form-group">
<label for="endDate">endDate</label>
<input type="text" class="form-control" id="endDate" value="07/15/2017">
</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 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>
<div class="col-md-4">
<div class="checkbox">
<label>
<input type="checkbox" id="showDropdowns"> showDropdowns
</label>
</div>
<div class="form-group">
<label for="minYear">minYear</label>
<input type="text" class="form-control" id="minYear" value="">
</div>
<div class="form-group">
<label for="maxYear">maxYear</label>
<input type="text" class="form-control" id="maxYear" value="">
</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="singleDatePicker"> singleDatePicker
</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="maxSpan"> maxSpan (example value)
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="locale"> locale (example settings)
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="autoApply"> autoApply
</label>
</div>
</div>
<div class="col-md-4">
<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="applyButtonClasses">applyButtonClasses</label>
<input type="text" class="form-control" id="applyButtonClasses" value="btn-primary">
</div>
<div class="form-group">
<label for="cancelButtonClasses">cancelButtonClasses</label>
<input type="text" class="form-control" id="cancelButtonClasses" value="btn-default">
</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="alwaysShowCalendars"> alwaysShowCalendars
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="showCustomRangeLabel" checked="checked"> showCustomRangeLabel
</label>
</div>
<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>
</div>
</form>
</div>
<div class="row">
<div class="col-4 demo">
<div style="position: relative">
<h2 style="margin-bottom: 15px">Your Date Range Picker</h2>
<input type="text" id="config-demo" class="form-control">
</div>
</div>
<div class="col-8">
<h2 style="margin-bottom: 15px">Your Configuration to Copy</h2>
<div class="well">
<textarea id="config-text" style="height: 300px; width: 100%; padding: 10px"></textarea>
</div>
</div>
</div>
<!-- License -->
<h1 style="margin-top: 30px"><a id="license" href="#license">License</a></h1>
<p>The MIT License (MIT)</p>
<p>Copyright (c) 2012-2018 <a href="http://www.dangrossman.info">Dan Grossman</a></p>
<p>
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:
</p>
<p>
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
</p>
<p>
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.
</p>
<h1 style="margin-top: 30px"><a id="config" href="#comments">Comments</a></h1>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_url = 'http://www.dangrossman.info/2012/08/20/a-date-range-picker-for-twitter-bootstrap/';
var disqus_identifier = '1045 http://www.dangrossman.info/?p=1045';
var disqus_container_id = 'disqus_thread';
var disqus_shortname = 'dangrossman';
var disqus_title = "A Date Range Picker for Bootstrap";
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
</div>
</div>
<!-- Begin W3Counter Tracking Code -->
<script type="text/javascript" src="https://www.w3counter.com/tracker.js?id=90840"></script>
<!-- End W3Counter Tracking Code -->
<script type="text/javascript">
var im_domain = 'awio';
var im_project_id = 48;
(function(e,t){window._improvely=[];var n=e.getElementsByTagName("script")[0];var r=e.createElement("script");r.type="text/javascript";r.src="https://"+im_domain+".iljmp.com/improvely.js";r.async=true;n.parentNode.insertBefore(r,n);if(typeof t.init=="undefined"){t.init=function(e,t){window._improvely.push(["init",e,t])};t.goal=function(e){window._improvely.push(["goal",e])};t.conversion=function(e){window._improvely.push(["conversion",e])};t.label=function(e){window._improvely.push(["label",e])}}window.improvely=t;t.init(im_domain,im_project_id)})(document,window.improvely||[])
</script>
<div id="footer">
Copyright &copy; 2012-2018 <a href="http://www.dangrossman.info/">Dan Grossman</a>.
</div>
</body>
</html>

View File

@@ -0,0 +1,152 @@
body {
font-size: 15px;
line-height: 1.6em;
position: relative;
margin: 0;
}
.navbar .nav-item {
padding: 8px 0 8px 20px;
}
.navbar .nav-link {
font-weight: bold;
font-size: 14px;
padding: 0;
}
.navbar-expand-sm .navbar-nav .nav-link {
padding: 0;
}
.well {
background: #f5f5f5;
border-radius: 4px;
padding: 20px;
}
h1 {
font-size: 20px;
margin-bottom: 1em;
padding-bottom: 5px;
border-bottom: 1px dotted #08c;
}
h1:before {
content: '#';
color: #666;
position: relative;
padding-right: 5px;
}
h2 {
padding: 0;
margin: 20px 0 0 0;
font-size: 18px;
}
h2 a {
color: #444;
display: block;
background: #eee;
padding: 8px 12px;
margin-bottom: 0;
cursor: default;
text-decoration: none;
}
input.form-control {
font-size: 14px;
}
.collapsable {
border: 1px solid #eee;
padding: 12px;
display: block;
}
label {
font-size: 13px;
font-weight: bold;
}
.gist {
overflow: auto;
}
.gist .blob-wrapper.data {
max-height: 350px;
overflow: auto;
}
.list-group-item {
padding: 4px 0;
border: 0;
font-size: 16px;
}
.leftcol {
position: absolute;
top: 180px;
}
.rightcol {
max-width: 950px;
}
.container {
max-width: 1300px;
}
@media (min-width: 980px) {
.rightcol {
margin-left: 320px;
}
}
p, pre {
margin-bottom: 2em;
}
ul.nobullets {
margin: 0;
padding: 0;
list-style: none;
}
ul.nobullets li {
padding-bottom: 1em;
margin-bottom: 1em;
border-bottom: 1px dotted #ddd;
}
input[type="text"] {
padding: 6px;
width: 100%;
border-radius: 4px;
}
#footer {
background: #222;
margin-top: 80px;
padding: 10px;
color: #fff;
text-align: center;
}
#footer a:link, #footer a:visited {
color: #fff;
border-bottom: 1px dotted #fff;
}
#jumbo {
background: #c1deef;
color: #000;
padding: 20px 0;
margin-bottom: 20px;
}
#jumbo h1 {
font-size: 28px;
}
#jumbo .btn {
border-radius: 0;
font-size: 16px;
}

View File

@@ -0,0 +1,179 @@
$(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 ($('#minYear').val().length && $('#minYear').val() != 1)
options.minYear = parseInt($('#minYear').val(), 10);
if ($('#maxYear').val().length && $('#maxYear').val() != 1)
options.maxYear = parseInt($('#maxYear').val(), 10);
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 ($('#maxSpan').is(':checked'))
options.maxSpan = { 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')) {
options.locale = {
format: 'MM/DD/YYYY',
separator: ' - ',
applyLabel: 'Apply',
cancelLabel: 'Cancel',
fromLabel: 'From',
toLabel: 'To',
customRangeLabel: 'Custom',
weekLabel: 'W',
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
firstDay: 1
};
}
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 ($('#applyButtonClasses').val().length && $('#applyButtonClasses').val() != 'btn-primary')
options.applyButtonClasses = $('#applyButtonClasses').val();
if ($('#cancelButtonClasses').val().length && $('#cancelButtonClasses').val() != 'btn-default')
options.cancelClass = $('#cancelButtonClasses').val();
$('#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 + ')'); });
if (typeof options.ranges !== 'undefined') {
options.ranges = {};
}
var option_text = JSON.stringify(options, null, ' ');
var replacement = "ranges: {\n"
+ " 'Today': [moment(), moment()],\n"
+ " 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\n"
+ " 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\n"
+ " 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\n"
+ " 'This Month': [moment().startOf('month'), moment().endOf('month')],\n"
+ " 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\n"
+ " }";
option_text = option_text.replace(new RegExp('"ranges"\: \{\}', 'g'), replacement);
$('#config-text').val("$('#demo').daterangepicker(" + option_text + ", 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});");
}
$(window).scroll(function (event) {
var scroll = $(window).scrollTop();
if (scroll > 180) {
$('.leftcol').css('position', 'fixed');
$('.leftcol').css('top', '10px');
} else {
$('.leftcol').css('position', 'absolute');
$('.leftcol').css('top', '180px');
}
});
var bg = new Trianglify({
x_colors: ["#e1f3fd", "#eeeeee", "#407dbf"],
y_colors: 'match_x',
width: document.body.clientWidth,
height: 150,
stroke_width: 0,
cell_size: 20
});
$('#jumbo').css('background-image', 'url(' + bg.png() + ')');
});

View File

@@ -0,0 +1,38 @@
Submitting Issues
=================
If you are submitting a bug, please test and/or fork [this jsfiddle](http://jsfiddle.net/Eonasdan/0Ltv25o8/) demonstrating the issue. Code issues and fringe case bugs that do not include a jsfiddle (or similar) will be closed.
Issues that are submitted without a description (title only) will be closed with no further explanation.
Contributing code
=================
To contribute, fork the library and install grunt and dependencies. You need [node](http://nodejs.org/); use [nvm](https://github.com/creationix/nvm) or [nenv](https://github.com/ryuone/nenv) to install it.
```bash
git clone https://github.com/Eonasdan/bootstrap-datetimepicker.git
cd bootstrap-datetimepicker
npm install -g grunt-cli
npm install
git checkout development # all patches against development branch, please!
grunt # this runs tests and jshint
```
Very important notes
====================
* **Pull requests to the `master` branch will be closed.** Please submit all pull requests to the `development` branch.
* **Do not include the minified files in your pull request.** Don't worry, we'll build them when we cut a release.
* Pull requests that do not include a description (title only) and the following will be closed:
* What the change does
* A use case (for new features or enhancements)
Grunt tasks
===========
We use Grunt for managing the build. Here are some useful Grunt tasks:
* `grunt` The default task lints the code and runs the tests. You should make sure you do this before submitting a PR.
* `grunt build` Compiles the less stylesheet and minifies the javascript source in build directory.
* `grunt build:travis` Compliles and runs the jasmine/travis tests. **All PR's MUST pass tests in place**

View File

@@ -0,0 +1,195 @@
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
target: {
files: {
'build/js/bootstrap-datetimepicker.min.js': 'src/js/bootstrap-datetimepicker.js'
}
},
options: {
mangle: true,
compress: {
dead_code: false // jshint ignore:line
},
output: {
ascii_only: true // jshint ignore:line
},
report: 'min',
preserveComments: 'some'
}
},
jshint: {
all: [
'Gruntfile.js', 'src/js/*.js', 'test/*.js'
],
options: {
'browser': true,
'node': true,
'jquery': true,
'boss': false,
'curly': true,
'debug': false,
'devel': false,
'eqeqeq': true,
'bitwise': true,
'eqnull': true,
'evil': false,
'forin': true,
'immed': false,
'laxbreak': false,
'newcap': true,
'noarg': true,
'noempty': false,
'nonew': false,
'onevar': true,
'plusplus': false,
'regexp': false,
'undef': true,
'sub': true,
'strict': true,
'unused': true,
'white': true,
'es3': true,
'camelcase': true,
'quotmark': 'single',
'globals': {
'define': false,
'moment': false,
// Jasmine
'jasmine': false,
'describe': false,
'xdescribe': false,
'expect': false,
'it': false,
'xit': false,
'spyOn': false,
'beforeEach': false,
'afterEach': false
}
}
},
jscs: {
all: [
'Gruntfile.js', 'src/js/*.js', 'test/*.js'
],
options: {
config: '.jscs.json'
}
},
less: {
production: {
options: {
cleancss: true,
compress: true,
paths: 'node_modules'
},
files: {
'build/css/bootstrap-datetimepicker.min.css': 'src/less/bootstrap-datetimepicker-build.less'
}
},
development: {
options: {
paths: 'node_modules'
},
files: {
'build/css/bootstrap-datetimepicker.css': 'src/less/bootstrap-datetimepicker-build.less'
}
}
},
env: {
paris: {
TZ: 'Europe/Paris' // sets env for phantomJS https://github.com/ariya/phantomjs/issues/10379#issuecomment-36058589
}
},
connect: {
server: {
options: {
port: 8099
}
}
},
jasmine: {
customTemplate: {
src: 'src/js/*.js',
options: {
specs: 'test/*Spec.js',
helpers: 'test/*Helper.js',
host: 'http://127.0.0.1:8099',
styles: [
'node_modules/bootstrap/dist/css/bootstrap.min.css',
'build/css/bootstrap-datetimepicker.min.css'
],
vendor: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/moment/min/moment-with-locales.min.js',
'node_modules/moment-timezone/moment-timezone.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js'
],
display: 'none',
summary: 'true'
}
}
},
nugetpack: {
less: {
src: 'src/nuget/Bootstrap.v3.Datetimepicker.nuspec',
dest: 'build/nuget',
options: {
version: '<%= pkg.version %>'
}
},
css: {
src: 'src/nuget/Bootstrap.v3.Datetimepicker.CSS.nuspec',
dest: 'build/nuget',
options: {
version: '<%= pkg.version %>'
}
}
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-nuget');
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['jshint', 'jscs', 'less', 'env:paris', 'connect', 'jasmine']);
grunt.registerTask('build:travis', [
// code style
'jshint', 'jscs',
// build
'uglify', 'less',
// tests
'env:paris', 'connect', 'jasmine'
]);
// Task to be run when building
grunt.registerTask('build', ['jshint', 'jscs', 'uglify', 'less']);
grunt.registerTask('test', ['jshint', 'jscs', 'uglify', 'less', 'env:paris', 'connect', 'jasmine']);
grunt.registerTask('docs', 'Generate docs', function () {
grunt.util.spawn({
cmd: 'mkdocs',
args: ['build', '--clean']
});
});
grunt.registerTask('release', function (version) {
if (!version || version.split('.').length !== 3) {
grunt.fail.fatal('malformed version. Use grunt release:1.2.3');
}
grunt.task.run([
'bump_version:' + version,
'build:travis',
'docs',
'nugetpack'
]);
});
};

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Jonathan Peterson (@Eonasdan)
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 @@
# Bootstrap 3 Date/Time Picker
![GitHub version](https://badge.fury.io/gh/Eonasdan%2Fbootstrap-datetimepicker.png)&nbsp;&nbsp;&nbsp;![Travis](https://travis-ci.org/Eonasdan/bootstrap-datetimepicker.svg?branch=development)
![DateTimePicker](http://i.imgur.com/nfnvh5g.png)
## [View the manual and demos](http://eonasdan.github.io/bootstrap-datetimepicker/)
## [Installation instructions](http://eonasdan.github.io/bootstrap-datetimepicker/Installing/)
## [Change Log](http://eonasdan.github.io/bootstrap-datetimepicker/Changelog/)
### This issue tracker is no longer actively monitored.
# Version 5
Version 5 is being completely rewritten in ES6 and modularized as Tempus Dominus.
v5 is [in alpha](https://github.com/tempusdominus/bootstrap-3).

View File

@@ -0,0 +1,34 @@
{
"name": "eonasdan-bootstrap-datetimepicker",
"version": "4.17.47",
"main": [
"build/css/bootstrap-datetimepicker.min.css",
"build/js/bootstrap-datetimepicker.min.js"
],
"dependencies": {
"jquery": ">=1.8.3",
"moment": ">=2.10.5"
},
"homepage": "https://github.com/Eonasdan/bootstrap-datetimepicker",
"authors": [
"Eonasdan"
],
"description": "bootstrap3 datetimepicker",
"keywords": [
"twitter-bootstrap",
"bootstrap",
"datepicker",
"datetimepicker",
"timepicker",
"moment"
],
"license": "MIT",
"private": false,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}

View File

@@ -0,0 +1,98 @@
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.glyphicon-time:before {
content: "\e023";
}
.glyphicon-chevron-left:before {
content: "\e079";
}
.glyphicon-chevron-right:before {
content: "\e080";
}
.glyphicon-chevron-up:before {
content: "\e113";
}
.glyphicon-chevron-down:before {
content: "\e114";
}
.glyphicon-calendar:before {
content: "\e109";
}
.btn {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.dropdown-menu {
position: absolute;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, .15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.list-unstyled {
padding-left: 0;
list-style: none;
}

View File

@@ -0,0 +1,374 @@
/*!
* Datetimepicker for Bootstrap 3
* version : 4.17.47
* https://github.com/Eonasdan/bootstrap-datetimepicker/
*/
.bootstrap-datetimepicker-widget {
list-style: none;
}
.bootstrap-datetimepicker-widget.dropdown-menu {
display: block;
margin: 2px 0;
padding: 4px;
width: 19em;
}
@media (min-width: 768px) {
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
width: 38em;
}
}
@media (min-width: 992px) {
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
width: 38em;
}
}
@media (min-width: 1200px) {
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
width: 38em;
}
}
.bootstrap-datetimepicker-widget.dropdown-menu:before,
.bootstrap-datetimepicker-widget.dropdown-menu:after {
content: '';
display: inline-block;
position: absolute;
}
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
top: -7px;
left: 7px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
top: -6px;
left: 8px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.top:before {
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid #ccc;
border-top-color: rgba(0, 0, 0, 0.2);
bottom: -7px;
left: 6px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.top:after {
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid white;
bottom: -6px;
left: 7px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before {
left: auto;
right: 6px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after {
left: auto;
right: 7px;
}
.bootstrap-datetimepicker-widget .list-unstyled {
margin: 0;
}
.bootstrap-datetimepicker-widget a[data-action] {
padding: 6px 0;
}
.bootstrap-datetimepicker-widget a[data-action]:active {
box-shadow: none;
}
.bootstrap-datetimepicker-widget .timepicker-hour,
.bootstrap-datetimepicker-widget .timepicker-minute,
.bootstrap-datetimepicker-widget .timepicker-second {
width: 54px;
font-weight: bold;
font-size: 1.2em;
margin: 0;
}
.bootstrap-datetimepicker-widget button[data-action] {
padding: 6px;
}
.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Increment Hours";
}
.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Increment Minutes";
}
.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Decrement Hours";
}
.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Decrement Minutes";
}
.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Show Hours";
}
.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Show Minutes";
}
.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Toggle AM/PM";
}
.bootstrap-datetimepicker-widget .btn[data-action="clear"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Clear the picker";
}
.bootstrap-datetimepicker-widget .btn[data-action="today"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Set the date to today";
}
.bootstrap-datetimepicker-widget .picker-switch {
text-align: center;
}
.bootstrap-datetimepicker-widget .picker-switch::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Toggle Date and Time Screens";
}
.bootstrap-datetimepicker-widget .picker-switch td {
padding: 0;
margin: 0;
height: auto;
width: auto;
line-height: inherit;
}
.bootstrap-datetimepicker-widget .picker-switch td span {
line-height: 2.5;
height: 2.5em;
width: 100%;
}
.bootstrap-datetimepicker-widget table {
width: 100%;
margin: 0;
}
.bootstrap-datetimepicker-widget table td,
.bootstrap-datetimepicker-widget table th {
text-align: center;
border-radius: 4px;
}
.bootstrap-datetimepicker-widget table th {
height: 20px;
line-height: 20px;
width: 20px;
}
.bootstrap-datetimepicker-widget table th.picker-switch {
width: 145px;
}
.bootstrap-datetimepicker-widget table th.disabled,
.bootstrap-datetimepicker-widget table th.disabled:hover {
background: none;
color: #777777;
cursor: not-allowed;
}
.bootstrap-datetimepicker-widget table th.prev::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Previous Month";
}
.bootstrap-datetimepicker-widget table th.next::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Next Month";
}
.bootstrap-datetimepicker-widget table thead tr:first-child th {
cursor: pointer;
}
.bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
background: #eeeeee;
}
.bootstrap-datetimepicker-widget table td {
height: 54px;
line-height: 54px;
width: 54px;
}
.bootstrap-datetimepicker-widget table td.cw {
font-size: .8em;
height: 20px;
line-height: 20px;
color: #777777;
}
.bootstrap-datetimepicker-widget table td.day {
height: 20px;
line-height: 20px;
width: 20px;
}
.bootstrap-datetimepicker-widget table td.day:hover,
.bootstrap-datetimepicker-widget table td.hour:hover,
.bootstrap-datetimepicker-widget table td.minute:hover,
.bootstrap-datetimepicker-widget table td.second:hover {
background: #eeeeee;
cursor: pointer;
}
.bootstrap-datetimepicker-widget table td.old,
.bootstrap-datetimepicker-widget table td.new {
color: #777777;
}
.bootstrap-datetimepicker-widget table td.today {
position: relative;
}
.bootstrap-datetimepicker-widget table td.today:before {
content: '';
display: inline-block;
border: solid transparent;
border-width: 0 0 7px 7px;
border-bottom-color: #337ab7;
border-top-color: rgba(0, 0, 0, 0.2);
position: absolute;
bottom: 4px;
right: 4px;
}
.bootstrap-datetimepicker-widget table td.active,
.bootstrap-datetimepicker-widget table td.active:hover {
background-color: #337ab7;
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.bootstrap-datetimepicker-widget table td.active.today:before {
border-bottom-color: #fff;
}
.bootstrap-datetimepicker-widget table td.disabled,
.bootstrap-datetimepicker-widget table td.disabled:hover {
background: none;
color: #777777;
cursor: not-allowed;
}
.bootstrap-datetimepicker-widget table td span {
display: inline-block;
width: 54px;
height: 54px;
line-height: 54px;
margin: 2px 1.5px;
cursor: pointer;
border-radius: 4px;
}
.bootstrap-datetimepicker-widget table td span:hover {
background: #eeeeee;
}
.bootstrap-datetimepicker-widget table td span.active {
background-color: #337ab7;
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.bootstrap-datetimepicker-widget table td span.old {
color: #777777;
}
.bootstrap-datetimepicker-widget table td span.disabled,
.bootstrap-datetimepicker-widget table td span.disabled:hover {
background: none;
color: #777777;
cursor: not-allowed;
}
.bootstrap-datetimepicker-widget.usetwentyfour td.hour {
height: 27px;
line-height: 27px;
}
.bootstrap-datetimepicker-widget.wider {
width: 21em;
}
.bootstrap-datetimepicker-widget .datepicker-decades .decade {
line-height: 1.8em !important;
}
.input-group.date .input-group-addon {
cursor: pointer;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
{
"name": "bootstrap-datetimepicker",
"version": "4.17.47",
"main": ["build/css/bootstrap-datetimepicker.min.css","build/js/bootstrap-datetimepicker.min.js"],
"dependencies": {
"jquery" : ">=1.8.3",
"moment": ">=2.10.5"
}
}

View File

@@ -0,0 +1,28 @@
{
"name": "eonasdan/bootstrap-datetimepicker",
"type": "component",
"version": "4.17.47",
"description": "Date/time picker widget based on twitter bootstrap",
"keywords": [
"bootstrap",
"datetimepicker"
],
"homepage": "http://eonasdan.github.io/bootstrap-datetimepicker/",
"license": "MIT",
"require": {
"robloach/component-installer": "*",
"components/jquery": ">=1.9.1",
"moment/moment": ">=2.10.5"
},
"extra": {
"component": {
"scripts": [
"src/js/bootstrap-datetimepicker.js"
],
"files": [
"build/js/bootstrap-datetimepicker.min.js",
"build/css/bootstrap-datetimepicker.min.css"
]
}
}
}

View File

@@ -0,0 +1,237 @@
# Version 4
## 4.17.42
### Bug Squashing
* fixed moment dependencies to all be the same
* defaulted `option.timeZone` to `''` instead of UTC. This way it will default to the local timezone if it's not set.
* fixed #959
* fixed #1311 internal `getMoment` function no longer sets `startOf('d')`
* fixed #935
### Other
* moved some (will move the rest soon) inline docs to JSDoc now that ReSharper supports it.
* moved getter/setter functions to options page instead. #1313
## 4.17.37
### New Features
* Momentjs TZ intergration #1242 thanks @bodrick
* Independent CSS file, in case you don't want bootstrap for some reason
### Bug Squashing
* Slight changes decade view
* Moved all tooltip text to `tooltips`
* fixed #1212
## 4.15.35
### New Features
`tooltips` allows custom, localized text to be included for icon tooltips
### Bug Squashing
fixed #1066
fixed #1087 `sideBySide` properly supports `toolbarPlacement [top, bottom]`
fixed #1119
fixed #1069 added input.blur()
fixed #1049 fixed doc example
fixed #999 picker now looks for an element with `.input-group-addon`
## 4.14.30
### New Features
`disabledTimeIntervals` #644
`allowInputToggle` #929
`focusOnShow` #884
public `viewDate` function #872
`enabledHours` and `disabledHours`.
`dp.update` fires when `viewDate` is changed (in most cases) #937
`viewMode` now supports a decades view.
**Note**: because the year picker shows 12 years at a time, I've elected to make this view show blocks of 12 years
**Note**: when selecting a decade the `viewDate` will change to the **center** of the selected years
`parseInputDate` #1095
### Bug Squashing
fixed #815 by adding `.wider` when using both seconds and am/pm.
fixed #816 changed both min/max date to move the selected date inside.
fixed #855 #881 `fillDate`, `fillMonths`, `fillDow` uses `startOf('day')`, which will hopefully fix the DST issues.
fixed #885 `daysOfWeekDisabled` will move the date to a valid date if `useCurrent` is `true`. Today button will check if the DoW is disabled.
fixed #906
fixed #912 if `useCurrent:false` month and year view will no longer have the current month/year selected.
fixed #914 `use24hours` will ignore anything in side of `[]` in the format string.
fixed #916 added titles to all icons. At some point the text should be moved to the icon's array, but this would probably be a breaking change.
fixed #940 added -1 tab index to am/pm selector
### Other Changes
changed in/decrement behavior to check if the new date is valid at that granularity (hours, minutes, seconds). will also validate as before
## 4.7.14
Added several in new features:
`keybinds`, `inline`, `debug`, `clear()`, `showClose`, `ingoreReadOnly`, `datepickerInput` and `keepInvalid`.
Bug squashing
## 4.0.0
#### Changes for using the component
* Defined a [Public API](https://github.com/Eonasdan/bootstrap-datetimepicker/wiki/Version-4-Public-API) and hidden rest of functions, variables so that all configuration options can be changed dynamically.
* `set/getDate()` is now replaced with an overloaded `date()` function. Use it without a parameter to get the currently set date or with a parameter to set the date.
* `hide()`, `show()`, `toggle()`, `enable()`, `disable()` and the rest of setter functions now support chaining. ie `$('#id').data('DateTimePicker').format('DD-MM-YYYY').minDate(moment()).defaultDate(moment()).show()` works
* Replaced previous - next buttons in Date subviews with configurable icons
* Changed `language` option name to `locale` to be inline with moment naming
* Implemented #402 all data-date-* variables are more readable and also match with the ones in the configuration object
* `options.direction` and `options.orientation` were merged into a single object `options.widgetPositioning` with `vertical` and `horizontal` keys that take a string value of `'auto', 'top', 'bottom'` and `'auto', 'left', 'right'` respectively. Note that the `'up'` option was renamed to `'top'`
#### Added functionality
* added a second way to define options as data attributes. Instead of adding distinct `data-date-*` config options you can now also pass a `data-date-options` attribute containing an object just the same as the options object that `element.datetimepicker` constructor call takes
* also added a `options()` public api function to get/set that takes an option object and applies it to the component in one call
* Implemented [#130](https://github.com/Eonasdan/bootstrap-datetimepicker/issues/130) by introducing a boolean `options.calendarWeeks` and `calendarWeeks()` api function
* Implemented [#328](https://github.com/Eonasdan/bootstrap-datetimepicker/issues/328), [#426](https://github.com/Eonasdan/bootstrap-datetimepicker/issues/426)
* Implemented [#432](https://github.com/Eonasdan/bootstrap-datetimepicker/issues/432). Widget DOM element is now lazily added only when shown and removed from the document when hidden.
* Implemented [#141](https://github.com/Eonasdan/bootstrap-datetimepicker/issues/141) and [#283](https://github.com/Eonasdan/bootstrap-datetimepicker/issues/283)
#### Contributors related internal code changes
* Refactor all UI click functions and put them as functions in the actions array private variable
* Refactor template building process to seperate functions according to what they do
* Remove some styles that where hardcoded in the javascript code
* Refactor all code that changes the picker.date to change it through the setValue function to allow one place for validation logic (min/max/weekdaysenabled etc) and also one place for emmiting dp.change events
* The v4beta branch code includes all fixes up to v.3.1.2
* Added `toggle()` to the public API which toggles the visibility of the DateTimePicker
* Refactored set function to be included in the setValue function
* Added a testing framework using jasmine and phantom.js
# Version 3
## 3.0.0
* Fix for #170, #179, #183: Changed event to `dp.-`. This should fix the double change event firing.
* Fix for #192: `setDate` now fires `dp.change`
* Fix for #182: Picker will **not** set the default date if the input field has a value
* Fix for #169: Seconds doesn't get reset when changing the date (Thanks to PR #174)
* Fix for #168 z-index fix for BS modal
* Fix for #155 Picker properly displays the active year and month
* Fix for #154 CSS update to fix the collapse jump
* Fix for #150 and #75 `minViewMode` and `viewMode` work properly
* Fix for #147 AM/PM won't toggle when selecting a value from the hours grid
* Fix for #44 Finally! It's here!! Thanks to @ruiwei and his code on #210 picker will adjust the positioning of the widget.
#### Manually merged PR
* PR #178 When using `minuteStepping` the minute select grid will only show available steppings
* PR #195, #197 Using the `data-OPTION` has been changed to `data-date-OPTION`. These options are expected to be on the `input-group` if you're using the `input-group` **or** the a bare input field if you're not using the `input-group`
* PR #184 The option `sideBySide` change be used to display both the d and the timepicker side by side
* PR #143 Added option `daysOfWeekDisabled: []`. For example, use `daysOfWeekDisabled: [0,6]` to disable Sunday and Saturday
#### **Other Changes**
* Changed picker width to 300px if using seconds and am/pm
* Added option `useCurrent`, thanks to @ruiwei. When true, picker will set the value to the current date/time (respects picker's format)
* Added option `showToday`, thanks to @ruiwei. When true, picker will display a small arrow to indicate today's date.
* Changed `startDate` to `minDate` and `endDate` to `maxDate` to make it more clear what these options do.
# Version 2
#### 2.1.32 (Hotfix)
* Fix for #151: When a bad date value or the picker is cleared, the plugin will not longer attempt to reset it back to the previous date
* Fix for #140: `setDate` can be given `null` to force clear the picker
#### 2.1.30
##### Important! `build.less` file name has been been changed to `bootstrap-datetimepicker-build.less` to prevent collisions
* Fix for #135: `setStartDate` and `setEndDate` should now properly set.
* Fix for #133: Typed in date now respects en/disabled dates
* Fix for #132: En/disable picker function works again
* Fix for #117, #119, #128, #121: double event `change` event issues should be fixed
* Fix for #112: `change` function no longer sets the input to a blank value if the passed in date is invalid
* Enhancement for #103: Increated the `z-index` of the widget
#### 2.1.20
* Fix for #83: Changes to the picker should fire native `change` event for knockout and the like as well as `change.dp` which contains the old date and the new date
* Fix for #78: Script has been update for breaking changes in Moment 2.4.0
* Fix for #73: IE8 should be working now
* Enhancement for #79: `minuteStepping` option takes a number (default is 1). Changing the minutes in the time picker will step by this number.
* Enhancement for #74 and #65: `useMinutes` and `useSeconds` are now options. Disabling seconds will hide the seconds spinner. Disabling minutes will display `00` and hide the arrows
* Enhancement for #67: Picker will now attempt to convert all `data-OPTION` into its appropriate option
#### 2.1.11
* Fix for #51, #60
* Fix for #52: Picker has its own `moment` object since moment 2.4.0 has removed global reference
* Fix for #57: New option for `useStrict`. When validating dates in `update` and `change`, the picker can use a stricter formatting validation
* Fix for #61: Picker should now properly take formatted date. Should also have correct start of the week for locales.
* Fix for #62: Default format will properly validate time picker only.
#### 2.1.5
* Custom icons, such as Font Awesome, are now supported. (#49)
* If more then one `input-group-addon` is present use `datepickerbutton` to identify where the picker should popup from. (#48)
* New Event: `error.dp`. Fires when Moment cannot parse the date or when the timepicker cannot change because of a `disabledDates` setting. Returns a Moment date object. The specific error can be found be using `invalidAt()`. For more information see [Moment's docs](http://momentjs.com/docs/#/parsing/is-valid/)
* Fix for #42, plugin will now check for `A` or `a` in the format string to determine if the AM/PM selector should display.
* Fix for #45, fixed null/empty and invalid dates
* Fix for #46, fixed active date highlighting
* Fix for #47, `change.dp` event to also include the previous date.
####2.0.1
* New event `error.dp` fires when plugin cannot parse date or when increase/descreasing hours/minutes to a disabled date.
* Minor fixes
####2.0.0
* `disabledDates` is now an option to set the disabled dates. It accepts date objects like `new Date("November 12, 2013 00:00:00")` and `12/25/2013' and `moment` date objects
* Events are easier to use

View File

@@ -0,0 +1,126 @@
This guide is aimed to contributors wishing to understand the internals of the code in order to change/evolve the component.
**Note:** this guide refers to **version 4** which is currently in beta and will be updated as we progress
## Introduction
This component consists actually of 2 subcomponent UI widgets one for the date and one for the time selection process. The developers can configure which of those are needed and also the granularity that the component will allow the users to select a date/time. Developers also choose the format that the selected datetime will be displayed in the input field.
The component uses on `jQuery`, `moment.js` and `bootstrap` libraries.
## Code
### Private variables
* `element` - Holds the DOM element this instance is attached to
* `options` - Holds an object with the curently set options for the specific instance of the component. Don't directly change the properties of that object use the public API methods instead. DO NOT expose this object or its properties outside of the component.
* `picker` - Reference variable to the created instance `(this)`
* `date` - Holds the moment object for the model value of the component. **DON'T** directly change this variable unless you **REALLY** know what you are doing. Use `setValue()` function to set it. It handles all component logic for updating the model value and emitting all the appropriate events
* `viewDate` - Holds the currently selected value that the user has selected through the widget. This is not the model value this is the view value. Changing this usually requires a subsequent call to `update()` function
* `unset` - A `boolean` variable that holds wheather the components model value is set or not. Model's value starts as `unset = true` and if is either set by the user or programmatically through the api to a valid value then it is set to `false`. If subsequent events lead to an invalid value then this variable is set to `true` again. Setting this variable usually takes place in the `setValue()` function.
* `input` - Hold the DOM input element this instance is attached to
* `component` - Holds a reference to the .input-group DOM element that the widget is attached or false if it is attached directly on an input field
* `widget` - Holds a reference to the DOM element containing the widget or `false` if the widget is hidden
* `use24hours` - Holds whether the component uses 24 hours format or not. This is initialized on the `format()` function
* `minViewModeNumber` - Holds the Numeric equivelant of the options.minViewMode parameter
* `format` - Holds the current format string that is used for formating the date model value. Note this is not the same thing as the `options.format` as the second could be set to `false` in which case the first takes the locale's `L` or `LT` value
* `currentViewMode` - Hold the state of the current viewMode for the DatePicker subcomponent
* `actions` - An object containing all the functions that can be called when the users clicks on the widget
* `datePickerModes` - An array of objects with configuration parameters for the different views of the DatePicker subcomponent
* `viewModes` - An array of strings containing all the possible strings that `options.viewMode` can take through `viewMode()` public api function
* `directionModes` - An array of strings containing all the possible strings that `options.direction` can take through `direction()` public api function
* `orientationModes` - An array of strings containing all the possible strings that `options.orientation` can take through `orientation()` public api function
### Private functions
#### Widget related
* `getDatePickerTemplate()` - returns a string containing the html code for the date picker subcomponent
* `getTimePickerTemplate()` - returns a string containing the html code for the time picker subcomponent
* `getTemplate()` - returns a string with containing the html code for all the DateTimePicker component
* `place()` - handles the placement of the widget's dropdown
* `updateMonths()` - updates the html subpage related to the months for Date picker view
* `updateYears()` - updates the html subpage related to the years for Date picker view
* `fillDate()` - updates the html subpage related to the days for Date picker view
* `fillHours()` - Creates the hours spans for the hours subview of the Time subcomponent
* `fillMinutes()` - Creates the minutes spans for the hours subview of the Time subcomponent
* `fillSeconds()` - Creates the seconds spans for the hours subview of the Time subcomponent
* `fillTime()` - Creates the main subview of the Time subcomponent
* `update()` - updates the UI of part of the widget
* `fillDow()` - Creates the day names in the days subview on the Date subcomponent
* `fillMonths()` - Creates the month spans for the months subview of the Date subcomponent
* `createWidget()` - creates the UI widget end attaches widget event listeners
* `destroyWidget()` - destroys the UI widget DOM element and detaches widget event listeners
* `showMode(dir)` - toggles between the various subpage related views of the DateTimePicker
#### Events related
* `notifyEvent(e)` - Use this function when you want to send en event to listener this could be used as a filter later
* `stopEvent(e)` - Shortcut for stopping propagation of events
* `doAction(e)` - Proxy function to call all the UI related click events
* `keydown(e)` - Function to trap
* `change(e)` - Listener function to track change events occuring on the `input` dom element the component is attached to
* `attachDatePickerElementEvents()` - Attaches listeners to the existing DOM elements the component is attached to. Called upon construction of each datetimepicker instance
* `detachDatePickerElementEvents()` - Detaches listeners from the DOM element the component is attached to. Called on `destroy()`
* `attachDatePickerWidgetEvents()` - Attaches listeners on the components widget. Called on `show()`
* `detachDatePickerWidgetEvents()` - Detaches listeners on the components widget. Called on `hide()`
#### Model related
* `setValue(targetMoment)` - Sets the model value of the component takes a moment object. An `error` event will be emmited if the `targetMoment` does not pass the configured validations. Otherwise the `date` variable will be set and the relevant events will be fired.
* `isValid(targetMoment, granularity)` - returns `true` if the `targetMoment` moment object is valid according to the components set validation rules (`min/maxDates`, `disabled/enabledDates` and `daysOfWeekDisabled`). You may pass a second variable to check only up the the specific granularity `year, month, day, hour, minute, second`
#### Utilities
* `indexGivenDates (givenDatesArray)` - Function that takes the array from `enabledDates()` and `disabledDates()` public functions and stores them as object keys to enable quick lookup
* `isInEnableDates(date)` - Checks whether if the given moment object exists in the `options.enabledDates` object
* `isInDisableDates(date)` - Checks whether if the given moment object exists in the `options.disabledDates` array
* `dataToOptions()` - Parses `data-date-*` options set on the input dom element the component is attached to and returns an object with them
* `isInFixed()` - Checks if the dom element or its parents has a fixed position css rule.
* `parseInputDate(date)` - Parses a date parameter with moment using the component's `options.format` and `options.useStrict`. It returns a `moment` object or false if `parsedMoment#isValid()` returns `false`. Use this to parse date inputs from outside the component (public API calls).
* `init()` - Initializes the component. Called when the component instance is created

View File

@@ -0,0 +1,97 @@
## Events
### dp.hide
Fired when the widget is hidden.
Parameters:
```
e = {
date //the currently set date. Type: moment object (clone)
}
```
Emitted from:
* toggle()
* hide()
* disable()
----------------------
### dp.show
Fired when the widget is shown.
Parameters:
No parameters are include, listen to `dp.change` instead
Emitted from:
* toggle()
* show()
----------------------
### dp.change
Fired when the date is changed, including when changed to a non-date (e.g. When keepInvalid=true).
Parameters:
```
e = {
date, //date the picker changed to. Type: moment object (clone)
oldDate //previous date. Type: moment object (clone) or false in the event of a null
}
```
Emitted from:
* toggle() **Note**: Only fired when using `useCurrent`
* show() **Note**: Only fired when using `useCurrent` or when or the date is changed to comply with date rules (min/max etc)
* date(newDate)
* minDate(minDate)
* maxDate(maxDate)
* daysOfWeekDisabled()
----------------------
### dp.error
Fired when a selected date fails to pass validation.
Parameters:
```
e = {
date //the invalid date. Type: moment object (clone)
oldDate //previous date. Type: moment object (clone) or false in the event of a null
}
```
Emmited from:
* minDate(minDate)
* maxDate(maxDate)
* daysOfWeekDisabled()
* setValue() *private function*
----------------------
### dp.update
<small>4.14.30</small>
Fired (in most cases) when the `viewDate` changes. E.g. Next and Previous buttons, selecting a year.
Parameters:
```
e = {
change, //Change type as a momentjs format token. Type: string e.g. yyyy on year change
viewDate //new viewDate. Type: moment object
}
```

View File

@@ -0,0 +1,95 @@
# Extras
Guides for making the picker work better with rails, IE, etc
## Rails 3
by [dhulihan](https://github.com/dhulihan)
You can easily override the default rails form helpers (`date_select` and `datetime_select`) with bootstrap-datetimepicker for a much nicer experience.
```rb
# Add to config/initializers/form.rb or the end of app/helpers/application_helper.rb
module ActionView
module Helpers
class FormBuilder
def date_select(method, options = {}, html_options = {})
existing_date = @object.send(method)
formatted_date = existing_date.to_date.strftime("%F") if existing_date.present?
@template.content_tag(:div, :class => "input-group") do
text_field(method, :value => formatted_date, :class => "form-control datepicker", :"data-date-format" => "YYYY-MM-DD") +
@template.content_tag(:span, @template.content_tag(:span, "", :class => "glyphicon glyphicon-calendar") ,:class => "input-group-addon")
end
end
def datetime_select(method, options = {}, html_options = {})
existing_time = @object.send(method)
formatted_time = existing_time.to_time.strftime("%F %I:%M %p") if existing_time.present?
@template.content_tag(:div, :class => "input-group") do
text_field(method, :value => formatted_time, :class => "form-control datetimepicker", :"data-date-format" => "YYYY-MM-DD hh:mm A") +
@template.content_tag(:span, @template.content_tag(:span, "", :class => "glyphicon glyphicon-calendar") ,:class => "input-group-addon")
end
end
end
end
end
```
The time format used here is ActiveRecord-friendly, which means it will be parsed correctly when passed in through `params` to your record.
That's all there is to it! Now all of your forms that use `datetime_select` or `date_select` will be automatically updated:
```erb
<% form_for @post do |f| %>
<div class="form-group">
<label>Published At</label>
<%= f.datetime_select :published_at %>
</div>
<% end %>
```
## IE 7
by [EquilibriumCST](https://github.com/EquilibriumCST)
I succeed to run this widget under IE7.
Here is what I did.
1. gliphicons are not working under IE7 so add [this css file](https://github.com/coliff/bootstrap-ie7). And this enables the icons.
2. Z-index problem with IE 7. I added position: relative and `z-index: 10` to the parent container. Otherwise popup is shown under the next elements.
3. JS events were not working well.
If you open the datetimepicker widget and click on some button or date inside it, widget is automatically closed.
So I added `debug: true` as an option when initializing the widget. Why I did this? I saw on line 1121 from bootsrap-datetimepicker.js the code `'blur': options.debug ? '' : hide`.
And now widget window is not closed on every click inside it, but now you can't close it anyway :)
And closing should be done manually. I've added this document click handler. If you click something outside the widget, now closing works.
```
$(document).click(function(e){
var target = $(e.target);
if(target.parents('.bootstrap-datetimepicker-widget').length < 1 && !target.hasClass('datetimepickerInput') && !target.hasClass('datepickerIcon') && !target.hasClass('clockpickerIcon')){
if($('.bootstrap-datetimepicker-widget').length > 0){
$('#startDate').data('DateTimePicker').hide();
$('#startTime').data('DateTimePicker').hide();
$('.datetimepickerInput').blur();
}
}
});
```
But if you have more than one widget on the page like I did, clicking on one widget does'n close the other. Added below lines and now all works fine.
```
$('#widget1').on("dp.show",function (e) {
$('#widget2).data('DateTimePicker').hide();
});
$('#widget2').on("dp.show",function (e) {
$('#widget1).data('DateTimePicker').hide();
});
```
I hope this will help to the others who are fighting with the old IE versions :)

View File

@@ -0,0 +1,22 @@
# FAQs
# How do I disable the date or time element
<small>How do I format ...; How do I add seconds; etc.</small>
The picker uses the `format` option to decide what components to show. Set `format` to `LT`, `LTS` or another valid [MomentJs format string](http://momentjs.com/docs/#/displaying/format/) to display certain components
# How do I change the language/locale
The picker uses MomentJs to determine the language string. You can use `moment-with-locales` or you can include whatever local file you need. Set the picker's `locale` option to `de` or whatever the locale string is.
# How do I change the styles? The picker closes.
Set `debug:true` which will force the picker to stay open, even `onBlur`. You can hide the picker manually by calling `hide()`
# How do I change the start of the week?
Start of the week is based on the [`locale` provided](Options.md#locale). This is defined by moment's locales. If you want to change it, create your own locale file or override. [See moment's docs](http://momentjs.com/docs/#/i18n/).
# How I use the picker as birthday picker?
Use the [`viewMode`](Options.md#viewmode) option to `'years'`

View File

@@ -0,0 +1,82 @@
## Functions
<div class="alert alert-info">
<strong>Note</strong>
All functions are accessed via the <code>data</code> attribute e.g. <code>$('#datetimepicker').data("DateTimePicker").FUNCTION()</code>
</div>
###destroy()
Destroys the widget and removes all attached event listeners
----------------------
### toggle()
Shows or hides the widget
#### Emits
* `dp.hide` - if the widget is hidden after the toggle call
* `dp.show` - if the widget is show after the toggle call
* `dp.change` - if the widget is opened for the first time and the input element is empty and `options.useCurrent != false`
----------------------
### show()
Shows the widget
#### Emits
* `dp.show` - if the widget was hidden before that call
* `dp.change` - if the widget is opened for the first time and the useCurrent is set to true or to a granularity value and the input element the component is attached to has an empty value
----------------------
### hide()
Hides the widget
#### Emits
* `dp.hide` - if the widget was visible before that call
----------------------
### disable()
Disables the input element, the component is attached to, by adding a `disabled="true"` attribute to it. If the widget was visible before that call it is hidden.
#### Emits
* `dp.hide` - if the widget was visible before that call
----------------------
### enable()
Enables the input element, the component is attached to, by removing `disabled` attribute from it.
----------------------
### clear()
Clears the datepicker by setting the value to `null`
### viewDate
<small>4.14.30</small> Issue #872
#### viewDate()
Returns a `moment` variable with the currently set `options.viewDate` option.
#### viewDate(viewDate)
Takes a `string, moment or Date` value.
This will change the `viewDate` without changing or setting the selected date.

View File

@@ -0,0 +1,161 @@
# Minimal Requirements
1. jQuery
2. Moment.js
3. Bootstrap.js (transition and collapse are required if you're not using the full Bootstrap)
4. Bootstrap Datepicker script
5. Bootstrap CSS
6. Bootstrap Datepicker CSS
7. Locales: Moment's locale files are [here](https://github.com/moment/moment/tree/master/locale)
# Installation Guides
* [Bower](#bower-)
* [Nuget](#nuget)
* [Rails](#rails-)
* [Angular](#angular-wrapper)
* [Meteor.js](#meteorjs)
* [Manual](#manual)
## [bower](http://bower.io) ![Bower version](https://badge.fury.io/bo/eonasdan-bootstrap-datetimepicker.png)
Run the following command:
```
bower install eonasdan-bootstrap-datetimepicker#latest --save
```
Include necessary scripts and styles:
```html
<head>
<!-- ... -->
<script type="text/javascript" src="/bower_components/jquery/jquery.min.js"></script>
<script type="text/javascript" src="/bower_components/moment/min/moment.min.js"></script>
<script type="text/javascript" src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="/bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" />
</head>
```
## Nuget
### [LESS](https://www.nuget.org/packages/Bootstrap.v3.Datetimepicker/): ![NuGet version](https://badge.fury.io/nu/Bootstrap.v3.Datetimepicker.png)
```
PM> Install-Package Bootstrap.v3.Datetimepicker
```
### [CSS](https://www.nuget.org/packages/Bootstrap.v3.Datetimepicker.CSS/): ![NuGet version](https://badge.fury.io/nu/Bootstrap.v3.Datetimepicker.CSS.png)
```
PM> Install-Package Bootstrap.v3.Datetimepicker.CSS
```
```html
<head>
<script type="text/javascript" src="/scripts/jquery.min.js"></script>
<script type="text/javascript" src="/scripts/moment.min.js"></script>
<script type="text/javascript" src="/scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="/scripts/bootstrap-datetimepicker.*js"></script>
<!-- include your less or built css files -->
<!--
bootstrap-datetimepicker-build.less will pull in "../bootstrap/variables.less" and "bootstrap-datetimepicker.less";
or
<link rel="stylesheet" href="/Content/bootstrap-datetimepicker.css" />
-->
</head>
```
## [Rails](http://rubygems.org/gems/bootstrap3-datetimepicker-rails) ![Gem Version](https://badge.fury.io/rb/bootstrap3-datetimepicker-rails.png)
Add the following to your `Gemfile`:
```ruby
gem 'momentjs-rails', '>= 2.9.0'
gem 'bootstrap3-datetimepicker-rails', '~> 4.14.30'
```
Note: You may need to change the version number above to the version number on the badge above.
Read the rest of the install instructions @
[TrevorS/bootstrap3-datetimepicker-rails](https://github.com/TrevorS/bootstrap3-datetimepicker-rails)
## Angular Wrapper
Follow the link [here](https://gist.github.com/eugenekgn/f00c4d764430642dca4b)
## Meteor.js
This widget has been package for the [Meteor.js](http://www.meteor.com/) platform, to install it use meteorite as follows:
`$ mrt add tsega:bootstrap3-datetimepicker`
For more detail see the package page on [Atmosphere](http://atmospherejs.com/package/bootstrap3-datetimepicker)
## Manual
### Acquire [jQuery](http://jquery.com)
### Acquire [Moment.js](https://github.com/moment/moment)
### Bootstrap 3 collapse and transition plugins
Make sure to include *.JS files for plugins [collapse](http://getbootstrap.com/javascript/#collapse) and [transitions](http://getbootstrap.com/javascript/#transitions). They are included with [bootstrap in js/ directory](https://github.com/twbs/bootstrap/tree/master/js)
Alternatively you could include the whole bundle of bootstrap plugins from [bootstrap.js](https://github.com/twbs/bootstrap/tree/master/dist/js)
```html
<script type="text/javascript" src="/path/to/jquery.js"></script>
<script type="text/javascript" src="/path/to/moment.js"></script>
<script type="text/javascript" src="/path/to/bootstrap/js/transition.js"></script>
<script type="text/javascript" src="/path/to/bootstrap/js/collapse.js"></script>
<script type="text/javascript" src="/path/to/bootstrap/dist/bootstrap.min.js"></script>
<script type="text/javascript" src="/path/to/bootstrap-datetimepicker.min.js"></script>
```
## Knockout
```
ko.bindingHandlers.dateTimePicker = {
init: function (element, valueAccessor, allBindingsAccessor) {
//initialize datepicker with some optional options
var options = allBindingsAccessor().dateTimePickerOptions || {};
$(element).datetimepicker(options);
//when a user changes the date, update the view model
ko.utils.registerEventHandler(element, "dp.change", function (event) {
var value = valueAccessor();
if (ko.isObservable(value)) {
if (event.date != null && !(event.date instanceof Date)) {
value(event.date.toDate());
} else {
value(event.date);
}
}
});
ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
var picker = $(element).data("DateTimePicker");
if (picker) {
picker.destroy();
}
});
},
update: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
var picker = $(element).data("DateTimePicker");
//when the view model is updated, update the widget
if (picker) {
var koDate = ko.utils.unwrapObservable(valueAccessor());
//in case return from server datetime i am get in this form for example /Date(93989393)/ then fomat this
koDate = (typeof (koDate) !== 'object') ? new Date(parseFloat(koDate.replace(/[^0-9]/g, ''))) : koDate;
picker.date(koDate);
}
}
};
```
### CSS styles
#### Using LESS
```css
@import "/path/to/bootstrap/less/variables";
@import "/path/to/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less";
// [...] your custom styles and variables
```
Using CSS (default color palette)
```html
<link rel="stylesheet" href="/path/to/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" />
```

View File

@@ -0,0 +1,909 @@
## Options
<div class="alert alert-info">
<strong>Note</strong>
All options are accessed via the <code>data</code> attribute e.g. <code>$('#datetimepicker').data("DateTimePicker").OPTION()</code>
</div>
### options()
Returns the components current options object. Note that the changing the values of the returned object does not change the components actual configuration. Use `options(options)` to set the components options massively or the other methods for setting config options individually.
### options([options])
Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component.
----------------------
### date
Returns the component's model current date, a `moment` object or `null` if not set.
####date([newDate])
Takes `string, Date, moment, null` parameter and sets the components model current moment to it. Passing a `null` value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the `options.format` and `options.useStrict` components configuration.
##### Throws
* `TypeError` - in case the `newDate` cannot be parsed
##### Emits
* `dp.change` - In case `newDate` is different from current moment
----------------------
### format
Default: false
See [momentjs' docs](http://momentjs.com/docs/#/displaying/format/) for valid formats. Format also dictates what components are shown, e.g. `MM/dd/YYYY` will not display the time picker.
#### format()
Returns the component's `options.format` `string`
#### format(format)
Takes a [moment.js](http://momentjs.com/docs/#/displaying/format/) format `string` and sets the components `options.format`. This is used for displaying and also for parsing input strings either from the input element the component is attached to or the `date()` function.
The parameter can also be a `boolean:false` in which case the format is set to the locale's `L LT`.
**Note:** this is also used to determine if the TimePicker sub component will display the hours in 12 or 24 format. (if 'a' or 'h' exists in the passed `string` then a 12 hour mode is set)
----------------------
### dayViewHeaderFormat
Default: 'MMMM YYYY'
Changes the heading of the datepicker when in "days" view.
![Datepicker Header](img/dpheader.png)
#### dayViewHeaderFormat()
Returns a `string` variable with the currently set `options.dayViewHeaderFormat` option.
#### dayViewHeaderFormat(string)
Takes a `string` value.
Used to customize the header of the day view.
----------------------
### extraFormats
Default: false
Allows for several input formats to be valid. See [this PR](https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666).
#### extraFormats()
Returns a `boolean` or array with the `options.extraFormats` option configuration
#### extraFormats(formats)
Takes an array of valid input moment format options.
----------------------
### stepping
Default: 1
Number of minutes the up/down arrow's will move the minutes value in the time picker
#### stepping()
Returns a `number` with the `options.stepping` option configuration
#### stepping(number)
Takes a `number`. This be the amount the up/down arrows move the minute value with a time picker.
----------------------
### min/maxDate
Default: false
Accepts: date, moment, string
Prevents date/time selections before this date. Will override `defaultDate` and `useCurrent` if either of these settings are the same day since both options are invalid according to the rules you've selected.
#### minDate()
Returns the currently set moment of the `options.minDate` or `false` if not set
#### minDate(minDate)
Takes a minDate `string, Date, moment, boolean:false` parameter and disallows the user to select a moment that is before that moment. If a `boolean:false` value is passed the `options.minDate` parameter is cleared and there is no restriction to the miminum moment the user can select.
**Note:** If the minDate parameter is after the currently selected moment the currently selected moment changes to minDate parameter
##### Throws
* `TypeError` - if minDate parameter cannot be parsed using the `options.format` and `options.useStrict` configuration settings
* `TypeError` - if minDate parameter is after `options.maxDate`
##### Emits
* `dp.change` - if the new minDate is after currently selected moment (waiting for #472 to close in order to finalize this part)
* `dp.error` - if the new minDate is after currently selected moment (waiting for #472 to close in order to finalize this part)
----------------------
#### maxDate()
Returns the currently set moment of the `options.maxDate` or `false` if not set
#### maxDate(maxDate)
Takes a maxDate `string, Date, moment, boolean:false` parameter and disallows the user to select a moment that is after that moment. If a `boolean:false` value is passed `options.maxDate` is cleared and there is no restriction to the maximum moment the user can select.
**Note:** If maxDate is before the currently selected moment the currently selected moment changes to maxDate
##### Throws
* `TypeError` - if maxDate parameter cannot be parsed using the `options.format` and `options.useStrict` configuration settings
* `TypeError` - if maxDate parameter is before `options.minDate`
##### Emits
* `dp.change` - if the new maxDate is after currently selected moment (waiting for #472 to close in order to finalize this part)
* `dp.error` - if the new maxDate is after currently selected moment (waiting for #472 to close in order to finalize this part)
----------------------
### useCurrent
Default: true
On `show`, will set the picker to the current date/time.
#### useCurrent()
Returns a `boolean` or `string` with the `options.useCurrent` option configuration
#### useCurrent(boolean or string)
Takes a `boolean` or `string`. If a `boolean` true is passed and the components model moment is not set (either through `setDate` or through a valid value on the input element the component is attached to) then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. If a false `boolean` is passed then no initialization happens on the input element. You can select the granularity on the initialized moment by passing one of the following strings (`'year', 'month', 'day', 'hour', 'minute'`) in the variable.
If for example you pass `'day'` to the `setUseCurrent` function and the input field is empty the first time the user opens the datetimepicker widget the input text will be initialized to the current datetime with day granularity (ie if currentTime = `2014-08-10 13:32:33` the input value will be initialized to `2014-08-10 00:00:00`)
**Note:** If the `options.defaultDate` is set or the input element the component is attached to has already a value that takes precedence and the functionality of `useCurrent` is not triggered!
----------------------
### collapse
Default: true
Using a Bootstraps collapse to switch between date/time pickers.
#### collapse()
Returns a `boolean` of the `options.sideBySide`.
#### collapse(collapse)
Takes a `boolean`. If set to `false` the picker will display similar to `sideBySide` except vertical.
----------------------
### locale
Default: moment.locale()
Accepts: string, moment.locale('locale')
See [momentjs](https://github.com/moment/moment/tree/develop/locale) for valid locales.
You must include `moment-with-locales.js` or a local js file.
#### locale()
Returns the currently set locale of the `options.locale`
#### locale(newLocale)
Takes a `string` of any valid [moment locale](https://github.com/moment/moment/tree/develop/locale) e.g. `de` for German.
##### Throws
* `TypeError` - if the locale is not loaded via a separate script or `moment-with-locales`
----------------------
### defaultDate
Default: false
Accepts: date, moment, string
Sets the picker default date/time. Overrides `useCurrent`
#### defaultDate()
Returns a `moment` with the `options.defaultDate` option configuration or `false` if not set
#### defaultDate(defaultDate)
Takes a `string, Date, moment, boolean:false`. Will set the picker's inital date. If a `boolean:false` value is passed the `options.defaultDate` parameter is cleared.
* `TypeError` - if the provided date pass validation, including `disabledDates`, `enabledDates`, `minDate`, `maxDate`, and `daysOfWeekDisabled`
* `TypeError` - if the provided date cannot be parsed by momentjs
----------------------
### en/disabledDates
Default: false
Accepts: array of [date, moment, string]
#### disabledDates()
Returns an array with the currently set disabled dates on the component.
#### disabledDates(dates)
Takes an `[` `string` or `Date` or `moment` `]` of values and disallows the user to select those days. Setting this takes precedence over `options.minDate`, `options.maxDate` configuration. Also calling this function removes the configuration of options.enabledDates if such exist.
**Note:** These values are matched with `Day` granularity.
----------------------
#### enabledDates()
Returns an array with the currently set enabled dates on the component.
#### enabledDates(dates)
Takes an `[` `string` or `Date` or `moment` `]` of values and allows the user to select only from those days. Setting this takes precedence over `options.minDate`, `options.maxDate` configuration. Also calling this function removes the configuration of options.disabledDates if such exist.
**Note:** These values are matched with `Day` granularity.
----------------------
### icons
Default: {
time: 'glyphicon glyphicon-time',
date: 'glyphicon glyphicon-calendar',
up: 'glyphicon glyphicon-chevron-up',
down: 'glyphicon glyphicon-chevron-down',
previous: 'glyphicon glyphicon-chevron-left',
next: 'glyphicon glyphicon-chevron-right',
today: 'glyphicon glyphicon-screenshot',
clear: 'glyphicon glyphicon-trash',
close: 'glyphicon glyphicon-remove'
}
Accepts: object with all or some of the parameters above
Change the default icons for the pickers functions.
#### icons()
Returns an `Ojbect` of `options.icons`
#### icons(icons)
Takes an `Ojbect` of `strings`.
##### Throws
* `TypeError` - if icons parameter is not an `Ojbect`
----------------------
### useStrict
Default: false
Defines if moment should use strict date parsing when considering a date to be valid.
#### useStrict()
Returns a `boolean` of the `options.useStrict`
#### useStrict(useStrict)
Takes a `boolean`. If `useStrict` is `true`, momentjs parsing rules will be stricter when determining if a date is valid or not.
----------------------
### sideBySide
Default: false
Shows the picker side by side when using the time and date together.
![SideBySide](img/sideBySide.png)
#### sideBySide()
Returns a `boolean` of the `options.sideBySide`.
#### sideBySide(sideBySide)
Takes a `boolean`. If `sideBySide` is `true` and the time picker is used, both components will display side by side instead of collapsing.
----------------------
### daysOfWeekDisabled
Default: []
Accepts: array of numbers from 0-6
Disables the section of days of the week, e.g. weekends.
#### daysOfWeekDisabled()
Returns an array with the `options.daysOfWeekDisabled` configuration setting of the component.
#### daysOfWeekDisabled(daysOfWeek)
Takes an `[` `Number`:`0` to `6` `]` and disallow the user to select weekdays that exist in this array. This has lower priority over the `options.minDate`, `options.maxDate`, `options.disabledDates` and `options.enabledDates` configuration settings.
##### Emits
* `dp.change` - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part)
* `dp.error` - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part)
----------------------
### calendarWeeks
Default: false
Shows the week of the year to the left of first day of the week.
![calendarWeek](img/calendarWeeks.png)
#### calendarWeeks()
Returns a `boolean` with the current `options.calendarWeeks` option configuration
#### calendarWeeks(boolean)
Takes a `boolean` variable to set if the week numbers will appear to the left on the days view
----------------------
### viewMode
Default: 'days'
Accepts: 'decades','years','months','days'
The default view to display when the picker is shown.
**Note**: To limit the picker to selecting, for instance the year and month, use `format: MM/YYYY`.
#### viewMode()
Returns a `string` of the `options.viewMode`.
#### viewMode(newViewMode)
Takes a `string`. Valid values are `'days'`, `'months'`, `'years'` and `'decades'`
##### Throws
* `TypeError` - if `newViewMode` parameter is not an a `string` or if `newViewMode` is not a valid value.
----------------------
### toolbarPlacement
Default: 'default'
Accepts: 'default', 'top', 'bottom'
Changes the placement of the icon toolbar.
![toolbarPlacement](img/toolbarPlacement.png)
#### toolbarplacement()
Returns a `string` variable with the currently set `options.toolbarplacement` option.
#### toolbarplacement(string)
Takes a `string` value. Valid values are `'default'`, `'top'` and `'bottom'`.
Changes the placement of the toolbar where the today, clear, component switch icon are located.
----------------------
### showTodayButton
Default: false
Show the "Today" button in the icon toolbar.
Clicking the "Today" button will set the calendar view and set the date to `now`.
#### showTodayButton()
Returns a `boolean` variable with the currently set `options.showTodayButton` option.
#### showTodayButton(boolean)
Takes a `boolean` variable to set if the Today button will appear on the widget
----------------------
### showClear
Default: false
Show the "Clear" button in the icon toolbar.
Clicking the "Clear" button will set the calendar to null.
#### showClear()
Returns a `boolean` variable with the currently set `options.showClear` option.
#### showClear(boolean)
Takes a `boolean` variable to set if the clear date button will appear on the widget
----------------------
### showClose
Default: false
Show the "Close" button in the icon toolbar.
Clicking the "Close" button will call `hide()`
#### showClose()
Returns a `boolean` variable with the currently set `options.showClose` option.
#### showClose(boolean)
Takes a `boolean` value.
If `true`, an icon will be displayed on the toolbar that will hide the picker
----------------------
### widgetPositioning
Default: {
horizontal: 'auto'
vertical: 'auto'
}
Accepts: object with the all or one of the parameters above
horizontal: 'auto', 'left', 'right'
vertical: 'auto', 'top', 'bottom'
#### widgetPositioning()
Returns the currently set `options.widgetPositioning` object containing two keys `horizontal` and `vertical`
#### widgetPositioning(positioningObject)
Takes an object parameter that can contain two keys `vertical` and `horizontal` each having a value of `'auto', 'top', 'bottom'` for `vertical` and `'auto', 'left', 'right'` for `horizontal` which defines where the dropdown with the widget will appear relative to the input element the component is attached to.
`'auto'` is the default value for both `horizontal` and `vertical` keys and it tries to automatically place the dropdown in a position that is visible to the user. Usually you should not override those options unless you have a special need in your layout.
----------------------
### widgetParent
Default: null
Accepts: string or jQuery object
On picker show, places the widget at the identifier (string) or jQuery object **if** the element has css `position: 'relative'`
#### widgetParent()
Returns a `$(element)` variable with the currently set `options.widgetParent` option.
#### widgetParent(widgetParent)
Takes a `string` or `$(element)` value.
----------------------
### keepOpen
Default: false
Will cause the date picker to stay open after selecting a date.
#### keepOpen()
Returns a `boolean` variable with the currently set `options.keepOpen` option.
#### keepOpen(boolean)
Takes a `boolean` value.
----------------------
### inline
Default: false
Will display the picker inline without the need of a input field. This will also hide borders and shadows.
#### inline()
Returns a `boolean` variable with the currently set `options.inline` option.
#### inline(boolean)
Takes a `boolean` value.
----------------------
### keepInvalid
<small>4.7.14</small>
Default: false
Will cause the date picker to **not** revert or overwrite invalid dates.
#### keepInvalid()
Returns a `string` variable with the currently set `options.keepInvalid` option.
#### keepInvalid(boolean)
Takes a `boolean` value.
If `true`, invalid dates will not be reverted to a previous selection or changed.
----------------------
### keyBinds
Default: up: function (widget) {
if (widget.find('.datepicker').is(':visible')) {
this.date(this.date().clone().subtract(7, 'd'));
} else {
this.date(this.date().clone().add(1, 'm'));
}
},
down: function (widget) {
if (!widget) {
this.show();
}
else if (widget.find('.datepicker').is(':visible')) {
this.date(this.date().clone().add(7, 'd'));
} else {
this.date(this.date().clone().subtract(1, 'm'));
}
},
'control up': function (widget) {
if (widget.find('.datepicker').is(':visible')) {
this.date(this.date().clone().subtract(1, 'y'));
} else {
this.date(this.date().clone().add(1, 'h'));
}
},
'control down': function (widget) {
if (widget.find('.datepicker').is(':visible')) {
this.date(this.date().clone().add(1, 'y'));
} else {
this.date(this.date().clone().subtract(1, 'h'));
}
},
left: function (widget) {
if (widget.find('.datepicker').is(':visible')) {
this.date(this.date().clone().subtract(1, 'd'));
}
},
right: function (widget) {
if (widget.find('.datepicker').is(':visible')) {
this.date(this.date().clone().add(1, 'd'));
}
},
pageUp: function (widget) {
if (widget.find('.datepicker').is(':visible')) {
this.date(this.date().clone().subtract(1, 'M'));
}
},
pageDown: function (widget) {
if (widget.find('.datepicker').is(':visible')) {
this.date(this.date().clone().add(1, 'M'));
}
},
enter: function () {
this.hide();
},
escape: function () {
this.hide();
},
'control space': function (widget) {
if (widget.find('.timepicker').is(':visible')) {
widget.find('.btn[data-action="togglePeriod"]').click();
}
},
t: function () {
this.date(moment());
},
'delete': function () {
this.clear();
}
Allows for custom events to fire on keyboard press.
#### keyBinds()
Returns a `string` variable with the currently set `options.keyBinds` option.
#### keyBinds(object)
Takes an `object` value.
Allows for several keyBinding functions to be specified for ease of access or accessibility. See the options page for defaults.
----------------------
### debug
<small>4.7.14</small>
Default: false
Will cause the date picker to stay open after a `blur` event.
----------------------
### ignoreReadonly
<small>4.7.14</small>
Default: false
Allow date picker show event to fire even when the associated input element has the `readonly="readonly"`property.
#### ignoreReadonly()
Returns a `boolean` variable with the currently set `options.ignoreReadonly` option.
#### ignoreReadonly(boolean)
Takes a `boolean` value.
Set this to `true` to allow the picker to be used even if the input field is `readonly`. This will **not** bypass the `disabled` property
----------------------
### disabledTimeIntervals
<small>4.14.30</small>
Default: false
Disables time selection between the given `moments`.
#### disabledTimeIntervals()
Returns an `array` variable with the currently set `options.disabledTimeIntervals` option.
#### disabledTimeIntervals(array)
Takes a `array` value.
The array **must** be in the following format `[moment(),moment()]`
For example:
disabledTimeIntervals: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]]
Will disable times between 12-8am and 6-12pm today
----------------------
### allowInputToggle
<small>4.14.30</small>
Default: false
If `true`, the picker will show on textbox focus and icon click when used in a button group.
#### allowInputToggle()
Returns a `boolean` variable with the currently set `options.allowInputToggle` option.
#### allowInputToggle(boolean)
Takes a `boolean` value.
If `true`, the picker will show on textbox focus and icon click when used in a button group
----------------------
### focusOnShow
<small>4.14.30</small>
Default: true
If `false`, the textbox will not be given focus when the picker is shown.
#### focusOnShow()
Returns a `boolean` variable with the currently set `options.focusOnShow` option.
#### focusOnShow(boolean)
Takes a `boolean` value.
If `false`, the textbox will not be given focus when the picker is shown
----------------------
### en/disabledHours
<small>4.14.30</small> Issue: #851
Default: false
#### disabledHours()
Returns an `array` variable with the currently set `options.en/disabledHours` option.
#### disabledHours(boolean)
Takes a `array` value.
Must be in 24 hour format. Will allow or disallow hour selections (much like `disabledTimeIntervals`) but will affect all days.
Like `en/disabledDates`, these options are mutually exclusive and will reset one of the options back to false.
disabledHours: [0, 1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24]
enabledHours: [9, 10, 11, 12, 13, 14, 15, 16]
----------------------
### viewDate
<small>4.14.30</small>
Default: false
This will change the `viewDate` without changing or setting the selected date.
----------------------
### parseInputDate
<small>4.14.30</small> Issue #1095
#### parseInputDate()
Returns a `function` with the currently set `options.parseInputDate`
#### parseInputDate(function)
Takes a `function`
Allows custom input formatting For example: the user can enter 'yesterday' or '30 days ago'.
Example:
```
var parseRelativeDate = function(relativeDate) {
switch (relativeDate) {
case 'today':
return moment()
case 'yesterday':
return moment().subtract(1, 'day');
default:
return moment()
.subtract(Number(relativeDate.replace("days ago", "").trim()), 'days');
}
}
var parseInputDate = function(inputDate) {
var relativeDatePattern = /today|yesterday|[0-9]+\s+(days ago)/,
resultDate;
if (moment.isMoment(inputDate) || inputDate instanceof Date) {
resultDate = moment(inputDate);
} else {
var relativeDate = inputDate.match(relativeDatePattern),
parseDate = null;
if (relativeDate !== null)
parseDate = this.parseRelativeDate(inputDate.match(relativeDatePattern)[0]);
else
parseDate = moment();
resultDate = moment(parseDate, "YYYY-MM-DD");
}
return resultDate;
}
```
----------------------
### tooltips
<small>4.15.35</small>
```
tooltips: {
today: 'Go to today',
clear: 'Clear selection',
close: 'Close the picker',
selectMonth: 'Select Month',
prevMonth: 'Previous Month',
nextMonth: 'Next Month',
selectYear: 'Select Year',
prevYear: 'Previous Year',
nextYear: 'Next Year',
selectDecade: 'Select Decade',
prevDecade: 'Previous Decade',
nextDecade: 'Next Decade',
prevCentury: 'Previous Century',
nextCentury: 'Next Century'
}
```
This will change the `tooltips` over each icon to a custom string.
#### tooltips()
Returns an `Ojbect` of `options.tooltips`
#### tooltips(tooltips)
Takes an `Ojbect` of `strings`.
##### Throws
* `TypeError` - if tooltips parameter is not an `Ojbect`
----------------------
### timeZone
<small>4.17.37</small>
```
timeZone: ''
```
Allows the setting of the Time Zone. You must include [`moment-timezone.js`](http://momentjs.com/timezone/) and `moment-timzone` data. See moment timezone documentation for usage.
#### timeZone()
Returns an `string` of `options.timeZone`
#### timeZone(timeZone)
Takes an `string` of a valid timezone.
##### Throws
* `TypeError` - if tooltips parameter is not an `string`

View File

@@ -0,0 +1,6 @@
<meta http-equiv="refresh" content="1; url=/Changelog/"/>
<meta http-equiv="refresh" content="0; url=/Changelog/"/>
<link rel="canonical" href="/Changelog/">
<p>The page has moved to:
<a href="/Changelog/">this page</a></p>

View File

@@ -0,0 +1,6 @@
<meta http-equiv="refresh" content="1; url=/Changelog/"/>
<meta http-equiv="refresh" content="0; url=/ContributorsGuide/"/>
<link rel="canonical" href="/ContributorsGuide/">
<p>The page has moved to:
<a href="/ContributorsGuide/">this page</a></p>

View File

@@ -0,0 +1,644 @@
#Bootstrap 3 Datepicker v4 Docs
<div class="alert alert-info">
<strong>Note</strong>
All functions are accessed via the <code>data</code> attribute e.g. <code>$('#datetimepicker').data("DateTimePicker").FUNCTION()</code>
</div>
### Minimum Setup
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</div>
</div>
#### Code
```
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</div>
</div>
```
----------------------
### Using Locales
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker2'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker2').datetimepicker({
locale: 'ru'
});
});
</script>
</div>
</div>
#### Code
```
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker2'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker2').datetimepicker({
locale: 'ru'
});
});
</script>
</div>
</div>
```
----------------------
### Time Only
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker3'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker3').datetimepicker({
format: 'LT'
});
});
</script>
</div>
</div>
#### Code
```
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker3'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker3').datetimepicker({
format: 'LT'
});
});
</script>
</div>
</div>
```
----------------------
### Date Only
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker3'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker3').datetimepicker({
format: 'L'
});
});
</script>
</div>
</div>
#### Code
```
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker3'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker3').datetimepicker({
format: 'LT'
});
});
</script>
</div>
</div>
```
----------------------
### No Icon (input field only):
<div class="container">
<div class="row">
<div class='col-sm-6'>
<input type='text' class="form-control" id='datetimepicker4' />
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker4').datetimepicker();
});
</script>
</div>
</div>
#### Code
```
<div class="container">
<div class="row">
<div class='col-sm-6'>
<input type='text' class="form-control" id='datetimepicker4' />
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker4').datetimepicker();
});
</script>
</div>
</div>
```
----------------------
### Enabled/Disabled Dates
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker5'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker5').datetimepicker({
defaultDate: "11/1/2013",
disabledDates: [
moment("12/25/2013"),
new Date(2013, 11 - 1, 21),
"11/22/2013 00:53"
]
});
});
</script>
</div>
</div>
#### Code
```
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker5'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker5').datetimepicker({
defaultDate: "11/1/2013",
disabledDates: [
moment("12/25/2013"),
new Date(2013, 11 - 1, 21),
"11/22/2013 00:53"
]
});
});
</script>
</div>
</div>
```
----------------------
### Linked Pickers
<div class="container">
<div class='col-md-5'>
<div class="form-group">
<div class='input-group date' id='datetimepicker6'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<div class='col-md-5'>
<div class="form-group">
<div class='input-group date' id='datetimepicker7'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker6').datetimepicker();
$('#datetimepicker7').datetimepicker({
useCurrent: false
});
$("#datetimepicker6").on("dp.change", function (e) {
$('#datetimepicker7').data("DateTimePicker").minDate(e.date);
});
$("#datetimepicker7").on("dp.change", function (e) {
$('#datetimepicker6').data("DateTimePicker").maxDate(e.date);
});
});
</script>
#### Code
```
<div class="container">
<div class='col-md-5'>
<div class="form-group">
<div class='input-group date' id='datetimepicker6'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<div class='col-md-5'>
<div class="form-group">
<div class='input-group date' id='datetimepicker7'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker6').datetimepicker();
$('#datetimepicker7').datetimepicker({
useCurrent: false //Important! See issue #1075
});
$("#datetimepicker6").on("dp.change", function (e) {
$('#datetimepicker7').data("DateTimePicker").minDate(e.date);
});
$("#datetimepicker7").on("dp.change", function (e) {
$('#datetimepicker6').data("DateTimePicker").maxDate(e.date);
});
});
</script>
```
----------------------
### Custom Icons
<div class="container">
<div class="col-sm-6" style="height:130px;">
<div class="form-group">
<div class='input-group date' id='datetimepicker8'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="fa fa-calendar">
</span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker8').datetimepicker({
icons: {
time: "fa fa-clock-o",
date: "fa fa-calendar",
up: "fa fa-arrow-up",
down: "fa fa-arrow-down"
}
});
});
</script>
</div>
#### Code
```
<div class="container">
<div class="col-sm-6" style="height:130px;">
<div class="form-group">
<div class='input-group date' id='datetimepicker8'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="fa fa-calendar">
</span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker8').datetimepicker({
icons: {
time: "fa fa-clock-o",
date: "fa fa-calendar",
up: "fa fa-arrow-up",
down: "fa fa-arrow-down"
}
});
});
</script>
</div>
```
----------------------
### View Mode
<div class="container">
<div class="col-sm-6" style="height:130px;">
<div class="form-group">
<div class='input-group date' id='datetimepicker9'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar">
</span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker9').datetimepicker({
viewMode: 'years'
});
});
</script>
</div>
#### Code
```
<div class="container">
<div class="col-sm-6" style="height:130px;">
<div class="form-group">
<div class='input-group date' id='datetimepicker9'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar">
</span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker9').datetimepicker({
viewMode: 'years'
});
});
</script>
</div>
```
----------------------
### Min View Mode
<div class="container">
<div class="col-sm-6" style="height:130px;">
<div class="form-group">
<div class='input-group date' id='datetimepicker10'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar">
</span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker10').datetimepicker({
viewMode: 'years',
format: 'MM/YYYY'
});
});
</script>
</div>
#### Code
```
<div class="container">
<div class="col-sm-6" style="height:130px;">
<div class="form-group">
<div class='input-group date' id='datetimepicker10'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar">
</span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker10').datetimepicker({
viewMode: 'years',
format: 'MM/YYYY'
});
});
</script>
</div>
```
----------------------
### Disabled Days of the Week
<div class="container">
<div class="col-sm-6" style="height:130px;">
<div class="form-group">
<div class='input-group date' id='datetimepicker11'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar">
</span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker11').datetimepicker({
daysOfWeekDisabled: [0, 6]
});
});
</script>
</div>
#### Code
```
<div class="container">
<div class="col-sm-6" style="height:130px;">
<div class="form-group">
<div class='input-group date' id='datetimepicker11'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar">
</span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker11').datetimepicker({
daysOfWeekDisabled: [0, 6]
});
});
</script>
</div>
```
----------------------
### Inline
<div style="overflow:hidden;">
<div class="form-group">
<div class="row">
<div class="col-md-8">
<div id="datetimepicker12"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker12').datetimepicker({
inline: true,
sideBySide: true
});
});
</script>
</div>
#### Code
```
<div style="overflow:hidden;">
<div class="form-group">
<div class="row">
<div class="col-md-8">
<div id="datetimepicker12"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker12').datetimepicker({
inline: true,
sideBySide: true
});
});
</script>
</div>
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Some files were not shown because too many files have changed in this diff Show More