Datetime picker #411

Added eonasdan bootstrap-datetimepicker
This commit is contained in:
William 2017-06-13 11:59:40 -05:00 committed by GitHub
parent a9fc38d774
commit 3ccd984ad3
80 changed files with 8765 additions and 0 deletions

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View file

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if page_description %}<meta name="description" content="{{ page_description }}">{% endif %}
{% if site_author %}<meta name="author" content="{{ site_author }}">{% endif %}
{% if canonical_url %}<link rel="canonical" href="{{ canonical_url }}">{% endif %}
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
<link rel="icon" type="image/png" href="/favicon-196x196.png" sizes="196x196">
<link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<title>{{ page_title }}</title>
<link rel="stylesheet" type="text/css" media="screen" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link href="{{ base_url }}/css/prettify-1.0.css" rel="stylesheet">
<link href="{{ base_url }}/css/base.css" rel="stylesheet">
{%- for path in extra_css %}
<link href="{{ path }}" rel="stylesheet">
{%- endfor %}
<!-- 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.3.0/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
{%- for path in extra_javascript %}
<script src="{{ path }}"></script>
{%- endfor %}
</head>
<body>
{% include "nav.html" %}
<div class="container">
<div class="row">
<div class="col-md-3">{% include "toc.html" %}</div>
<div class="col-md-9" role="main">{% include "content.html" %}</div>
</div>
</div>
{% if include_search %}{% include "search.html" %}{% endif %}
<script src="{{ base_url }}/js/prettify-1.0.min.js"></script>
<script src="{{ base_url }}/js/base.js"></script>
<script>
if (top != self) { top.location.replace(self.location.href); }
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-47462200-1', 'eonasdan.github.io');
ga('send', 'pageview');
</script>
</body>
</html>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/mstile-70x70.png"/>
<square150x150logo src="/mstile-150x150.png"/>
<square310x310logo src="/mstile-310x310.png"/>
<wide310x150logo src="/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

View file

@ -0,0 +1,9 @@
{% if meta.source %}
<div class="source-links">
{% for filename in meta.source %}
<span class="label label-primary">{{ filename }}</span>
{% endfor %}
</div>
{% endif %}
{{ content }}

View file

@ -0,0 +1,107 @@
body {
padding-top: 70px;
}
ul.nav li.main {
font-weight: bold;
}
div.col-md-3 {
padding-left: 0;
}
div.source-links {
float: right;
}
/*
* Side navigation
*
* Scrollspy and affixed enhanced navigation to highlight sections and secondary
* sections of docs content.
*/
/* By default it's not affixed in mobile views, so undo that */
.bs-sidebar {
overflow-y: scroll;
max-height: 86%;
overflow-x: hidden;
}
.bs-sidebar.affix {
position: static;
}
.bs-sidebar.well {
padding: 0;
}
/* First level of nav */
.bs-sidenav {
margin-top: 30px;
margin-bottom: 30px;
padding-top: 10px;
padding-bottom: 10px;
border-radius: 5px;
}
/* All levels of nav */
.bs-sidebar .nav > li > a {
display: block;
padding: 5px 20px;
}
.bs-sidebar .nav > li > a:hover,
.bs-sidebar .nav > li > a:focus {
text-decoration: none;
border-right: 1px solid;
}
.bs-sidebar .nav > .active > a,
.bs-sidebar .nav > .active:hover > a,
.bs-sidebar .nav > .active:focus > a {
font-weight: bold;
background-color: transparent;
border-right: 1px solid;
}
/* Nav: second level (shown on .active) */
.bs-sidebar .nav .nav {
display: none; /* Hide by default, but at >768px, show it */
margin-bottom: 8px;
}
.bs-sidebar .nav .nav > li > a {
padding-top: 3px;
padding-bottom: 3px;
padding-left: 30px;
font-size: 90%;
}
/* Show and affix the side nav when space allows it */
@media (min-width: 992px) {
.bs-sidebar .nav > .active > ul {
display: block;
}
/* Widen the fixed sidebar */
.bs-sidebar.affix,
.bs-sidebar.affix-bottom {
width: 213px;
}
.bs-sidebar.affix {
position: fixed; /* Undo the static from mobile first approach */
top: 80px;
}
.bs-sidebar.affix-bottom {
position: absolute; /* Undo the static from mobile first approach */
}
.bs-sidebar.affix-bottom .bs-sidenav,
.bs-sidebar.affix .bs-sidenav {
margin-top: 0;
margin-bottom: 0;
}
}
@media (min-width: 1200px) {
/* Widen the fixed sidebar again */
.bs-sidebar.affix-bottom,
.bs-sidebar.affix {
width: 263px;
}
}

