webui: Update datetime lib (#8288)

This commit is contained in:
Søren Rosiak
2018-02-22 22:23:12 +01:00
committed by Neil Lathwood
parent e33e905b66
commit 6dcdd89dd7
28 changed files with 7 additions and 4477 deletions

View File

@@ -1 +0,0 @@
../js/datetime/build/css/bootstrap-datetimepicker.min.css

5
html/css/bootstrap-datetimepicker.min.css vendored Executable file
View File

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
datetime/build/js/bootstrap-datetimepicker.min.js

2
html/js/bootstrap-datetimepicker.min.js vendored Executable file
View File

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +0,0 @@
bower_components
node_modules

View File

@@ -1,62 +0,0 @@
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"requireMultipleVarDecl": "onevar",
"requireBlocksOnNewline": true,
"disallowPaddingNewlinesInBlocks": true,
"disallowEmptyBlocks": true,
"disallowSpacesInsideObjectBrackets": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"requireCommaBeforeLineBreak": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforeBinaryOperators": [
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
"&=", "|=", "^=",
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
"|", "^", "&&", "||", "===", "==", ">=",
"<=", "<", ">", "!=", "!=="
],
"requireSpaceAfterBinaryOperators": true,
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
"disallowKeywords": ["with"],
"disallowMultipleLineStrings": true,
"validateIndentation": 4,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"requireLineFeedAtFileEnd": true,
"requireCapitalizedConstructors": true
}

View File

@@ -1,12 +0,0 @@
/assets
/_includes
/_layouts
/.gitignore
/node_modules
/Makefile
/test
/build
*.log
*.swp
*~
*.tgz

View File

@@ -1,8 +0,0 @@
language: node_js
node_js:
- 0.10
before_script:
- npm install -g grunt-cli
script: grunt build:travis

View File

@@ -1,38 +0,0 @@
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

@@ -1,194 +0,0 @@
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
},
files: {
'build/css/bootstrap-datetimepicker.min.css': 'src/less/bootstrap-datetimepicker-build.less'
}
},
development: {
files: {
'build/css/bootstrap-datetimepicker.css': 'src/less/bootstrap-datetimepicker-build.less'
}
}
},
jasmine: {
customTemplate: {
src: 'src/js/*.js',
options: {
specs: 'test/*Spec.js',
helpers: 'test/*Helper.js',
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/bootstrap/dist/js/bootstrap.min.js'
],
display: 'none',
summary: 'true'
}
}
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-jasmine');
// These plugins provide necessary tasks.
require('load-grunt-tasks')(grunt);
// Default task.
grunt.registerTask('default', ['jshint', 'jscs', 'less', 'jasmine']);
// travis build task
grunt.registerTask('build:travis', [
// code style
'jshint', 'jscs',
// build
'uglify', 'less',
// tests
'jasmine'
]);
// Task to be run when building
grunt.registerTask('build', [
'jshint', 'jscs', 'uglify', 'less'
]);
grunt.registerTask('nuget', 'Create a nuget package', function () {
var target = grunt.option('target') || 'less', done = this.async();
if (target === 'less') {
grunt.util.spawn({
cmd: 'src/nuget/nuget.exe',
args: [
'pack',
'src/nuget/Bootstrap.v3.Datetimepicker.nuspec',
'-OutputDirectory',
'build/nuget',
'-Version',
grunt.config.get('pkg').version
]
}, function (error, result) {
if (error) {
grunt.log.error(error);
} else {
grunt.log.write(result);
}
done();
});
}
else { //--target=css
grunt.util.spawn({
cmd: 'src/nuget/nuget.exe',
args: [
'pack',
'src/nuget/Bootstrap.v3.Datetimepicker.CSS.nuspec',
'-OutputDirectory',
'build/nuget',
'-Version',
grunt.config.get('pkg').version
]
}, function (error, result) {
if (error) {
grunt.log.error(error);
} else {
grunt.log.write(result);
}
done();
});
}
});
grunt.registerTask('test', ['jshint', 'jscs', 'uglify', 'less', 'jasmine']);
};

View File

@@ -1,21 +0,0 @@
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

@@ -1,25 +0,0 @@
# 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/)
#v4
v4 is out now! For v4 related bugs and issues see: /Eonasdan/bootstrap-datetimepicker/labels/v4.
v3 is going into an archive state. Please be sure to check the documents. v4 has breaking changes and is a major rewrite.
## Submitting Issues
If you have issues, please check the following first:
* Have you read the docs?
* Do you have the latest version of momentjs?
* Do you have the latest version of jQuery?
* Please test and/or fork [this jsfiddle](http://jsfiddle.net/Eonasdan/0Ltv25o8/) with an example of your issue before you post an issue here.
## Where do you use this?
I'd love to know if your public site is using this plugin and list your logo on the documentation site. Please email me `eonasdan at outlook dot com`. Do not submit issue/feature request to this email, they will be **ignored**.
## [Installation instructions](http://eonasdan.github.io/bootstrap-datetimepicker/Installing/)
## [Change Log](http://eonasdan.github.io/bootstrap-datetimepicker/Version%204%20Changelog/)

View File

@@ -1,37 +0,0 @@
{
"name": "eonasdan-bootstrap-datetimepicker",
"version": "4.7.14",
"main": [
"build/css/bootstrap-datetimepicker.min.css",
"build/js/bootstrap-datetimepicker.min.js",
"src/less/_bootstrap-datetimepicker.less",
"src/less/bootstrap-datetimepicker-build.less",
"src/js/bootstrap-datetimepicker.js"
],
"dependencies": {
"jquery": ">=1.8.3",
"moment": ">=2.8.0"
},
"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

@@ -1,366 +0,0 @@
/*!
* Datetimepicker for Bootstrap 3
* ! version : 4.7.14
* https://github.com/Eonasdan/bootstrap-datetimepicker/
*/
.bootstrap-datetimepicker-widget {
list-style: none;
}
.bootstrap-datetimepicker-widget.dropdown-menu {
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 #cccccc;
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 #cccccc;
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: 0 0 7px 7px solid transparent;
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: #ffffff;
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: #ffffff;
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;
}
.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;
}

View File

@@ -1,366 +0,0 @@
/*!
* Datetimepicker for Bootstrap 3
* ! version : 4.7.14
* https://github.com/Eonasdan/bootstrap-datetimepicker/
*/
.bootstrap-datetimepicker-widget {
list-style: none;
}
.bootstrap-datetimepicker-widget.dropdown-menu {
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 #cccccc;
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 #cccccc;
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: 0 0 7px 7px solid transparent;
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: #ffffff;
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: #ffffff;
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;
}
.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;
}

View File

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -1,31 +0,0 @@
{
"name": "eonasdan/bootstrap-datetimepicker",
"type": "component",
"version": "4.7.14",
"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.8"
},
"extra": {
"component": {
"scripts": [
"src/js/bootstrap-datetimepicker.js"
],
"files": [
"build/js/bootstrap-datetimepicker.min.js",
"build/css/bootstrap-datetimepicker.css",
"build/css/bootstrap-datetimepicker.min.css",
"src/less/_bootstrap-datetimepicker.less",
"src/less/bootstrap-datetimepicker-build.less"
]
}
}
}

View File