View file

@ -0,0 +1,28 @@
.com { color: #93a1a1; }
.lit { color: #195f91; }
.pun, .opn, .clo { color: #93a1a1; }
.fun { color: #dc322f; }
.str, .atv { color: #D14; }
.kwd, .prettyprint .tag { color: #1e347b; }
.typ, .atn, .dec, .var { color: teal; }
.pln { color: #48484c; }
.prettyprint {
padding: 8px;
}
.prettyprint.linenums {
-webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
-moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin: 0 0 0 33px; /* IE indents via margin-left */
}
ol.linenums li {
padding-left: 12px;
color: #bebec5;
line-height: 20px;
text-shadow: 0 1px 0 #fff;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -0,0 +1,52 @@
/* Prettyify */
$( document ).ready(function() {
prettyPrint();
});
/* Scrollspy */
var navHeight = $('.navbar').outerHeight(true) + 10
$('body').scrollspy({
target: '.bs-sidebar',
offset: navHeight
})
/* Prevent disabled links from causing a page reload */
$("li.disabled a").click(function() {
event.preventDefault();
});
/* Adjust the scroll height of anchors to compensate for the fixed navbar */
window.disableShift = false;
var shiftWindow = function() {
if (window.disableShift) {
window.disableShift = false;
} else {
/* If we're at the bottom of the page, don't erronously scroll up */
var scrolledToBottomOfPage = (
(window.innerHeight + window.scrollY) >= document.body.offsetHeight
);
if (!scrolledToBottomOfPage) {
scrollBy(0, -60);
};
};
};
if (location.hash) {shiftWindow();}
window.addEventListener("hashchange", shiftWindow);
/* Deal with clicks on nav links that do not change the current anchor link. */
$("ul.nav a" ).click(function() {
var href = this.href;
var suffix = location.hash;
var matchesCurrentHash = (href.indexOf(suffix, href.length - suffix.length) !== -1);
if (location.hash && matchesCurrentHash) {
/* Force a single 'hashchange' event to occur after the click event */
window.disableShift = true;
location.hash='';
};
});

View file

@ -0,0 +1,28 @@
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();

View file

@ -0,0 +1,41 @@
{
"name": "Eonasdan.com",
"icons": [
{
"src": "\/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -0,0 +1,76 @@
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Main title -->
<a class="navbar-brand" href="{{ homepage_url }}">{{ site_name }}</a>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
{% for nav_item in nav %}
{% if nav_item.children %}
<li class="dropdown{% if nav_item.active %} active{% endif %}">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ nav_item.title }} <b class="caret"></b></a>
<ul class="dropdown-menu">
{% for nav_item in nav_item.children %}
<li {% if nav_item.active %}class="active"{% endif %}>
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
</li>
{% endfor %}
</ul>
</li>
{% else %}
<li {% if nav_item.active %}class="active"{% endif %}>
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
<!-- Search, Navigation and Repo links -->
<ul class="nav navbar-nav navbar-right">
{% if include_search %}
<li>
<a href="#searchModal" data-toggle="modal"><i class="fa fa-search"></i> Search</a>
</li>
{% endif %}
{% if false %}
<li {% if not previous_page %}class="disabled"{% endif %}>
<a rel="next" {% if previous_page %}href="{{ previous_page.url }}"{% endif %}>
<i class="fa fa-arrow-left"></i> Previous
</a>
</li>
<li {% if not next_page %}class="disabled"{% endif %}>
<a rel="prev" {% if next_page %}href="{{ next_page.url }}"{% endif %}>
Next <i class="fa fa-arrow-right"></i>
</a>
</li>
{% endif %}
{% if repo_url %}
<li>
<a href="{{ repo_url }}">
{% if repo_name == 'GitHub' %}
<i class="fa fa-github"></i>
{% elif repo_name == 'Bitbucket' %}
<i class="fa fa-bitbucket"></i>
{% endif %}
{{ repo_name }}
</a>
</li>
{% endif %}
</ul>
</div>
</div>
</div>

View file

@ -0,0 +1,10 @@
<div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
{% for toc_item in toc %}
<li class="main {% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{% for toc_item in toc_item.children %}
<li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{% endfor %}
{% endfor %}
</ul>
</div>

View file

@ -0,0 +1,202 @@
site_name: Bootstrap 3 Datepicker
theme_dir: docs/theme
extra_javascript: ['//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js','//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js']
extra_css: ['//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/build/css/bootstrap-datetimepicker.css']
repo_url: https://github.com/Eonasdan/bootstrap-datetimepicker
pages:
- Usage: 'index.md'
- Installing: 'Installing.md'
- Functions: 'Functions.md'
- Options: 'Options.md'
- Events: 'Events.md'
- Change Log: 'Changelog.md'
- Dev Guide: 'ContributorsGuide.md'
- Extras: 'Extras.md'
- FAQs: 'FAQ.md'
- Issues:
- Issues: 'Issues/Index.md'
- 1014: 'Issues/1014.md'
- 1041: 'Issues/1041.md'
- 1045: 'Issues/1045.md'
- 1058: 'Issues/1058.md'
- 1059: 'Issues/1059.md'
- 1065: 'Issues/1065.md'
- 1073: 'Issues/1073.md'
- 1097: 'Issues/1097.md'
- 1126: 'Issues/1126.md'
- 1130: 'Issues/1130.md'
- 1132: 'Issues/1132.md'
- 1144: 'Issues/1144.md'
- 1154: 'Issues/1154.md'
- 1158: 'Issues/1158.md'
- 1170: 'Issues/1170.md'
- 1171: 'Issues/1171.md'
- 1173: 'Issues/1173.md'
- 1177: 'Issues/1177.md'
- 1180: 'Issues/1180.md'
- 1181: 'Issues/1181.md'
- 1185: 'Issues/1185.md'
- 1186: 'Issues/1186.md'
- 1189: 'Issues/1189.md'
- 1191: 'Issues/1191.md'
- 1195: 'Issues/1195.md'
- 1199: 'Issues/1199.md'
- 1211: 'Issues/1211.md'
- 1219: 'Issues/1219.md'
- 1224: 'Issues/1224.md'
- 1236: 'Issues/1236.md'
- 1238: 'Issues/1238.md'
- 1246: 'Issues/1246.md'
- 1247: 'Issues/1247.md'
- 1249: 'Issues/1249.md'
- 1250: 'Issues/1250.md'
- 1251: 'Issues/1251.md'
- 1257: 'Issues/1257.md'
- 1267: 'Issues/1267.md'
- 1270: 'Issues/1270.md'
- 1273: 'Issues/1273.md'
- 1276: 'Issues/1276.md'
- 1277: 'Issues/1277.md'
- 1278: 'Issues/1278.md'
- 1279: 'Issues/1279.md'
- 1285: 'Issues/1285.md'
- 1289: 'Issues/1289.md'
- 1290: 'Issues/1290.md'
- 1291: 'Issues/1291.md'
- 1294: 'Issues/1294.md'
- 1295: 'Issues/1295.md'
- 1297: 'Issues/1297.md'
- 1299: 'Issues/1299.md'
- 1300: 'Issues/1300.md'
- 1302: 'Issues/1302.md'
- 1303: 'Issues/1303.md'
- 1304: 'Issues/1304.md'
- 1307: 'Issues/1307.md'
- 1311: 'Issues/1311.md'
- 1313: 'Issues/1313.md'
- 1314: 'Issues/1314.md'
- 1318: 'Issues/1318.md'
- 1323: 'Issues/1323.md'
- 1324: 'Issues/1324.md'
- 1326: 'Issues/1326.md'
- 1328: 'Issues/1328.md'
- 1334: 'Issues/1334.md'
- 1337: 'Issues/1337.md'
- 1338: 'Issues/1338.md'
- 1339: 'Issues/1339.md'
- 1340: 'Issues/1340.md'
- 1341: 'Issues/1341.md'
- 1343: 'Issues/1343.md'
- 1344: 'Issues/1344.md'
- 1345: 'Issues/1345.md'
- 1346: 'Issues/1346.md'
- 1347: 'Issues/1347.md'
- 1349: 'Issues/1349.md'
- 1351: 'Issues/1351.md'
- 1353: 'Issues/1353.md'
- 1354: 'Issues/1354.md'
- 1355: 'Issues/1355.md'
- 1356: 'Issues/1356.md'
- 1357: 'Issues/1357.md'
- 1358: 'Issues/1358.md'
- 1359: 'Issues/1359.md'
- 1360: 'Issues/1360.md'
- 1361: 'Issues/1361.md'
- 1363: 'Issues/1363.md'
- 1364: 'Issues/1364.md'
- 1366: 'Issues/1366.md'
- 1368: 'Issues/1368.md'
- 1369: 'Issues/1369.md'
- 1371: 'Issues/1371.md'
- 1372: 'Issues/1372.md'
- 1374: 'Issues/1374.md'
- 1377: 'Issues/1377.md'
- 1379: 'Issues/1379.md'
- 1380: 'Issues/1380.md'
- 1383: 'Issues/1383.md'
- 1384: 'Issues/1384.md'
- 1386: 'Issues/1386.md'
- 1387: 'Issues/1387.md'
- 1395: 'Issues/1395.md'
- 1405: 'Issues/1405.md'
- 1408: 'Issues/1408.md'
- 1412: 'Issues/1412.md'
- 1413: 'Issues/1413.md'
- 1417: 'Issues/1417.md'
- 1422: 'Issues/1422.md'
- 1423: 'Issues/1423.md'
- 1426: 'Issues/1426.md'
- 1427: 'Issues/1427.md'
- 1428: 'Issues/1428.md'
- 1429: 'Issues/1429.md'
- 1430: 'Issues/1430.md'
- 1432: 'Issues/1432.md'
- 1433: 'Issues/1433.md'
- 1436: 'Issues/1436.md'
- 1438: 'Issues/1438.md'
- 1439: 'Issues/1439.md'
- 1441: 'Issues/1441.md'
- 1443: 'Issues/1443.md'
- 1444: 'Issues/1444.md'
- 1445: 'Issues/1445.md'
- 1446: 'Issues/1446.md'
- 1448: 'Issues/1448.md'
- 1449: 'Issues/1449.md'
- 1453: 'Issues/1453.md'
- 1454: 'Issues/1454.md'
- 1457: 'Issues/1457.md'
- 1459: 'Issues/1459.md'
- 1461: 'Issues/1461.md'
- 1462: 'Issues/1462.md'
- 1463: 'Issues/1463.md'
- 1465: 'Issues/1465.md'
- 1466: 'Issues/1466.md'
- 1469: 'Issues/1469.md'
- 1471: 'Issues/1471.md'
- 1474: 'Issues/1474.md'
- 1475: 'Issues/1475.md'
- 1477: 'Issues/1477.md'
- 1478: 'Issues/1478.md'
- 1479: 'Issues/1479.md'
- 1480: 'Issues/1480.md'
- 1483: 'Issues/1483.md'
- 1484: 'Issues/1484.md'
- 1485: 'Issues/1485.md'
- 1486: 'Issues/1486.md'
- 1489: 'Issues/1489.md'
- 1490: 'Issues/1490.md'
- 1491: 'Issues/1491.md'
- 1493: 'Issues/1493.md'
- 1494: 'Issues/1494.md'
- 1496: 'Issues/1496.md'
- 1498: 'Issues/1498.md'
- 1499: 'Issues/1499.md'
- 1505: 'Issues/1505.md'
- 1506: 'Issues/1506.md'
- 1507: 'Issues/1507.md'
- 1511: 'Issues/1511.md'
- 1512: 'Issues/1512.md'
- 1513: 'Issues/1513.md'
- 1514: 'Issues/1514.md'
- 1515: 'Issues/1515.md'
- 1516: 'Issues/1516.md'
- 1519: 'Issues/1519.md'
- 1520: 'Issues/1520.md'
- 1521: 'Issues/1521.md'
- 1522: 'Issues/1522.md'
- 1523: 'Issues/1523.md'
- 1524: 'Issues/1524.md'
- 1526: 'Issues/1526.md'
- 1527: 'Issues/1527.md'
- 1529: 'Issues/1529.md'
- 766: 'Issues/766.md'
- 790: 'Issues/790.md'
- 935: 'Issues/935.md'
- 943: 'Issues/943.md'
- 950: 'Issues/950.md'
- 957: 'Issues/957.md'
- 959: 'Issues/959.md'
- 982: 'Issues/982.md'
- 985: 'Issues/985.md'
- 993: 'Issues/993.md'
- 995: 'Issues/995.md'

View file

@ -0,0 +1,51 @@
{
"author": {
"name": "Jonathan Peterson"
},
"bugs": {
"url": "https://github.com/eonasdan/bootstrap-datetimepicker/issues"
},
"peerDependencies": {
"bootstrap": "^3.3",
"jquery": "^1.8.3 || ^2.0 || ^3.0",
"moment": "^2.10",
"moment-timezone": "^0.4.0"
},
"dependencies": {
"bootstrap": "^3.3",
"jquery": "^1.8.3 || ^2.0 || ^3.0",
"moment": "^2.10",
"moment-timezone": "^0.4.0"
},
"description": "A date/time picker component designed to work with Bootstrap 3 and Momentjs. For usage, installation and demos see Project Site on GitHub",
"devDependencies": {
"grunt": "latest",
"grunt-contrib-connect": "^1.0.1",
"grunt-contrib-jasmine": "^1.0.3",
"grunt-contrib-jshint": "latest",
"grunt-contrib-less": "latest",
"grunt-contrib-uglify": "latest",
"grunt-env": "^0.4.4",
"grunt-jscs": "latest",
"grunt-nuget": "^0.1.5",
"grunt-string-replace": "latest",
"load-grunt-tasks": "latest"
},
"homepage": "http://eonasdan.github.io/bootstrap-datetimepicker/",
"keywords": [
"twitter-bootstrap",
"bootstrap",
"datepicker",
"datetimepicker",
"timepicker",
"moment"
],
"license": "MIT",
"main": "src/js/bootstrap-datetimepicker.js",
"name": "eonasdan-bootstrap-datetimepicker",
"repository": {
"type": "git",
"url": "https://github.com/eonasdan/bootstrap-datetimepicker.git"
},
"version": "4.17.47"
}

File diff suppressed because it is too large Load diff

View file

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

View file

@ -0,0 +1,17 @@
// Import bootstrap variables including default color palette and fonts
@import "bootstrap/less/variables.less";
// Import datepicker component
@import "_bootstrap-datetimepicker.less";
//this is here so the compiler doesn't complain about a missing bootstrap mixin
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
}

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Bootstrap.v3.Datetimepicker.CSS</id>
<version>4.0.0</version>
<title>Bootstrap 3 Datetimepicker CSS</title>
<authors>Eonasdan</authors>
<owners>Eonasdan</owners>
<projectUrl>https://github.com/Eonasdan/bootstrap-datetimepicker</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A date/time picker component designed to work with Bootstrap 3 and Momentjs.
For usage, installation and demos see Project Site on GitHub
For LESS version install Bootstrap.v3.Datetimepicker</description>
<releaseNotes>
Check the change log on Github at https://github.com/Eonasdan/bootstrap-datetimepicker/wiki/Change-Log
IMPORANT! The Nuget packages will be depreciated in an upcoming release. Moving forward, Asp.Net/Nuget will NOT be delivering content packages like this one and you will need to use bower. See https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1128 for more
</releaseNotes>
<tags>bootstrap date time picker datetimepicker datepicker jquery</tags>
<dependencies>
<dependency id="bootstrap" version="3.3.0" />
<dependency id="Moment.js" version="2.9.0" />
</dependencies>
</metadata>
<files>
<file src="..\..\src\js\bootstrap-datetimepicker.js" target="content\Scripts" />
<file src="..\..\build\js\bootstrap-datetimepicker.min.js" target="content\Scripts" />
<file src="..\..\build\css\bootstrap-datetimepicker.css" target="content\Content" />
<file src="..\..\build\css\bootstrap-datetimepicker.min.css" target="content\Content" />
<file src="install.ps1" target="tools\" />
</files>
</package>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Bootstrap.v3.Datetimepicker</id>
<version>4.0.0</version>
<title>Bootstrap 3 Datetimepicker</title>
<authors>Eonasdan</authors>
<owners>Eonasdan</owners>
<projectUrl>https://github.com/Eonasdan/bootstrap-datetimepicker</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A date/time picker component designed to work with Bootstrap 3 and Momentjs.
For usage, installation and demos see Project Site on GitHub
For CSS version install Bootstrap.v3.Datetimepicker.CSS</description>
<releaseNotes>
Check the change log on Github at https://github.com/Eonasdan/bootstrap-datetimepicker/wiki/Change-Log
IMPORANT! The Nuget packages will be depreciated in an upcoming release. Moving forward, Asp.Net/Nuget will NOT be delivering content packages like this one and you will need to use bower. See https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1128 for more
</releaseNotes>
<tags>bootstrap date time picker datetimepicker datepicker jquery</tags>
<dependencies>
<dependency id="bootstrap.Less" version="3.3.0" />
<dependency id="Moment.js" version="2.9.0" />
</dependencies>
</metadata>
<files>
<file src="..\..\src\js\bootstrap-datetimepicker.js" target="content\Scripts" />
<file src="..\..\build\js\bootstrap-datetimepicker.min.js" target="content\Scripts" />
<file src="..\..\src\less\_bootstrap-datetimepicker.less" target="content\Content\" />
<file src="..\..\src\less\bootstrap-datetimepicker-build.less" target="content\Content\" />
<file src="install.ps1" target="tools\" />
</files>
</package>

Binary file not shown.

View file

@ -0,0 +1,2 @@
# install.ps1
$DTE.ItemOperations.Navigate("https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1128", $DTE.vsNavigateOptions.vsNavigateOptionsNewWindow)

View file

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

View file

@ -0,0 +1,16 @@
// Import bootstrap variables including default color palette and fonts
//@import "../../node_modules/bootstrap/less/variables.less";
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
}
// Import datepicker component
@import "_bootstrap-datetimepicker";

View file

@ -0,0 +1,88 @@
module.exports = function (grunt) {
grunt.registerTask('bump_version', function (version) {
if (!version || version.split('.').length !== 3) {
grunt.fail.fatal('malformed version. Use\n\n grunt bump_version:1.2.3');
}
grunt.config('string-replace.bootstrap-datetimepicker-js', {
files: {'src/js/bootstrap-datetimepicker.js': 'src/js/bootstrap-datetimepicker.js'},
options: {
replacements: [
{
pattern: /\/*! version : .*/,
replacement: '! version : ' + version
}
]
}
});
grunt.config('string-replace.bootstrap-datetimepicker-css', {
files: { 'src/less/_bootstrap-datetimepicker.less': 'src/less/_bootstrap-datetimepicker.less' },
options: {
replacements: [
{
pattern: / * version : .*/,
replacement: ' version : ' + version
}
]
}
});
grunt.config('string-replace.package-json', {
files: {'package.json': 'package.json'},
options: {
replacements: [
{
pattern: /"version": .*/,
replacement: '"version": "' + version + '"'
}
]
}
});
grunt.config('string-replace.bower-json', {
files: {'bower.json': 'bower.json'},
options: {
replacements: [
{
pattern: /"version": .*/,
replacement: '"version": "' + version + '",'
}
]
}
});
grunt.config('string-replace.component-json', {
files: {'component.json': 'component.json'},
options: {
replacements: [
{
pattern: /"version": .*/,
replacement: '"version": "' + version + '",'
}
]
}
});
grunt.config('string-replace.composer-json', {
files: {'composer.json': 'composer.json'},
options: {
replacements: [
{
pattern: /"version": .*/,
replacement: '"version": "' + version + '",'
}
]
}
});
grunt.task.run([
'string-replace:bootstrap-datetimepicker-js',
'string-replace:bootstrap-datetimepicker-css',
'string-replace:package-json',
'string-replace:bower-json',
'string-replace:component-json',
'string-replace:composer-json'
]);
});
};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,65 @@
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../../node_modules/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../../../build/css/bootstrap-datetimepicker.css">
<script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../../../node_modules/bootstrap/dist/js/bootstrap.js"></script>
<script src="../../../node_modules/moment/moment.js"></script>
<script src="../../../src/js/bootstrap-datetimepicker.js"></script>
<style>
.parent{
position: relative;
padding: 40px;
}
.helper{
z-index: -1;
position: absolute;
background-color: #bfb;
top: 0px;
bottom: 0px;
right: 0px;
left: 0px;
opacity: 0.3;
}
.inner{
position: absolute;
background-color: #bbf;
top: 40px;
bottom: 40px;
right: 40px;
left: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1>{{v}} - {{h}}</h1>
<br><br><br><br><br><br><br><br><br><br>
<div class="parent">
<div class="helper">
<div class="inner"></div>
</div>
<br><br><br><br><br>
{{{t}}}
<br><br><br><br><br>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br>
</div>
</div>
</div>
<script type="text/javascript">
$('[data-datetimepicker]').datetimepicker({
widgetPositioning:{
vertical: '{{v}}',
horizontal: '{{h}}'
}
});
$('input[data-click-target]').focus();
$('span[data-click-target]').click();
</script>
</body>

View file

@ -0,0 +1,17 @@
var fs = require("fs");
var base = fs.readFileSync('base.html').toString();
['top','bottom'].forEach(function(v){
['left','right'].forEach(function(h){
['1','2','3','4','5'].forEach(function(t){
var text = fs.readFileSync('t' +t+'.html').toString();
var outFile = 'out/' + t +v.charAt(0) + h.charAt(0) + '.html';
var out = base
.replace(/\{\{\{t\}\}\}/g,text)
.replace(/\{\{v\}\}/g,v)
.replace(/\{\{h\}\}/g,h);
fs.writeFileSync(outFile, out);
});
});
});

View file

@ -0,0 +1,24 @@
var fs = require('fs');
['top','bottom'].forEach(function(v){
['left','right'].forEach(function(h){
['1','2','3','4','5'].forEach(function(t){
var inFile = 'out/'+ t +v.charAt(0) + h.charAt(0) + '.html';
var outFile = 'pic/'+ t + v.charAt(0) + h.charAt(0) + '.png';
var path = 'file://' + fs.absolute(inFile)
var page = require('webpage').create();
page.viewportSize = {
width: 1000,
height: 800
};;
page.open(path, function(status) {
window.setTimeout(function () {
console.log(status);
page.render(outFile);
setTimeout(function(){
phantom.exit();
}, 0);
},2000);
});
});
});
});

View file

@ -0,0 +1,11 @@
<div class="input-group">
<span class="input-group-addon">
start time
</span>
<input type="text" name="filter.startTime[]" class="form-control" placeholder="start time" id="start-time-input" value="" data-datetimepicker data-click-target>
<span class="input-group-addon">
end time
</span>
<input type="text" name="filter.endTime[]" class="form-control" placeholder="end time" id="end-time-input" value=""
data-datetimepicker>
</div>

View file

@ -0,0 +1,7 @@
<div class="input-group">
<span class="input-group-addon">
end time
</span>
<input type="text" name="filter.endTime[]" class="form-control" placeholder="end time" id="end-time-input" value=""
data-datetimepicker data-click-target>
</div>

View file

@ -0,0 +1,6 @@
<div class='input-group date' data-datetimepicker>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar" data-click-target></span>
</span>
</div>

View file

@ -0,0 +1,6 @@
<div class='input-group date' data-datetimepicker>
<span class="input-group-addon" data-click-target>
<span class="glyphicon glyphicon-calendar"></span>
</span>
<input type='text' class="form-control" />
</div>

View file

@ -0,0 +1 @@
<input type='text' class="form-control" data-datetimepicker data-click-target/>

View file

@ -0,0 +1,11 @@
(function () {
'use strict';
$.ajax('node_modules/moment-timezone/data/packed/latest.json', {
success: function (data) {
moment.tz.load(data);
},
method: 'GET',
dataType: 'json',
async: false
});
}());