@@ -1,35 +0,0 @@
{
"name": "bootstrap-datetimepicker",
"main": "src/js/bootstrap-datetimepicker.js",
"version": "4.7.14",
"repository": {
"type": "git",
"url": "https://github.com/eonasdan/bootstrap-datetimepicker.git"
},
"bugs": {
"url": "https://github.com/eonasdan/bootstrap-datetimepicker/issues"
},
"keywords": [
"twitter-bootstrap",
"bootstrap",
"datepicker",
"datetimepicker",
"timepicker",
"moment"
],
"dependencies": {
"moment": "~2.8.2",
"bootstrap": "^3.0",
"jquery": "latest"
},
"devDependencies": {
"grunt": "latest",
"grunt-contrib-jasmine": "^0.7.0",
"grunt-contrib-jshint": "latest",
"grunt-contrib-less": "latest",
"grunt-contrib-uglify": "latest",
"grunt-jscs": "latest",
"grunt-string-replace": "latest",
"load-grunt-tasks": "latest"
}
}

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,343 +0,0 @@
/*!
* Datetimepicker for Bootstrap 3
* ! version : 4.7.14
* 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 {
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: 0 0 7px 7px solid transparent;
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

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

View File

@@ -1,30 +0,0 @@
<?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</releaseNotes>
<tags>bootstrap date time picker datetimepicker datepicker jquery</tags>
<dependencies>
<dependency id="Twitter.Bootstrap.Less" version="3.0.0" />
<dependency id="Moment.js" version="2.8.4" />
</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

@@ -1,30 +0,0 @@
<?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</releaseNotes>
<tags>bootstrap date time picker datetimepicker datepicker jquery</tags>
<dependencies>
<dependency id="Twitter.Bootstrap.Less" version="3.0.0" />
<dependency id="Moment.js" version="2.8.4" />
</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\less" />
<file src="..\..\src\less\bootstrap-datetimepicker-build.less" target="content\Content\less" />
<file src="install.ps1" target="tools\" />
</files>
</package>

View File

Binary file not shown.

View File

@@ -1,2 +0,0 @@
# install.ps1
$DTE.ItemOperations.Navigate("http://eonasdan.github.io/bootstrap-datetimepicker/", $DTE.vsNavigateOptions.vsNavigateOptionsNewWindow)

View File

@@ -1,88 +0,0 @@
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'
]);
});
};

View File

@@ -1,700 +0,0 @@
describe('Plugin initialization and component basic construction', function () {
'use strict';
it('loads jquery plugin properly', function () {
expect($('<div>').datetimepicker).toBeDefined();
expect(typeof $('<div>').datetimepicker).toEqual('function');
expect($('<div>').datetimepicker.defaults).toBeDefined();
});
it('creates the component with default options on an input element', function () {
var dtp = $('<input>');
$(document).find('body').append(dtp);
expect(function () {
dtp = dtp.datetimepicker();
}).not.toThrow();
expect(dtp).not.toBe(null);
});
xit('calls destroy when Element that the component is attached is removed', function () {
var dtpElement = $('<div>').attr('class', 'row').append($('<div>').attr('class', 'col-md-12').append($('<input>'))),
dtp;
$(document).find('body').append(dtpElement);
dtpElement.datetimepicker();
dtp = dtpElement.data('DateTimePicker');
spyOn(dtp, 'destroy').and.callThrough();
dtpElement.remove();
expect(dtp.destroy).toHaveBeenCalled();
});
});
describe('Public API method tests', function () {
'use strict';
var dtp,
dtpElement,
dpChangeSpy,
dpShowSpy,
dpHideSpy,
dpErrorSpy;
beforeEach(function () {
dpChangeSpy = jasmine.createSpy('dp.change event Spy');
dpShowSpy = jasmine.createSpy('dp.show event Spy');
dpHideSpy = jasmine.createSpy('dp.hide event Spy');
dpErrorSpy = jasmine.createSpy('dp.error event Spy');
dtpElement = $('<input>').attr('id', 'dtp');
$(document).find('body').append($('<div>').attr('class', 'row').append($('<div>').attr('class', 'col-md-12').append(dtpElement)));
$(document).find('body').on('dp.change', dpChangeSpy);
$(document).find('body').on('dp.show', dpShowSpy);
$(document).find('body').on('dp.hide', dpHideSpy);
$(document).find('body').on('dp.error', dpErrorSpy);
dtpElement.datetimepicker();
dtp = dtpElement.data('DateTimePicker');
});
afterEach(function () {
dtp.destroy();
dtpElement.remove();
});
describe('configuration option name match to public api function', function () {
Object.getOwnPropertyNames($.fn.datetimepicker.defaults).forEach(function (key) {
it('has function ' + key + '()', function () {
expect(dtp[key]).toBeDefined();
});
});
});
describe('date() function', function () {
describe('typechecking', function () {
it('accepts a null', function () {
expect(function () {
dtp.date(null);
}).not.toThrow();
});
it('accepts a string', function () {
expect(function () {
dtp.date('2013/05/24');
}).not.toThrow();
});
it('accepts a Date object', function () {
expect(function () {
dtp.date(new Date());
}).not.toThrow();
});
it('accepts a Moment object', function () {
expect(function () {
dtp.date(moment());
}).not.toThrow();
});
it('does not accept undefined', function () {
expect(function () {
dtp.date(undefined);
}).toThrow();
});
it('does not accept a number', function () {
expect(function () {
dtp.date(0);
}).toThrow();
});
it('does not accept a generic Object', function () {
expect(function () {
dtp.date({});
}).toThrow();
});
it('does not accept a boolean', function () {
expect(function () {
dtp.date(false);
}).toThrow();
});
});
describe('functionality', function () {
it('has no date set upon construction', function () {
expect(dtp.date()).toBe(null);
});
it('sets the date correctly', function () {
var timestamp = moment();
dtp.date(timestamp);
expect(dtp.date().isSame(timestamp)).toBe(true);
});
});
});
describe('format() function', function () {
describe('typechecking', function () {
it('accepts a false value', function () {
expect(function () {
dtp.format(false);
}).not.toThrow();
});
it('accepts a string', function () {
expect(function () {
dtp.format('YYYY-MM-DD');
}).not.toThrow();
});
it('does not accept undefined', function () {
expect(function () {
dtp.format(undefined);
}).toThrow();
});
it('does not accept true', function () {
expect(function () {
dtp.format(true);
}).toThrow();
});
it('does not accept a generic Object', function () {
expect(function () {
dtp.format({});
}).toThrow();
});
});
describe('functionality', function () {
it('returns no format before format is set', function () {
expect(dtp.format()).toBe(false);
});
it('sets the format correctly', function () {
dtp.format('YYYY-MM-DD');
expect(dtp.format()).toBe('YYYY-MM-DD');
});
});
});
describe('destroy() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.destroy).toBeDefined();
});
});
});
describe('toggle() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.toggle).toBeDefined();
});
});
// describe('functionality', function () {
// it('')
// });
});
describe('show() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.show).toBeDefined();
});
});
describe('functionality', function () {
it('emits a show event when called while widget is hidden', function () {
dtp.show();
expect(dpShowSpy).toHaveBeenCalled();
});
it('does not emit a show event when called and widget is already showing', function () {
dtp.hide();
dtp.show();
dpShowSpy.calls.reset();
dtp.show();
expect(dpShowSpy).not.toHaveBeenCalled();
});
it('actually shows the widget', function () {
dtp.show();
expect($(document).find('body').find('.bootstrap-datetimepicker-widget').length).toEqual(1);
});
});
});
describe('hide() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.hide).toBeDefined();
});
});
describe('functionality', function () {
it('emits a hide event when called while widget is shown', function () {
dtp.show();
dtp.hide();
expect(dpHideSpy).toHaveBeenCalled();
});
it('does not emit a hide event when called while widget is hidden', function () {
dtp.hide();
expect(dpHideSpy).not.toHaveBeenCalled();
});
it('actually hides the widget', function () {
dtp.show();
dtp.hide();
expect($(document).find('body').find('.bootstrap-datetimepicker-widget').length).toEqual(0);
});
});
});
describe('disable() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.disable).toBeDefined();
});
});
});
describe('enable() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.enable).toBeDefined();
});
});
});
describe('options() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.options).toBeDefined();
});
});
});
describe('disabledDates() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.disabledDates).toBeDefined();
});
});
});
describe('enabledDates() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.enabledDates).toBeDefined();
});
});
});
describe('daysOfWeekDisabled() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.daysOfWeekDisabled).toBeDefined();
});
});
});
describe('maxDate() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.maxDate).toBeDefined();
});
});
});
describe('minDate() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.minDate).toBeDefined();
});
});
});
describe('defaultDate() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.defaultDate).toBeDefined();
});
});
describe('functionality', function () {
it('returns no defaultDate before defaultDate is set', function () {
expect(dtp.defaultDate()).toBe(false);
});
it('sets the defaultDate correctly', function () {
var timestamp = moment();
dtp.defaultDate(timestamp);
expect(dtp.defaultDate().isSame(timestamp)).toBe(true);
expect(dtp.date().isSame(timestamp)).toBe(true);
});
it('triggers a change event upon setting a default date and input field is empty', function () {
dtp.date(null);
dtp.defaultDate(moment());
expect(dpChangeSpy).toHaveBeenCalled();
});
it('does not override input value if it already has one', function () {
var timestamp = moment();
dtp.date(timestamp);
dtp.defaultDate(moment().year(2000));
expect(dtp.date().isSame(timestamp)).toBe(true);
});
});
});
describe('locale() function', function () {
describe('functionality', function () {
it('it has the same locale as the global moment locale with default options', function () {
expect(dtp.locale()).toBe(moment.locale());
});
it('it switches to a selected locale without affecting global moment locale', function () {
dtp.locale('el');
dtp.date(moment());
expect(dtp.locale()).toBe('el');
expect(dtp.date().locale()).toBe('el');
expect(moment.locale()).toBe('en');
});
});
});
describe('useCurrent() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.useCurrent).toBeDefined();
});
});
describe('check type and parameter validity', function () {
it('accepts either a boolean value or string', function () {
var useCurrentOptions = ['year', 'month', 'day', 'hour', 'minute'];
expect(function () {
dtp.useCurrent(false);
}).not.toThrow();
expect(function () {
dtp.useCurrent(true);
}).not.toThrow();
useCurrentOptions.forEach(function (value) {
expect(function () {
dtp.useCurrent(value);
}).not.toThrow();
});
expect(function () {
dtp.useCurrent('test');
}).toThrow();
expect(function () {
dtp.useCurrent({});
}).toThrow();
});
});
describe('functionality', function () {
it('triggers a change event upon show() and input field is empty', function () {
dtp.useCurrent(true);
dtp.show();
expect(dpChangeSpy).toHaveBeenCalled();
});
});
});
describe('ignoreReadonly() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.ignoreReadonly).toBeDefined();
});
});
});
describe('stepping() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.stepping).toBeDefined();
});
});
});
describe('collapse() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.collapse).toBeDefined();
});
});
});
describe('icons() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.icons).toBeDefined();
});
});
});
describe('useStrict() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.useStrict).toBeDefined();
});
});
});
describe('sideBySide() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.sideBySide).toBeDefined();
});
});
});
describe('viewMode() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.viewMode).toBeDefined();
});
});
});
describe('widgetPositioning() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.widgetPositioning).toBeDefined();
});
});
});
describe('calendarWeeks() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.calendarWeeks).toBeDefined();
});
});
});
describe('showTodayButton() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.showTodayButton).toBeDefined();
});
});
});
describe('showClear() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.showClear).toBeDefined();
});
});
});
describe('dayViewHeaderFormat() function', function () {
describe('typechecking', function () {
it('does not accept a false value', function () {
expect(function () {
dtp.dayViewHeaderFormat(false);
}).toThrow();
});
it('accepts a string', function () {
expect(function () {
dtp.dayViewHeaderFormat('YYYY-MM-DD');
}).not.toThrow();
});
it('does not accept undefined', function () {
expect(function () {
dtp.dayViewHeaderFormat(undefined);
}).toThrow();
});
it('does not accept true', function () {
expect(function () {
dtp.dayViewHeaderFormat(true);
}).toThrow();
});
it('does not accept a generic Object', function () {
expect(function () {
dtp.dayViewHeaderFormat({});
}).toThrow();
});
});
describe('functionality', function () {
it('expects dayViewHeaderFormat to be default of MMMM YYYY', function () {
expect(dtp.dayViewHeaderFormat()).toBe('MMMM YYYY');
});
it('sets the dayViewHeaderFormat correctly', function () {
dtp.dayViewHeaderFormat('MM YY');
expect(dtp.dayViewHeaderFormat()).toBe('MM YY');
});
});
});
describe('extraFormats() function', function () {
describe('typechecking', function () {
it('accepts a false value', function () {
expect(function () {
dtp.extraFormats(false);
}).not.toThrow();
});
it('does not accept a string', function () {
expect(function () {
dtp.extraFormats('YYYY-MM-DD');
}).toThrow();
});
it('does not accept undefined', function () {
expect(function () {
dtp.extraFormats(undefined);
}).toThrow();
});
it('does not accept true', function () {
expect(function () {
dtp.extraFormats(true);
}).toThrow();
});
it('accepts an Array', function () {
expect(function () {
dtp.extraFormats(['YYYY-MM-DD']);
}).not.toThrow();
});
});
describe('functionality', function () {
it('returns no extraFormats before extraFormats is set', function () {
expect(dtp.extraFormats()).toBe(false);
});
it('sets the extraFormats correctly', function () {
dtp.extraFormats(['YYYY-MM-DD']);
expect(dtp.extraFormats()[0]).toBe('YYYY-MM-DD');
});
});
});
describe('toolbarPlacement() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.toolbarPlacement).toBeDefined();
});
});
describe('check type and parameter validity', function () {
it('does not accept a false value', function () {
expect(function () {
dtp.dayViewHeaderFormat(false);
}).toThrow();
});
it('does not accept a false value', function () {
expect(function () {
dtp.dayViewHeaderFormat(false);
}).toThrow();
});
it('accepts a string', function () {
var toolbarPlacementOptions = ['default', 'top', 'bottom'];
toolbarPlacementOptions.forEach(function (value) {
expect(function () {
dtp.toolbarPlacement(value);
}).not.toThrow();
});
expect(function () {
dtp.toolbarPlacement('test');
}).toThrow();
expect(function () {
dtp.toolbarPlacement({});
}).toThrow();
});
});
});
describe('widgetParent() function', function () {
describe('typechecking', function () {
it('accepts a null', function () {
expect(function () {
dtp.widgetParent(null);
}).not.toThrow();
});
it('accepts a string', function () {
expect(function () {
dtp.widgetParent('testDiv');
}).not.toThrow();
});
it('accepts a jquery object', function () {
expect(function () {
dtp.widgetParent($('#testDiv'));
}).not.toThrow();
});
it('does not accept undefined', function () {
expect(function () {
dtp.widgetParent(undefined);
}).toThrow();
});
it('does not accept a number', function () {
expect(function () {
dtp.widgetParent(0);
}).toThrow();
});
it('does not accept a generic Object', function () {
expect(function () {
dtp.widgetParent({});
}).toThrow();
});
it('does not accept a boolean', function () {
expect(function () {
dtp.widgetParent(false);
}).toThrow();
});
});
});
describe('keepOpen() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.keepOpen).toBeDefined();
});
});
});
describe('inline() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.inline).toBeDefined();
});
});
});
describe('clear() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.clear).toBeDefined();
});
});
});
describe('keyBinds() function', function () {
describe('existence', function () {
it('is defined', function () {
expect(dtp.keyBinds).toBeDefined();
});
});
});
});