Эх сурвалжийг харах

Add survey meeting new files see BT#14957

Julio Montoya 6 жил өмнө
parent
commit
9bac59dcef
64 өөрчлөгдсөн 13980 нэмэгдсэн , 0 устгасан
  1. 46 0
      app/Resources/public/assets/datepair.js/.bower.json
  2. 55 0
      app/Resources/public/assets/datepair.js/GruntFile.js
  3. 165 0
      app/Resources/public/assets/datepair.js/README.md
  4. 23 0
      app/Resources/public/assets/datepair.js/bower.json
  5. 27 0
      app/Resources/public/assets/datepair.js/datepair.jquery.json
  6. 360 0
      app/Resources/public/assets/datepair.js/dist/datepair.js
  7. 6 0
      app/Resources/public/assets/datepair.js/dist/datepair.min.js
  8. 51 0
      app/Resources/public/assets/datepair.js/dist/jquery.datepair.js
  9. 6 0
      app/Resources/public/assets/datepair.js/dist/jquery.datepair.min.js
  10. 503 0
      app/Resources/public/assets/datepair.js/index.html
  11. 83 0
      app/Resources/public/assets/datepair.js/lib/jquery.ptTimeSelect.css
  12. 478 0
      app/Resources/public/assets/datepair.js/lib/jquery.ptTimeSelect.js
  13. 5 0
      app/Resources/public/assets/datepair.js/lib/moment.min.js
  14. 173 0
      app/Resources/public/assets/datepair.js/lib/pikaday.css
  15. 973 0
      app/Resources/public/assets/datepair.js/lib/pikaday.js
  16. 200 0
      app/Resources/public/assets/datepair.js/lib/site.css
  17. 10 0
      app/Resources/public/assets/datepair.js/lib/site.js
  18. 24 0
      app/Resources/public/assets/datepair.js/package.json
  19. 45 0
      app/Resources/public/assets/datepair/.bower.json
  20. 55 0
      app/Resources/public/assets/datepair/GruntFile.js
  21. 165 0
      app/Resources/public/assets/datepair/README.md
  22. 23 0
      app/Resources/public/assets/datepair/bower.json
  23. 27 0
      app/Resources/public/assets/datepair/datepair.jquery.json
  24. 360 0
      app/Resources/public/assets/datepair/dist/datepair.js
  25. 6 0
      app/Resources/public/assets/datepair/dist/datepair.min.js
  26. 51 0
      app/Resources/public/assets/datepair/dist/jquery.datepair.js
  27. 6 0
      app/Resources/public/assets/datepair/dist/jquery.datepair.min.js
  28. 503 0
      app/Resources/public/assets/datepair/index.html
  29. 83 0
      app/Resources/public/assets/datepair/lib/jquery.ptTimeSelect.css
  30. 478 0
      app/Resources/public/assets/datepair/lib/jquery.ptTimeSelect.js
  31. 5 0
      app/Resources/public/assets/datepair/lib/moment.min.js
  32. 173 0
      app/Resources/public/assets/datepair/lib/pikaday.css
  33. 973 0
      app/Resources/public/assets/datepair/lib/pikaday.js
  34. 200 0
      app/Resources/public/assets/datepair/lib/site.css
  35. 10 0
      app/Resources/public/assets/datepair/lib/site.js
  36. 24 0
      app/Resources/public/assets/datepair/package.json
  37. 32 0
      app/Resources/public/assets/jt.timepicker/.bower.json
  38. 3 0
      app/Resources/public/assets/jt.timepicker/.eslintrc.json
  39. 6 0
      app/Resources/public/assets/jt.timepicker/.gitignore
  40. 41 0
      app/Resources/public/assets/jt.timepicker/GruntFile.js
  41. 294 0
      app/Resources/public/assets/jt.timepicker/README.md
  42. 16 0
      app/Resources/public/assets/jt.timepicker/bower.json
  43. 23 0
      app/Resources/public/assets/jt.timepicker/composer.json
  44. 369 0
      app/Resources/public/assets/jt.timepicker/index.html
  45. 72 0
      app/Resources/public/assets/jt.timepicker/jquery.timepicker.css
  46. 152 0
      app/Resources/public/assets/jt.timepicker/jquery.timepicker.d.ts
  47. 1386 0
      app/Resources/public/assets/jt.timepicker/jquery.timepicker.js
  48. 1 0
      app/Resources/public/assets/jt.timepicker/jquery.timepicker.min.css
  49. 6 0
      app/Resources/public/assets/jt.timepicker/jquery.timepicker.min.js
  50. 27 0
      app/Resources/public/assets/jt.timepicker/jt.timepicker.jquery.json
  51. 512 0
      app/Resources/public/assets/jt.timepicker/lib/bootstrap-datepicker.css
  52. 1671 0
      app/Resources/public/assets/jt.timepicker/lib/bootstrap-datepicker.js
  53. BIN
      app/Resources/public/assets/jt.timepicker/lib/glyphicons-halflings.png
  54. BIN
      app/Resources/public/assets/jt.timepicker/lib/screenshot.png
  55. 195 0
      app/Resources/public/assets/jt.timepicker/lib/site.css
  56. 10 0
      app/Resources/public/assets/jt.timepicker/lib/site.js
  57. 45 0
      app/Resources/public/assets/jt.timepicker/package.json
  58. 27 0
      app/Resources/public/assets/requirejs/.bower.json
  59. 4 0
      app/Resources/public/assets/requirejs/README.md
  60. 18 0
      app/Resources/public/assets/requirejs/bower.json
  61. 2129 0
      app/Resources/public/assets/requirejs/require.js
  62. 119 0
      main/inc/lib/formvalidator/Element/DateTimeRangePicker.php
  63. 183 0
      main/survey/create_meeting.php
  64. 264 0
      main/survey/meeting.php

+ 46 - 0
app/Resources/public/assets/datepair.js/.bower.json

@@ -0,0 +1,46 @@
+{
+  "name": "datepair.js",
+  "version": "0.4.16",
+  "main": [
+    "dist/datepair.js",
+    "dist/jquery.datepair.js"
+  ],
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "components",
+    "spec",
+    "Gruntfile.js",
+    "src",
+    "bower_components",
+    "test",
+    "tests"
+  ],
+  "homepage": "http://jonthornton.github.com/Datepair.js",
+  "authors": [
+    "Jon Thornton"
+  ],
+  "description": "A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.",
+  "keywords": [
+    "timepicker",
+    "datepicker",
+    "time",
+    "date",
+    "picker",
+    "ui",
+    "calendar",
+    "input",
+    "form"
+  ],
+  "license": "MIT",
+  "_release": "0.4.16",
+  "_resolution": {
+    "type": "version",
+    "tag": "0.4.16",
+    "commit": "d54ca5c1e9e5fce523b2976e0454d3cd556560ff"
+  },
+  "_source": "https://github.com/jonthornton/Datepair.js.git",
+  "_target": "^0.4.16",
+  "_originalSource": "datepair",
+  "_direct": true
+}

+ 55 - 0
app/Resources/public/assets/datepair.js/GruntFile.js

@@ -0,0 +1,55 @@
+module.exports = function(grunt) {
+    grunt.initConfig({
+        pkg: grunt.file.readJSON('package.json'),
+        meta: {
+            banner: '/*!\n' +
+            ' * <%= pkg.name %> v<%= pkg.version %> - <%= pkg.description %>\n' +
+            ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> - <%= pkg.homepage %>\n' +
+            ' * License: <%= pkg.license %>\n' +
+            ' */\n\n'
+        },
+
+        rig: {
+            options: {
+                banner: '<%= meta.banner %>'
+            },
+            dist: {
+                files: {
+                    'dist/datepair.js': ['src/wrapper.js'],
+                    'dist/jquery.datepair.js' : ['src/jquery.datepair.js'],
+                }
+            }
+        },
+
+        uglify: {
+            options: {
+                banner: '<%= meta.banner %>',
+                report: 'min'
+            },
+            dist: {
+                files: {
+                    'dist/datepair.min.js': 'dist/datepair.js',
+                    'dist/jquery.datepair.min.js': ['dist/datepair.js', 'dist/jquery.datepair.js'],
+                }
+            }
+        },
+        jshint: {
+            all: ['src/*.js']
+        },
+
+        watch: {
+            options : {
+                atBegin : true
+            },
+            files: ['src/*.js'],
+            tasks: ['rig']
+        }
+    });
+
+    grunt.loadNpmTasks('grunt-contrib-uglify');
+    grunt.loadNpmTasks('grunt-rigger');
+    grunt.loadNpmTasks('grunt-contrib-watch');
+    grunt.loadNpmTasks('grunt-contrib-jshint');
+
+    grunt.registerTask('default', ['rig', 'uglify']);
+};

+ 165 - 0
app/Resources/public/assets/datepair.js/README.md

@@ -0,0 +1,165 @@
+# Datepair.js
+
+[See a demo and examples here](http://jonthornton.github.com/Datepair.js)
+
+Datepair.js is a lightweight, modular javascript plugin for intelligently selecting date and time ranges, inspired by Google Calendar. It will keep the start and end date/times in sync and can set default values based on user action. There are no external dependencies, however it can easily be used with jQuery or Zepto. The plugin does not provide any UI widgets; it's preconfigured to work with [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker) and [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker), but you can use it with any datepicker or timepicker (or none at all).
+
+*Looking for [jquery-datepair](#jquery-plugin)? Scroll down.*
+
+## Requirements
+
+* [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker) (>= 1.3) (this dependency can be overridden)
+* [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker) (>= 1.3) (this dependency can be overridden)
+
+## Usage
+
+Include `dist/datepair.js` or `dist/jquery.datepair.min.js` in your app.
+
+```javascript
+var container = document.getElementById('container')
+var datepair = new Datepair(container, options);
+```
+
+Where `#container` contains time/date `<input />` elements with the appropriate class names. `options` is an optional javascript object with parameters explained below.
+
+Note that Datepair is triggered by `change` events and won't work unless the container has some `<input />` elements.
+
+## Options
+
+- **anchor**  
+The input that will control the other input. One of `"start"`, `"end"`, or `null`. See [demo page](http://jonthornton.github.io/Datepair.js/) for more information.
+*default: "start"*
+
+- **dateClass**  
+Class name of the date inputs, if any.  
+*default: "date"*
+
+- **defaultDateDelta**  
+Fill in the second date value with the specified range when the users selects the first date. Value is in days. Set this to ```null``` to disable automatically setting the second date.  
+*default: 0*
+
+- **defaultTimeDelta**  
+Fill in the second time value with the specified range when the users selects the first time. Value is in milliseconds; set this to ```7200000``` for a 2 hour range, for example. Set this to ```null``` to disable automatically setting the second time.  
+*default: 0*
+
+- **endClass**  
+Class name of the range end input(s).  
+*default: "end"*
+
+- **parseDate**  
+A function that takes a jQuery element for a date input and returns a local time ```Date``` object representing the date input value.  
+*default: function for [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker)*
+
+- **parseTime**  
+A function that takes a jQuery element for a time input and returns a local time ```Date``` object representing the time input value. See [example page](http://jonthornton.github.com/Datepair.js) for more info.  
+*default: function for [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker)*
+
+- **setMinTime**  
+A function that takes a jQuery element for a time input and a local time ```Date``` object representing the time, and sets the timepicker minTime value.  
+*default: function for [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker)*
+
+- **startClass**  
+Class name of the range start input(s).  
+*default: "start"*
+
+- **timeClass**  
+Class name of the time inputs, if any.  
+*default: "time"*
+
+- **updateDate**  
+A function that takes a jQuery element for a date input and a local time ```Date``` object representing the date, and sets the input value.  
+*default: function for [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker)*
+
+- **updateTime**  
+A function that takes a jQuery element for a time input and a local time ```Date``` object representing the time, and sets the input value.  
+*default: function for [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker)*
+
+
+## Methods
+
+- **getTimeDiff**  
+Get the date/time range size, in milliseconds.
+
+	```javascript
+	var milliseconds = datepair.getTimeDiff();
+	```
+
+- **refresh**  
+Call this method if you programmatically update the date/time fields after first initialization of datepair.  
+
+	```javascript
+	$('#someInput').val(someValue)
+	datepair.refresh();
+	```
+
+- **remove**  
+Unbind the datepair functionality from a set of inputs.  
+
+	```javascript
+	datepair.remove();
+	``` 
+
+## Events
+
+- **rangeError**  
+Fired after the user interacts with the datepair inputs but selects an invalid range, where the end time/date is before the start.
+
+- **rangeIncomplete**  
+Fired after the user interacts with the datepair inputs but one or more empty inputs remain. Unpaired inputs (such as a start date with no corresponding end date) will not be taken into account.
+
+- **rangeSelected**  
+Fired after the user interacts with the datepair inputs and all paired inputs have valid values.
+
+## jQuery Plugin
+
+Datepair.js includes an optional jQuery interface that can simplify usage when working with jQuery or Zepto. To activate, include both `datepair.js` and `jquery.datepair.js`, or just `jquery.datepair.min.js`. (The minified version includes both scripts.)
+
+### Usage
+
+```javascript
+$('#container').datepair(options);
+var milliseconds = $('#container').datepair('getTimeDiff');
+$('#container').datepair('remove');
+$('#container').datepair('refresh');
+```
+
+## jQuery-UI Datepicker
+
+By default, Datepair.js is configured to work with [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker). This is different from [jQuery UI Datepicker](http://jqueryui.com/datepicker/). To use jQuery UI Datepicker, override the `parseDate` and `updateDate` methods:
+
+```javascript
+$('#some-container').datepair({
+    parseDate: function (el) {
+        var val = $(el).datepicker('getDate');
+        if (!val) {
+            return null;
+        }
+        var utc = new Date(val);
+        return utc && new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));
+    },
+    updateDate: function (el, v) {
+        $(el).datepicker('setDate', new Date(v.getTime() - (v.getTimezoneOffset() * 60000)));
+    }
+});
+```
+
+## Packaging
+
+https://www.npmjs.com/package/datepair.js  
+`npm install --save datepair.js`
+
+## Help
+
+Submit a [GitHub Issues request](https://github.com/jonthornton/Datepair.js/issues/new).
+
+## Development Guidelines
+
+* Install dependencies (grunt) `npm install`
+* To build and minify, run `grunt`
+* Use `grunt watch` to continuously build while developing
+
+Datepair.js follows [semantic versioning](http://semver.org/).
+
+- - -
+
+This software is made available under the open source MIT License. &copy; 2014 [Jon Thornton](http://www.jonthornton.com).

+ 23 - 0
app/Resources/public/assets/datepair.js/bower.json

@@ -0,0 +1,23 @@
+{
+  "name": "datepair.js",
+  "version": "0.4.16",
+  "main": ["dist/datepair.js", "dist/jquery.datepair.js"],
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "components",
+    "spec",
+    "Gruntfile.js",
+    "src",
+    "bower_components",
+    "test",
+    "tests"
+  ],
+  "homepage": "http://jonthornton.github.com/Datepair.js",
+  "authors": [
+    "Jon Thornton"
+  ],
+  "description": "A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.",
+  "keywords": [ "timepicker", "datepicker", "time", "date", "picker", "ui", "calendar", "input", "form" ],
+  "license": "MIT"
+}

+ 27 - 0
app/Resources/public/assets/datepair.js/datepair.jquery.json

@@ -0,0 +1,27 @@
+{
+	"name": "datepair",
+	"version": "0.4.10",
+	"title": "Datepair.js",
+	"description": "A plugin for intelligently selecting date and time ranges inspired by Google Calendar.",
+	"author": {
+		"name": "Jon Thornton",
+		"email": "thornton.jon@gmail.com",
+		"url": "https://github.com/jonthornton"
+	},
+	"licenses": [
+		{
+			"type": "MIT",
+			"url": "http://opensource.org/licenses/MIT"
+		}
+	],
+	"dependencies": {
+		"jquery": ">=1.7"
+	},
+	"keywords": [ "timepicker", "datepicker", "time", "date", "picker", "ui", "calendar", "input", "form" ],
+	"homepage": "http://jonthornton.github.com/jquery-datepair/",
+	"bugs": {
+		"url": "https://github.com/jonthornton/jquery-datepair/issues"
+	},
+	"docs": "https://github.com/jonthornton/jquery-datepair",
+	"download": "https://github.com/jonthornton/jquery-datepair"
+}

+ 360 - 0
app/Resources/public/assets/datepair.js/dist/datepair.js

@@ -0,0 +1,360 @@
+/*!
+ * datepair.js v0.4.16 - A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.
+ * Copyright (c) 2018 Jon Thornton - http://jonthornton.github.com/Datepair.js
+ * License: MIT
+ */
+
+(function(window, document) {
+
+	'use strict';
+
+	var _ONE_DAY = 86400000;
+	var jq = window.Zepto || window.jQuery;
+
+	function simpleExtend(obj1, obj2) {
+		var out = obj2 || {};
+
+		for (var i in obj1) {
+			if (!(i in out)) {
+				out[i] = obj1[i];
+			}
+		}
+
+		return out;
+	}
+
+	// IE's custom event support is totally borked.
+	// Use jQuery if possible
+	function triggerSimpleCustomEvent(el, eventName) {
+		if (jq) {
+			jq(el).trigger(eventName);
+		} else {
+			var event = document.createEvent('CustomEvent');
+			event.initCustomEvent(eventName, true, true, {});
+			el.dispatchEvent(event);
+		}
+	}
+
+	// el.classList not supported by < IE10
+	// use jQuery if available
+	function hasClass(el, className) {
+		if (jq) {
+			return jq(el).hasClass(className);
+		} else {
+			return el.classList.contains(className);
+		}
+	}
+
+	function Datepair(container, options) {
+		this.dateDelta = null;
+		this.timeDelta = null;
+		this._defaults =	{
+			startClass: 'start',
+			endClass: 'end',
+			timeClass: 'time',
+			dateClass: 'date',
+			defaultDateDelta: 0,
+			defaultTimeDelta: 3600000,
+			anchor: 'start',
+
+			// defaults for jquery-timepicker; override when using other input widgets
+			parseTime: function(input){
+				return jq(input).timepicker('getTime');
+			},
+			updateTime: function(input, dateObj){
+				jq(input).timepicker('setTime', dateObj);
+			},
+			setMinTime: function(input, dateObj){
+				jq(input).timepicker('option', 'minTime', dateObj);
+			},
+
+			// defaults for bootstrap datepicker; override when using other input widgets
+			parseDate: function(input){
+				return input.value && jq(input).datepicker('getDate');
+			},
+			updateDate: function(input, dateObj){
+				jq(input).datepicker('update', dateObj);
+			}
+		};
+
+		this.container = container;
+		this.settings = simpleExtend(this._defaults, options);
+
+		this.startDateInput = this.container.querySelector('.'+this.settings.startClass+'.'+this.settings.dateClass);
+		this.endDateInput = this.container.querySelector('.'+this.settings.endClass+'.'+this.settings.dateClass);
+		this.startTimeInput = this.container.querySelector('.'+this.settings.startClass+'.'+this.settings.timeClass);
+		this.endTimeInput = this.container.querySelector('.'+this.settings.endClass+'.'+this.settings.timeClass);
+
+		// initialize date and time deltas
+		this.refresh();
+
+		// init starts here
+		this._bindChangeHandler();
+	}
+
+	Datepair.prototype = {
+		constructor: Datepair,
+
+		option: function(key, value)
+		{
+			if (typeof key == 'object') {
+				this.settings = simpleExtend(this.settings, key);
+
+			} else if (typeof key == 'string' && typeof value != 'undefined') {
+				this.settings[key] = value;
+
+			} else if (typeof key == 'string') {
+				return this.settings[key];
+			}
+
+			this._updateEndMintime();
+		},
+
+		getTimeDiff: function()
+		{
+			// due to the fact that times can wrap around, timeDiff for any
+			// time-only pair will always be >= 0
+			var delta = this.dateDelta + this.timeDelta;
+			if (delta < 0 && (!this.startDateInput || !this.endDateInput) ) {
+				delta += _ONE_DAY;
+			}
+
+			return delta;
+		},
+
+		refresh: function()
+		{
+			if (this.startDateInput && this.startDateInput.value && this.endDateInput && this.endDateInput.value) {
+				var startDate = this.settings.parseDate(this.startDateInput);
+				var endDate = this.settings.parseDate(this.endDateInput);
+				if (startDate && endDate) {
+					this.dateDelta = endDate.getTime() - startDate.getTime();
+				}
+			}
+			if (this.startTimeInput && this.startTimeInput.value && this.endTimeInput && this.endTimeInput.value) {
+				var startTime = this.settings.parseTime(this.startTimeInput);
+				var endTime = this.settings.parseTime(this.endTimeInput);
+				if (startTime && endTime) {
+					this.timeDelta = endTime.getTime() - startTime.getTime();
+					this._updateEndMintime();
+				}
+			}
+		},
+
+		remove: function()
+		{
+			this._unbindChangeHandler();
+		},
+
+		_bindChangeHandler: function(){
+			// addEventListener doesn't work with synthetic "change" events
+			// fired by jQuery's trigger() functioin. If jQuery is present,
+			// use that for event binding
+			if (jq) {
+				jq(this.container).on('change.datepair', jq.proxy(this.handleEvent, this));
+			} else {
+				this.container.addEventListener('change', this, false);
+			}
+		},
+
+		_unbindChangeHandler: function(){
+			if (jq) {
+				jq(this.container).off('change.datepair');
+			} else {
+				this.container.removeEventListener('change', this, false);
+			}
+		},
+
+		// This function will be called when passing 'this' to addEventListener
+		handleEvent: function(e){
+			// temporarily unbind the change handler to prevent triggering this
+			// if we update other inputs
+			this._unbindChangeHandler();
+
+			if (hasClass(e.target, this.settings.dateClass)) {
+				if (e.target.value != '') {
+					this._dateChanged(e.target);
+					this._timeChanged(e.target);
+				} else {
+					this.dateDelta = null;
+				}
+
+			} else if (hasClass(e.target, this.settings.timeClass)) {
+				if (e.target.value != '') {
+					this._timeChanged(e.target);
+				} else {
+					this.timeDelta = null;
+				}
+			}
+
+			this._validateRanges();
+			this._updateEndMintime();
+			this._bindChangeHandler();
+		},
+
+		_dateChanged: function(target){
+			if (!this.startDateInput || !this.endDateInput) {
+				return;
+			}
+
+			var startDate = this.settings.parseDate(this.startDateInput);
+			var endDate = this.settings.parseDate(this.endDateInput);
+
+			if (!startDate || !endDate) {
+				if (this.settings.defaultDateDelta !== null) {
+					if (startDate) {
+						var newEnd = new Date(startDate.getTime() + this.settings.defaultDateDelta * _ONE_DAY);
+						this.settings.updateDate(this.endDateInput, newEnd);
+
+					} else if (endDate) {
+						var newStart = new Date(endDate.getTime() - this.settings.defaultDateDelta * _ONE_DAY);
+						this.settings.updateDate(this.startDateInput, newStart);
+					}
+
+					this.dateDelta = this.settings.defaultDateDelta * _ONE_DAY;
+				} else {
+					this.dateDelta = null;
+				}
+
+				return;
+			}
+
+			if (this.settings.anchor == 'start' && hasClass(target, this.settings.startClass)) {
+				var newDate = new Date(startDate.getTime() + this.dateDelta);
+				this.settings.updateDate(this.endDateInput, newDate);
+			} else if (this.settings.anchor == 'end' && hasClass(target, this.settings.endClass)) {
+				var newDate = new Date(endDate.getTime() - this.dateDelta);
+				this.settings.updateDate(this.startDateInput, newDate);
+			} else {
+				if (endDate < startDate) {
+					var otherInput = hasClass(target, this.settings.startClass) ? this.endDateInput : this.startDateInput;
+					var selectedDate = this.settings.parseDate(target);
+					this.dateDelta = 0;
+					this.settings.updateDate(otherInput, selectedDate);
+				} else {
+					this.dateDelta = endDate.getTime() - startDate.getTime();
+				}
+			}
+		},
+
+		_timeChanged: function(target){
+			if (!this.startTimeInput || !this.endTimeInput) {
+				return;
+			}
+
+			var startTime = this.settings.parseTime(this.startTimeInput);
+			var endTime = this.settings.parseTime(this.endTimeInput);
+
+			if (!startTime || !endTime) {
+				if (this.settings.defaultTimeDelta !== null) {
+					this.timeDelta = this.settings.defaultTimeDelta;
+
+					if (startTime) {
+						endTime = this._setTimeAndReturn(this.endTimeInput, new Date(startTime.getTime() + this.settings.defaultTimeDelta));
+						this._doMidnightRollover(startTime, endTime);
+					} else if (endTime) {
+						startTime = this._setTimeAndReturn(this.startTimeInput, new Date(endTime.getTime() - this.settings.defaultTimeDelta));
+						this._doMidnightRollover(startTime, endTime);
+					}
+				} else {
+					this.timeDelta = null;
+				}
+
+				return;
+			}
+
+			if (this.settings.anchor == 'start' && hasClass(target, this.settings.startClass)) {
+				endTime = this._setTimeAndReturn(this.endTimeInput, new Date(startTime.getTime() + this.timeDelta));
+				this._doMidnightRollover(startTime, endTime);
+			} else if (this.settings.anchor == 'end' && hasClass(target, this.settings.endClass)) {
+				startTime = this._setTimeAndReturn(this.startTimeInput, new Date(endTime.getTime() - this.timeDelta));
+				this._doMidnightRollover(startTime, endTime);
+			} else {
+				this._doMidnightRollover(startTime, endTime);
+
+				var startDate, endDate;
+				if (this.startDateInput && this.endDateInput) {
+					startDate = this.settings.parseDate(this.startDateInput);
+					endDate = this.settings.parseDate(this.endDateInput);
+				}
+
+				if ((+startDate == +endDate) && (endTime < startTime)) {
+					var thisInput  = hasClass(target, this.settings.endClass) ? this.endTimeInput : this.startTimeInput;
+					var otherInput = hasClass(target, this.settings.startClass) ? this.endTimeInput : this.startTimeInput;
+					var selectedTime = this.settings.parseTime(thisInput);
+					this.timeDelta = 0;
+					this.settings.updateTime(otherInput, selectedTime);
+				} else {
+					this.timeDelta = endTime.getTime() - startTime.getTime();
+				}
+			}
+
+
+		},
+
+		_setTimeAndReturn: function(input, newTime) {
+			this.settings.updateTime(input, newTime);
+			return this.settings.parseTime(input);
+		},
+
+		_doMidnightRollover: function(startTime, endTime) {
+			if (!this.startDateInput || !this.endDateInput) {
+				return;
+			}
+
+			var endDate = this.settings.parseDate(this.endDateInput);
+			var startDate = this.settings.parseDate(this.startDateInput);
+			var newDelta = endTime.getTime() - startTime.getTime();
+			var offset = (endTime < startTime) ? _ONE_DAY : -1 * _ONE_DAY;
+
+			if (this.dateDelta !== null
+					&& this.dateDelta + this.timeDelta <= _ONE_DAY
+					&& this.dateDelta + newDelta != 0
+					&& (offset > 0 || this.dateDelta != 0)
+					&& ((newDelta >= 0 && this.timeDelta < 0) || (newDelta < 0 && this.timeDelta >= 0))) {
+
+				if (this.settings.anchor == 'start') {
+					this.settings.updateDate(this.endDateInput, new Date(endDate.getTime() + offset));
+					this._dateChanged(this.endDateInput);
+				} else if (this.settings.anchor == 'end') {
+					this.settings.updateDate(this.startDateInput, new Date(startDate.getTime() - offset));
+					this._dateChanged(this.startDateInput);
+				}
+			}
+			this.timeDelta = newDelta;
+		},
+
+		_updateEndMintime: function(){
+			if (typeof this.settings.setMinTime != 'function') return;
+
+			var baseTime = null;
+			if (this.settings.anchor == 'start' && (!this.dateDelta || this.dateDelta < _ONE_DAY || (this.timeDelta && this.dateDelta + this.timeDelta < _ONE_DAY))) {
+				baseTime = this.settings.parseTime(this.startTimeInput);
+			}
+
+			this.settings.setMinTime(this.endTimeInput, baseTime);
+		},
+
+		_validateRanges: function(){
+			if (this.startTimeInput && this.endTimeInput && this.timeDelta === null) {
+				triggerSimpleCustomEvent(this.container, 'rangeIncomplete');
+				return;
+			}
+
+			if (this.startDateInput && this.endDateInput && this.dateDelta === null) {
+				triggerSimpleCustomEvent(this.container, 'rangeIncomplete');
+				return;
+			}
+
+			// due to the fact that times can wrap around, any time-only pair will be considered valid
+			if (!this.startDateInput || !this.endDateInput || this.dateDelta + this.timeDelta >= 0) {
+				triggerSimpleCustomEvent(this.container, 'rangeSelected');
+			} else {
+				triggerSimpleCustomEvent(this.container, 'rangeError');
+			}
+		}
+	};
+
+	window.Datepair = Datepair;
+
+}(window, document));

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 6 - 0
app/Resources/public/assets/datepair.js/dist/datepair.min.js


+ 51 - 0
app/Resources/public/assets/datepair.js/dist/jquery.datepair.js

@@ -0,0 +1,51 @@
+/*!
+ * datepair.js v0.4.16 - A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.
+ * Copyright (c) 2018 Jon Thornton - http://jonthornton.github.com/Datepair.js
+ * License: MIT
+ */
+
+(function($) {
+
+	if(!$) {
+		return;
+	}
+
+	////////////
+	// Plugin //
+	////////////
+
+	$.fn.datepair = function(option) {
+		var out;
+		this.each(function() {
+			var $this = $(this);
+			var data = $this.data('datepair');
+			var options = typeof option === 'object' && option;
+
+			if (!data) {
+				data = new Datepair(this, options);
+				$this.data('datepair', data);
+			}
+
+			if (option === 'remove') {
+				out = data['remove']();
+				$this.removeData('datepair', data);
+			}
+
+			if (typeof option === 'string') {
+				out = data[option]();
+			}
+		});
+
+		return out || this;
+	};
+
+	//////////////
+	// Data API //
+	//////////////
+
+	$('[data-datepair]').each(function() {
+		var $this = $(this);
+		$this.datepair($this.data());
+	});
+
+}(window.Zepto || window.jQuery));

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 6 - 0
app/Resources/public/assets/datepair.js/dist/jquery.datepair.min.js


+ 503 - 0
app/Resources/public/assets/datepair.js/index.html

@@ -0,0 +1,503 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset='utf-8'>
+
+    <title>Datepair.js &ndash; Demos and Documentation</title>
+    <meta name="description" content="A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar." />
+    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
+
+    <script src="https://jonthornton.github.io/jquery-timepicker/jquery.timepicker.js"></script>
+    <link rel="stylesheet" type="text/css" href="https://jonthornton.github.io/jquery-timepicker/jquery.timepicker.css" />
+
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
+    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.standalone.css" />
+
+    <script src="lib/pikaday.js"></script>
+    <link rel="stylesheet" type="text/css" href="lib/pikaday.css" />
+
+    <script src="lib/jquery.ptTimeSelect.js"></script>
+    <link rel="stylesheet" type="text/css" href="lib/jquery.ptTimeSelect.css" />
+    <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css" type="text/css" media="all" />
+
+    <script src="lib/moment.min.js"></script>
+    <script src="lib/site.js"></script>
+    <link rel="stylesheet" type="text/css" href="lib/site.css" />
+
+    <script src="dist/datepair.js"></script>
+    <script src="dist/jquery.datepair.js"></script>
+</head>
+
+<body>
+    <header>
+        <h1><a href="https://github.com/jonthornton/jquery-datepair">Datepair.js</a></h1>
+        <p>
+            A javascript plugin for intelligently selecting date and time ranges<br />
+            inspired by Google Calendar. <br />
+        </p>
+
+        <ul id="header-links">
+            <li><a href="https://github.com/jonthornton/jquery-datepair#datepair-plugin-for-jquery">Documentation</a></li>
+            <li><a href="https://github.com/jonthornton/jquery-datepair">Source code on GitHub</a></li>
+            <li><a href="https://github.com/jonthornton/jquery-datepair/zipball/master">Download (zip)</a></li>
+            <li><a href="https://github.com/jonthornton/jquery-datepair/issues?state=open">Help</a></li>
+        </ul>
+    </header>
+
+    <section>
+        <p>Use this plugin to link date and time inputs when you need to select ranges. <br />No dependencies, with optional support for jQuery/Zepto.</p>
+    </section>
+
+    <section id="examples">
+        <article>
+            <div class="demo">
+                <h2>Basic Example</h2>
+                <p>Datepair.js doesn't include any date or time picker widgets, but it's preconfigured to work with <a href="https://github.com/jonthornton/jquery-timepicker">jquery-timepicker</a> and <a href="https://github.com/eternicode/bootstrap-datepicker">Bootstrap Datepicker</a>. Include input widgets as you normally would, and then use Datepair.js to link them.</p>
+
+                <p id="basicExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+&lt;p id="basicExample"&gt;
+    &lt;input type="text" class="date start" /&gt;
+    &lt;input type="text" class="time start" /&gt; to
+    &lt;input type="text" class="time end" /&gt;
+    &lt;input type="text" class="date end" /&gt;
+&lt;/p&gt;
+
+&lt;!-- include input widgets; this is independent of Datepair.js --&gt;
+&lt;link rel="styleshee" type="text/css" href="jquery.timepicker.css" /&gt;
+&lt;link rel="stylesheet" type="text/css" href="bootstrap-datepicker.css" /&gt;
+&lt;script type="text/javascript" src="bootstrap-datepicker.js"&gt;&lt;/script&gt;
+&lt;script type="text/javascript" src="jquery.timepicker.js"&gt;&lt;/script&gt;
+
+&lt;script type="text/javascript" src="datepair.js"&gt;&lt;/script&gt;
+&lt;script&gt;
+    // initialize input widgets first
+    $('#basicExample .time').timepicker({
+        'showDuration': true,
+        'timeFormat': 'g:ia'
+    });
+
+    $('#basicExample .date').datepicker({
+        'format': 'm/d/yyyy',
+        'autoclose': true
+    });
+
+    // initialize datepair
+    var basicExampleEl = document.getElementById('basicExample');
+    var datepair = new Datepair(basicExampleEl);
+&lt;/script&gt;
+            </pre>
+
+            <script>
+                $('#basicExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#basicExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                var basicExampleEl = document.getElementById('basicExample');
+                var datepair = new Datepair(basicExampleEl);
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>jQuery Example</h2>
+                <p>Include the optional jquery.datepicker.js file to interact with Datepair.js with a jQuery interface.</p>
+
+                <p id="jqueryExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+&lt;p id="jqueryExample"&gt;
+    &lt;input type="text" class="date start" /&gt;
+    &lt;input type="text" class="time start" /&gt; to
+    &lt;input type="text" class="time end" /&gt;
+    &lt;input type="text" class="date end" /&gt;
+&lt;/p&gt;
+
+&lt;script type="text/javascript" src="datepair.js"&gt;&lt;/script&gt;
+&lt;script type="text/javascript" src="jquery.datepair.js"&gt;&lt;/script&gt;
+&lt;script&gt;
+    // initialize input widgets first
+    $('#jqueryExample .time').timepicker({
+        'showDuration': true,
+        'timeFormat': 'g:ia'
+    });
+
+    $('#jqueryExample .date').datepicker({
+        'format': 'm/d/yyyy',
+        'autoclose': true
+    });
+
+    // initialize datepair
+    $('#jqueryExample').datepair();
+&lt;/script&gt;
+            </pre>
+
+            <script>
+                $('#jqueryExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#jqueryExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                $('#jqueryExample').datepair();
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Date-only Example</h2>
+
+                <p>You can use datepair with just dates, or just times.</p>
+
+                <p id="dateOnlyExample">
+                    <input type="text" class="date start" /> to
+                    <input type="text" class="date end" />
+                </p>
+
+                <p id="timeOnlyExample">
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+// HTML not shown for brevity
+
+$('#timeOnlyExample .time').timepicker({
+    'showDuration': true,
+    'timeFormat': 'g:ia'
+});
+
+var timeOnlyExampleEl = document.getElementById('timeOnlyExample');
+var timeOnlyDatepair = new Datepair(timeOnlyExampleEl);
+
+$('#dateOnlyExample .date').datepicker({
+    'format': 'yyyy-m-d',
+    'autoclose': true
+});
+
+var dateOnlyExampleEl = document.getElementById('dateOnlyExample');
+var dateOnlyDatepair = new Datepair(dateOnlyExampleEl);
+            </pre>
+
+            <script>
+                $('#timeOnlyExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                var timeOnlyExampleEl = document.getElementById('timeOnlyExample');
+                var timeOnlyDatepair = new Datepair(timeOnlyExampleEl);
+
+                $('#dateOnlyExample .date').datepicker({
+                    'format': 'yyyy-m-d',
+                    'autoclose': true
+                });
+
+                var dateOnlyExampleEl = document.getElementById('dateOnlyExample');
+                var dateOnlyDatepair = new Datepair(dateOnlyExampleEl);
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Default Delta Example</h2>
+
+                <p>Datepair can automatically set the other input when a first value is selected.</p>
+
+                <p id="defaultDeltaExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+// HTML not shown for brevity
+
+var defaultDeltaExampleEl = document.getElementById('defaultDeltaExample');
+var defaultDeltaDatepair = new Datepair(defaultDeltaExampleEl, {
+    'defaultDateDelta': 1,      // days
+    'defaultTimeDelta': 7200000 // milliseconds
+});
+            </pre>
+
+            <script>
+                $('#defaultDeltaExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#defaultDeltaExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                var defaultDeltaExampleEl = document.getElementById('defaultDeltaExample');
+                var defaultDeltaDatepair = new Datepair(defaultDeltaExampleEl, {
+                    'defaultDateDelta': 1,
+                    'defaultTimeDelta': 7200000
+                });
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Alternate UI Widgets Example</h2>
+
+                <p>jquery-datepair is widget agnostic and can work with any date and time pickers. Here's an example with <a href="http://pttimeselect.sourceforge.net/example/index.html">jQuery.ptTimeSelect</a> and <a href="https://github.com/dbushell/Pikaday">Pikaday</a>.</p>
+
+                <p id="alternateUiWidgetsExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to<br />
+                    <input type="text" class="date end" />
+                    <input type="text" class="time end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+&lt;p id="alternateUiWidgetsExample"&gt;
+    &lt;input type="text" class="date start" /&gt;
+    &lt;input type="text" class="time start" /&gt; to&lt;br /&gt;
+    &lt;input type="text" class="date end" /&gt;
+    &lt;input type="text" class="time end" /&gt;
+&lt;/p>
+&lt;script type="text/javascript" src="pikaday.js"&gt;&lt;/script&gt;
+&lt;script type="text/javascript" src="jquery.ptTimeSelect.js"&gt;&lt;/script&gt;
+&lt;script type="text/javascript" src="moment.js"&gt;&lt;/script&gt;
+&lt;script&gt;
+    // initialize input widgets
+    // ptTimeSelect doesn't trigger change event by default
+    $('#alternateUiWidgetsExample .time').ptTimeSelect({
+        'onClose': function($self) {
+            $self.trigger('change');
+        }
+    });
+
+    $('#alternateUiWidgetsExample .date').pikaday();
+
+    var TIMEFORMAT = 'h:mm a';
+    var alternateUiWidgetsExampleEl = document.getElementById('alternateUiWidgetsExample');
+    var alternateWidgetsDatepair = new Datepair(alternateUiWidgetsExampleEl, {
+        parseTime: function(input){
+            // use moment.js to parse time
+            var m = moment(input.value, TIMEFORMAT);
+            return m.toDate();
+        },
+        updateTime: function(input, dateObj){
+            var m = moment(dateObj);
+            input.value = m.format(TIMEFORMAT);
+        },
+        parseDate: function(input){
+            var picker = $(input).data('pikaday');
+            return picker.getDate();
+        },
+        updateDate: function(input, dateObj){
+            var picker = $(input).data('pikaday');
+            return picker.setDate(dateObj);
+        }
+    });
+&lt;/script&gt;
+            </pre>
+
+            <script>
+                // initialize input widgets
+                // ptTimeSelect doesn't trigger change event by default
+                $('#alternateUiWidgetsExample .time').ptTimeSelect({
+                    'onClose': function($self) {
+                        $self.trigger('change');
+                    }
+                });
+
+                $('#alternateUiWidgetsExample .date').pikaday();
+
+                var TIMEFORMAT = 'h:mm a';
+                var alternateUiWidgetsExampleEl = document.getElementById('alternateUiWidgetsExample');
+                var alternateWidgetsDatepair = new Datepair(alternateUiWidgetsExampleEl, {
+                    parseTime: function(input){
+                        // use moment.js to parse time
+                        var m = moment(input.value, TIMEFORMAT);
+                        return m.toDate();
+                    },
+                    updateTime: function(input, dateObj){
+                        var m = moment(dateObj);
+                        input.value = m.format(TIMEFORMAT);
+                    },
+                    parseDate: function(input){
+                        var picker = $(input).data('pikaday');
+                        return picker.getDate();
+                    },
+                    updateDate: function(input, dateObj){
+                        var picker = $(input).data('pikaday');
+                        return picker.setDate(dateObj);
+                    }
+                });
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Events Example</h2>
+                <p>Datepair fires several events to indicate the status of the inputs.</p>
+
+                <p id="eventsExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+
+                <p id="eventsExampleStatus"></p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+// HTML not shown for brevity
+
+// initialize input widgets first
+$('#eventsExample .time').timepicker({
+    'showDuration': true,
+    'timeFormat': 'g:ia'
+});
+
+$('#eventsExample .date').datepicker({
+    'format': 'm/d/yyyy',
+    'autoclose': true
+});
+
+var eventsExampleEl = document.getElementById('eventsExample');
+var eventsExampleDatepair = new Datepair(eventsExampleEl);
+
+// some sample handlers
+$('#eventsExample').on('rangeSelected', function(){
+    $('#eventsExampleStatus').text('Valid range selected');
+}).on('rangeIncomplete', function(){
+    $('#eventsExampleStatus').text('Incomplete range');
+}).on('rangeError', function(){
+    $('#eventsExampleStatus').text('Invalid range');
+});
+            </pre>
+
+            <script>
+                $('#eventsExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#eventsExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                var eventsExampleEl = document.getElementById('eventsExample');
+                var eventsExampleDatepair = new Datepair(eventsExampleEl);
+
+                $('#eventsExample').on('rangeSelected', function(){
+                    $('#eventsExampleStatus').text('Valid range selected');
+                }).on('rangeIncomplete', function(){
+                    $('#eventsExampleStatus').text('Incomplete range');
+                }).on('rangeError', function(){
+                    $('#eventsExampleStatus').text('Invalid range');
+                });
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Anchor Example</h2>
+                <p>Datepair defaults to move the end time/date based on changes to the start time/date. This can be changed to the end inputs, or disabled completely.</p>
+
+                <p>Anchor:
+                    <select id="anchorSelect">
+                        <option value="start">Start</option>
+                        <option value="end">End</option>
+                        <option value="">Null</option>
+                    </select>
+                </p>
+                <p id="anchorExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+var anchorExampleEl = document.getElementById('anchorExample');
+var anchorDatepair = new Datepair(anchorExampleEl, {
+    anchor: $('#anchorSelect').val()
+});
+
+$('#anchorSelect').on('change', function(){
+    anchorDatepair.option('anchor', $('#anchorSelect').val());
+});
+            </pre>
+
+            <script>
+                $('#anchorExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#anchorExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                var anchorExampleEl = document.getElementById('anchorExample');
+                var anchorDatepair = new Datepair(anchorExampleEl, {
+                    anchor: $('#anchorSelect').val()
+                });
+
+                $('#anchorSelect').on('change', function(){
+                    anchorDatepair.option('anchor', $('#anchorSelect').val());
+                });
+
+            </script>
+        </article>
+    </section>
+
+    <section>
+        <h2>Need Help?</h2>
+        <p>Check <a href="https://github.com/jonthornton/jquery-datepair#datepair-plugin-for-jquery">the documenation</a> or <a href="https://github.com/jonthornton/jquery-datepair/issues?state=open">submit an issue</a> on GitHub.</p>
+    </section>
+
+    <footer>
+        <p>&copy; 2014 <a href="http://jonthornton.com">Jon Thornton</a></p>
+    </footer>
+
+    <script>
+        (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','https://www.google-analytics.com/analytics.js','ga');
+
+        ga('create', 'UA-15605525-4', 'auto');
+        ga('send', 'pageview');
+    </script>
+
+</body>
+</html>

+ 83 - 0
app/Resources/public/assets/datepair.js/lib/jquery.ptTimeSelect.css

@@ -0,0 +1,83 @@
+/**
+ * FILE: jquery.ptTileSelect.css
+ * 	Default style for the timeselect container.
+ *
+ *  LAST UPDATED:
+ *
+ * 		- $Date: 2009/04/12 20:23:02 $
+ * 		- $Author: paulinho4u $
+ * 		- $Revision: 1.1 $
+ */
+#ptTimeSelectCntr {
+	width: 250px;
+	font-size: .9em;
+	position: absolute;
+	z-index: 10;
+	display: none;
+}
+#ptTimeSelectCntr .ui-widget{
+	padding: .2em;
+}
+#ptTimeSelectCntr .ui-widget-header {
+	padding: .2em;
+}
+#ptTimeSelectCntr #ptTimeSelectUserTime {
+	font-size: larger;
+	padding: .2em;
+	padding-left: 1em;
+	text-align: center;
+}
+#ptTimeSelectCntr #ptTimeSelectCloseCntr {
+	display: block;
+	padding: .2em;
+}
+#ptTimeSelectCntr #ptTimeSelectCloseCntr a {
+	display: block;
+	padding: .2em;
+}
+#ptTimeSelectCntr .ui-widget-content {
+	 margin-top: .1em;
+	 margin-bottom: .1em;
+	 padding: .2em;
+}
+#ptTimeSelectCntr .ui-widget.ui-widget-content {
+	margin-top: 0;
+}
+#ptTimeSelectCntr .ptTimeSelectLeftPane.ui-widget-content {
+	border-top:none;
+	border-bottom:none;
+	border-left:none;
+	border-right-width: 2px;
+}
+#ptTimeSelectCntr .ptTimeSelectRightPane.ui-widget-content {
+	border: none;
+}
+#ptTimeSelectCntr .ptTimeSelectHrCntr a,
+#ptTimeSelectCntr .ptTimeSelectMinCntr a {
+	display: block;
+	float: left;
+	padding: .2em;
+	width: 1.9em;
+	margin: 1px;
+	text-align: center;
+	text-decoration: none;
+}
+#ptTimeSelectCntr .ptTimeSelectHrAmPmCntr a {
+	text-align: center;
+	margin: 1px;
+}
+#ptTimeSelectCntr .ptTimeSelectTimeLabelsCntr {
+	font-weight: bold;
+	font-size: .9em;
+}
+#ptTimeSelectCntr #ptTimeSelectSetButton {
+	padding-top: .2em;
+	padding-bottom: .2em;
+}
+#ptTimeSelectCntr #ptTimeSelectSetButton a {
+ 	display: block;
+	padding: .2em;
+	width: 30%;
+	text-align: center;
+	float: right;
+}

+ 478 - 0
app/Resources/public/assets/datepair.js/lib/jquery.ptTimeSelect.js

@@ -0,0 +1,478 @@
+/**
+ * FILE: jQuery.ptTileSelect.js
+ *
+ * @fileOverview
+ * jQuery plugin for displaying a popup that allows a user
+ * to define a time and set that time back to a form's input
+ * field.
+ *
+ * @version 0.8
+ * @author  Paul Tavares, www.purtuga.com
+ * @see     http://pttimeselect.sourceforge.net
+ *
+ * @requires jQuery {@link http://www.jquery.com}
+ *
+ *
+ * LICENSE:
+ *
+ *  Copyright (c) 2007 Paul T. (purtuga.com)
+ *  Dual licensed under the:
+ *
+ *  -   MIT
+ *      <http://www.opensource.org/licenses/mit-license.php>
+ *
+ *  -   GPL
+ *      <http://www.opensource.org/licenses/gpl-license.php>
+ *
+ *  User can pick whichever one applies best for their project
+ *  and doesn not have to contact me.
+ *
+ *
+ * INSTALLATION:
+ *
+ * There are two files (.css and .js) delivered with this plugin and
+ * that must be included in your html page after the jquery.js library
+ * and the jQuery UI style sheet (the jQuery UI javascript library is
+ * not necessary).
+ * Both of these are to be included inside of the 'head' element of
+ * the document. Example below demonstrates this along side the jQuery
+ * libraries.
+ *
+ * |    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
+ * |    <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/themes/redmond/jquery-ui.css" />
+ * |
+ * |    <link rel="stylesheet" type="text/css" href="jquery.ptTimeSelect.css" />
+ * |    <script type="text/javascript" src="jquery.ptTimeSelect.js"></script>
+ * |
+ *
+ * USAGE:
+ *
+ *     -    See <$(ele).ptTimeSelect()>
+ *
+ *
+ *
+ * LAST UPDATED:
+ *
+ *         - $Date: 2012/08/05 19:40:21 $
+ *         - $Author: paulinho4u $
+ *         - $Revision: 1.8 $
+ *
+ */
+
+(function($){
+
+    /**
+     *  jQuery definition
+     *
+     *  @see    http://jquery.com/
+     *  @name   jQuery
+     *  @class  jQuery Library
+     */
+
+    /**
+     * jQuery 'fn' definition to anchor all public plugin methods.
+     *
+     * @see         http://jquery.com/
+     * @name        fn
+     * @class       jQuery Library public method anchor
+     * @memberOf    jQuery
+     */
+
+    /**
+     *  Namespace for all properties and methods
+     *
+     *  @namespace   ptTimeSelect
+     *  @memberOf    jQuery
+     */
+    jQuery.ptTimeSelect         = {};
+    jQuery.ptTimeSelect.version = "__BUILD_VERSION_NUMBER__";
+
+    /**
+     * The default options for all calls to ptTimeSelect. Can be
+     * overwriten with each individual call to {@link jQuery.fn.ptTimeSelect}
+     *
+     * @type {Object} options
+     * @memberOf jQuery.ptTimeSelect
+     * @see jQuery.fn.ptTimeSelect
+     */
+    jQuery.ptTimeSelect.options = {
+        containerClass: undefined,
+        containerWidth: '22em',
+        hoursLabel:     'Hour',
+        minutesLabel:   'Minutes',
+        setButtonLabel: 'Set',
+        popupImage:     undefined,
+        onFocusDisplay: true,
+        zIndex:         10,
+        onBeforeShow:   undefined,
+        onClose:        undefined
+    };
+
+    /**
+     * Internal method. Called when page is initialized to add the time
+     * selection area to the DOM.
+     *
+     * @private
+     * @memberOf jQuery.ptTimeSelect
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect._ptTimeSelectInit = function () {
+        jQuery(document).ready(
+            function () {
+                //if the html is not yet created in the document, then do it now
+                if (!jQuery('#ptTimeSelectCntr').length) {
+                    jQuery("body").append(
+                            '<div id="ptTimeSelectCntr" class="">'
+                        +    '        <div class="ui-widget ui-widget-content ui-corner-all">'
+                        +    '        <div class="ui-widget-header ui-corner-all">'
+                        +    '            <div id="ptTimeSelectCloseCntr" style="float: right;">'
+                        +    '                <a href="javascript: void(0);" onclick="jQuery.ptTimeSelect.closeCntr();" '
+                        +    '                        onmouseover="jQuery(this).removeClass(\'ui-state-default\').addClass(\'ui-state-hover\');" '
+                        +    '                        onmouseout="jQuery(this).removeClass(\'ui-state-hover\').addClass(\'ui-state-default\');"'
+                        +    '                        class="ui-corner-all ui-state-default">'
+                        +    '                    <span class="ui-icon ui-icon-circle-close">X</span>'
+                        +    '                </a>'
+                        +    '            </div>'
+                        +    '            <div id="ptTimeSelectUserTime" style="float: left;">'
+                        +    '                <span id="ptTimeSelectUserSelHr">1</span> : '
+                        +    '                <span id="ptTimeSelectUserSelMin">00</span> '
+                        +    '                <span id="ptTimeSelectUserSelAmPm">AM</span>'
+                        +    '            </div>'
+                        +    '            <br style="clear: both;" /><div></div>'
+                        +    '        </div>'
+                        +    '        <div class="ui-widget-content ui-corner-all">'
+                        +    '            <div>'
+                        +    '                <div class="ptTimeSelectTimeLabelsCntr">'
+                        +    '                    <div class="ptTimeSelectLeftPane" style="width: 50%; text-align: center; float: left;" class="">Hour</div>'
+                        +    '                    <div class="ptTimeSelectRightPane" style="width: 50%; text-align: center; float: left;">Minutes</div>'
+                        +    '                </div>'
+                        +    '                <div>'
+                        +    '                    <div style="float: left; width: 50%;">'
+                        +    '                        <div class="ui-widget-content ptTimeSelectLeftPane">'
+                        +    '                            <div class="ptTimeSelectHrAmPmCntr">'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);" '
+                        +    '                                        style="display: block; width: 45%; float: left;">AM</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);" '
+                        +    '                                        style="display: block; width: 45%; float: left;">PM</a>'
+                        +    '                                <br style="clear: left;" /><div></div>'
+                        +    '                            </div>'
+                        +    '                            <div class="ptTimeSelectHrCntr">'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">1</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">2</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">3</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">4</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">5</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">6</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">7</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">8</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">9</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">10</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">11</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">12</a>'
+                        +    '                                <br style="clear: left;" /><div></div>'
+                        +    '                            </div>'
+                        +    '                        </div>'
+                        +    '                    </div>'
+                        +    '                    <div style="width: 50%; float: left;">'
+                        +    '                        <div class="ui-widget-content ptTimeSelectRightPane">'
+                        +    '                            <div class="ptTimeSelectMinCntr">'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">00</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">05</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">10</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">15</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">20</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">25</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">30</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">35</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">40</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">45</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">50</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">55</a>'
+                        +    '                                <br style="clear: left;" /><div></div>'
+                        +    '                            </div>'
+                        +    '                        </div>'
+                        +    '                    </div>'
+                        +    '                </div>'
+                        +    '            </div>'
+                        +    '            <div style="clear: left;"></div>'
+                        +    '        </div>'
+                        +    '        <div id="ptTimeSelectSetButton">'
+                        +    '            <a href="javascript: void(0);" onclick="jQuery.ptTimeSelect.setTime()"'
+                        +    '                    onmouseover="jQuery(this).removeClass(\'ui-state-default\').addClass(\'ui-state-hover\');" '
+                        +    '                        onmouseout="jQuery(this).removeClass(\'ui-state-hover\').addClass(\'ui-state-default\');"'
+                        +    '                        class="ui-corner-all ui-state-default">'
+                        +    '                SET'
+                        +    '            </a>'
+                        +    '            <br style="clear: both;" /><div></div>'
+                        +    '        </div>'
+                        +    '        <!--[if lte IE 6.5]>'
+                        +    '            <iframe style="display:block; position:absolute;top: 0;left:0;z-index:-1;'
+                        +    '                filter:Alpha(Opacity=\'0\');width:3000px;height:3000px"></iframe>'
+                        +    '        <![endif]-->'
+                        +    '    </div></div>'
+                    );
+
+                    var e = jQuery('#ptTimeSelectCntr');
+
+                    // Add the events to the functions
+                    e.find('.ptTimeSelectMin')
+                        .bind("click", function(){
+                            jQuery.ptTimeSelect.setMin($(this).text());
+                         });
+
+                    e.find('.ptTimeSelectHr')
+                        .bind("click", function(){
+                            jQuery.ptTimeSelect.setHr($(this).text());
+                         });
+
+                    $(document).mousedown(jQuery.ptTimeSelect._doCheckMouseClick);
+                }//end if
+            }
+        );
+    }();// jQuery.ptTimeSelectInit()
+
+
+    /**
+     * Sets the hour selected by the user on the popup.
+     *
+     * @private
+     * @param  {Integer}   h   -   Interger indicating the hour. This value
+     *                      is the same as the text value displayed on the
+     *                      popup under the hour. This value can also be the
+     *                      words AM or PM.
+     * @return {undefined}
+     *
+     */
+    jQuery.ptTimeSelect.setHr = function(h) {
+        if (    h.toLowerCase() == "am"
+            ||  h.toLowerCase() == "pm"
+        ) {
+            jQuery('#ptTimeSelectUserSelAmPm').empty().append(h);
+        } else {
+            jQuery('#ptTimeSelectUserSelHr').empty().append(h);
+        }
+    };// END setHr() function
+
+    /**
+     * Sets the minutes selected by the user on the popup.
+     *
+     * @private
+     * @param {Integer}    m   - interger indicating the minutes. This
+     *          value is the same as the text value displayed on the popup
+     *          under the minutes.
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect.setMin = function(m) {
+        jQuery('#ptTimeSelectUserSelMin').empty().append(m);
+    };// END setMin() function
+
+    /**
+     * Takes the time defined by the user and sets it to the input
+     * element that the popup is currently opened for.
+     *
+     * @private
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect.setTime = function() {
+        var tSel = jQuery('#ptTimeSelectUserSelHr').text()
+                    + ":"
+                    + jQuery('#ptTimeSelectUserSelMin').text()
+                    + " "
+                    + jQuery('#ptTimeSelectUserSelAmPm').text();
+        jQuery(".isPtTimeSelectActive").val(tSel);
+        this.closeCntr();
+
+    };// END setTime() function
+
+    /**
+     * Displays the time definition area on the page, right below
+     * the input field.  Also sets the custom colors/css on the
+     * displayed area to what ever the input element options were
+     * set with.
+     *
+     * @private
+     * @param {String} uId - Id of the element for whom the area will
+     *                  be displayed. This ID was created when the
+     *                  ptTimeSelect() method was called.
+     * @return {undefined}
+     *
+     */
+    jQuery.ptTimeSelect.openCntr = function (ele) {
+        jQuery.ptTimeSelect.closeCntr();
+        jQuery(".isPtTimeSelectActive").removeClass("isPtTimeSelectActive");
+        var cntr            = jQuery("#ptTimeSelectCntr");
+        var i               = jQuery(ele).eq(0).addClass("isPtTimeSelectActive");
+        var opt             = i.data("ptTimeSelectOptions");
+        var style           = i.offset();
+        style['z-index']    = opt.zIndex;
+        style.top           = (style.top + i.outerHeight());
+        if (opt.containerWidth) {
+            style.width = opt.containerWidth;
+        }
+        if (opt.containerClass) {
+            cntr.addClass(opt.containerClass);
+        }
+        cntr.css(style);
+        var hr    = 1;
+        var min   = '00';
+        var tm    = 'AM';
+        if (i.val()) {
+            var re = /([0-9]{1,2}).*:.*([0-9]{2}).*(PM|AM)/i;
+            var match = re.exec(i.val());
+            if (match) {
+                hr    = match[1] || 1;
+                min    = match[2] || '00';
+                tm    = match[3] || 'AM';
+            }
+        }
+        cntr.find("#ptTimeSelectUserSelHr").empty().append(hr);
+        cntr.find("#ptTimeSelectUserSelMin").empty().append(min);
+        cntr.find("#ptTimeSelectUserSelAmPm").empty().append(tm);
+        cntr.find(".ptTimeSelectTimeLabelsCntr .ptTimeSelectLeftPane")
+            .empty().append(opt.hoursLabel);
+        cntr.find(".ptTimeSelectTimeLabelsCntr .ptTimeSelectRightPane")
+            .empty().append(opt.minutesLabel);
+        cntr.find("#ptTimeSelectSetButton a").empty().append(opt.setButtonLabel);
+        if (opt.onBeforeShow) {
+            opt.onBeforeShow(i, cntr);
+        }
+        cntr.slideDown("fast");
+
+    };// END openCntr()
+
+    /**
+     * Closes (hides it) the popup container.
+     * @private
+     * @param {Object} i    -   Optional. The input field for which the
+     *                          container is being closed.
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect.closeCntr = function(i) {
+        var e = $("#ptTimeSelectCntr");
+        if (e.is(":visible") == true) {
+
+            // If IE, then check to make sure it is realy visible
+            if (jQuery.support.tbody == false) {
+                if (!(e[0].offsetWidth > 0) && !(e[0].offsetHeight > 0) ) {
+                    return;
+                }
+            }
+
+            jQuery('#ptTimeSelectCntr')
+                .css("display", "none")
+                .removeClass()
+                .css("width", "");
+            if (!i) {
+                i = $(".isPtTimeSelectActive");
+            }
+            if (i) {
+                var opt = i.removeClass("isPtTimeSelectActive")
+                            .data("ptTimeSelectOptions");
+                if (opt && opt.onClose) {
+                    opt.onClose(i);
+                }
+            }
+        }
+        return;
+    };//end closeCntr()
+
+    /**
+     * Closes the timePicker popup if user is not longer focused on the
+     * input field or the timepicker
+     *
+     * @private
+     * @param {jQueryEvent} ev -    Event passed in by jQuery
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect._doCheckMouseClick = function(ev){
+        if (!$("#ptTimeSelectCntr:visible").length) {
+            return;
+        }
+        if (   !jQuery(ev.target).closest("#ptTimeSelectCntr").length
+            && jQuery(ev.target).not("input.isPtTimeSelectActive").length ){
+            jQuery.ptTimeSelect.closeCntr();
+        }
+
+    };// jQuery.ptTimeSelect._doCheckMouseClick
+
+    /**
+     * FUNCTION: $().ptTimeSelect()
+     * Attaches a ptTimeSelect widget to each matched element. Matched
+     * elements must be input fields that accept a values (input field).
+     * Each element, when focused upon, will display a time selection
+     * popoup where the user can define a time.
+     *
+     * @memberOf jQuery
+     *
+     * PARAMS:
+     *
+     * @param {Object}      [opt] - An object with the options for the time selection widget.
+     *
+     * @param {String}      [opt.containerClass=""] - A class to be associated with the popup widget.
+     *
+     * @param {String}      [opt.containerWidth=""] - Css width for the container.
+     *
+     * @param {String}      [opt.hoursLabel="Hours"] - Label for the Hours.
+     *
+     * @param {String}      [opt.minutesLabel="Minutes"] - Label for the Mintues container.
+     *
+     * @param {String}      [opt.setButtonLabel="Set"] - Label for the Set button.
+     *
+     * @param {String}      [opt.popupImage=""] - The html element (ex. img or text) to be appended next to each
+     *      input field and that will display the time select widget upon
+     *      click.
+     *
+     * @param {Integer}     [opt.zIndex=10] - Integer for the popup widget z-index.
+     *
+     * @param {Function}    [opt.onBeforeShow=undefined] - Function to be called before the widget is made visible to the
+     *      user. Function is passed 2 arguments: 1) the input field as a
+     *      jquery object and 2) the popup widget as a jquery object.
+     *
+     * @param {Function}    [opt.onClose=undefined] - Function to be called after closing the popup widget. Function
+     *      is passed 1 argument: the input field as a jquery object.
+     *
+     * @param {Bollean}     [opt.onFocusDisplay=true] - True or False indicating if popup is auto displayed upon focus
+     *      of the input field.
+     *
+     *
+     * RETURN:
+     * @return {jQuery} selection
+     *
+     *
+     *
+     * EXAMPLE:
+     * @example
+     *  $('#fooTime').ptTimeSelect();
+     *
+     */
+    jQuery.fn.ptTimeSelect = function (opt) {
+        return this.each(function(){
+            if(this.nodeName.toLowerCase() != 'input') return;
+            var e = jQuery(this);
+            if (e.hasClass('hasPtTimeSelect')){
+                return this;
+            }
+            var thisOpt = {};
+            thisOpt = $.extend(thisOpt, jQuery.ptTimeSelect.options, opt);
+            e.addClass('hasPtTimeSelect').data("ptTimeSelectOptions", thisOpt);
+
+            //Wrap the input field in a <div> element with
+            // a unique id for later referencing.
+            if (thisOpt.popupImage || !thisOpt.onFocusDisplay) {
+                var img = jQuery('<span>&nbsp;</span><a href="javascript:" onclick="' +
+                        'jQuery.ptTimeSelect.openCntr(jQuery(this).data(\'ptTimeSelectEle\'));">' +
+                        thisOpt.popupImage + '</a>'
+                    )
+                    .data("ptTimeSelectEle", e);
+                e.after(img);
+            }
+            if (thisOpt.onFocusDisplay){
+                e.focus(function(){
+                    jQuery.ptTimeSelect.openCntr(this);
+                });
+            }
+            return this;
+        });
+    };// End of jQuery.fn.ptTimeSelect
+
+})(jQuery);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 5 - 0
app/Resources/public/assets/datepair.js/lib/moment.min.js


+ 173 - 0
app/Resources/public/assets/datepair.js/lib/pikaday.css

@@ -0,0 +1,173 @@
+@charset "UTF-8";
+
+/*!
+ * Pikaday
+ * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/
+ */
+
+.pika-single {
+    z-index: 9999;
+    display: block;
+    position: relative;
+    width: 240px;
+    padding: 8px;
+    color: #333;
+    background: #fff;
+    border: 1px solid #ccc;
+    border-bottom-color: #bbb;
+    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+}
+
+.pika-single.is-hidden {
+    display: none;
+}
+
+.pika-single.is-bound {
+    position: absolute;
+    box-shadow: 0 5px 15px -5px rgba(0,0,0,.5);
+}
+
+.pika-title {
+    position: relative;
+    text-align: center;
+}
+
+.pika-label {
+    display: inline-block;
+    *display: inline;
+    position: relative;
+    z-index: 9999;
+    overflow: hidden;
+    margin: 0;
+    padding: 5px 3px;
+    font-size: 14px;
+    line-height: 20px;
+    font-weight: bold;
+    background-color: #fff;
+}
+.pika-title select {
+    cursor: pointer;
+    position: absolute;
+    z-index: 9998;
+    margin: 0;
+    left: 0;
+    top: 5px;
+    filter: alpha(opacity=0);
+    opacity: 0;
+}
+
+.pika-prev,
+.pika-next {
+    display: block;
+    cursor: pointer;
+    position: relative;
+    outline: none;
+    border: 0;
+    padding: 0;
+    width: 20px;
+    height: 30px;
+    /* hide text using text-indent trick, using width value (it's enough) */
+    text-indent: 20px;
+    white-space: nowrap;
+    overflow: hidden;
+    background-color: transparent;
+    background-position: center center;
+    background-repeat: no-repeat;
+    background-size: 75% 75%;
+    opacity: .5;
+    *position: absolute;
+    *top: 0;
+}
+
+.pika-prev:hover,
+.pika-next:hover {
+    opacity: 1;
+}
+
+.pika-prev,
+.is-rtl .pika-next {
+    float: left;
+    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==');
+    *left: 0;
+}
+
+.pika-next,
+.is-rtl .pika-prev {
+    float: right;
+    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=');
+    *right: 0;
+}
+
+.pika-prev.is-disabled,
+.pika-next.is-disabled {
+    cursor: default;
+    opacity: .2;
+}
+
+.pika-select {
+    display: inline-block;
+    *display: inline;
+}
+
+.pika-table {
+    width: 100%;
+    border-collapse: collapse;
+    border-spacing: 0;
+    border: 0;
+}
+
+.pika-table th,
+.pika-table td {
+    width: 14.285714285714286%;
+    padding: 0;
+}
+
+.pika-table th {
+    color: #999;
+    font-size: 12px;
+    line-height: 25px;
+    font-weight: bold;
+    text-align: center;
+}
+
+.pika-button {
+    cursor: pointer;
+    display: block;
+    outline: none;
+    border: 0;
+    margin: 0;
+    width: 100%;
+    padding: 5px;
+    color: #666;
+    font-size: 12px;
+    line-height: 15px;
+    text-align: right;
+    background: #f5f5f5;
+}
+
+.is-today .pika-button {
+    color: #33aaff;
+    font-weight: bold;
+}
+
+.is-selected .pika-button {
+    color: #fff;
+    font-weight: bold;
+    background: #33aaff;
+    box-shadow: inset 0 1px 3px #178fe5;
+    border-radius: 3px;
+}
+
+.is-disabled .pika-button {
+    pointer-events: none;
+    cursor: default;
+    color: #999;
+    opacity: .3;
+}
+
+.pika-button:hover {
+    color: #fff !important;
+    background: #ff8000 !important;
+    box-shadow: none !important;
+    border-radius: 3px !important;
+}

+ 973 - 0
app/Resources/public/assets/datepair.js/lib/pikaday.js

@@ -0,0 +1,973 @@
+/*!
+ * Pikaday
+ *
+ * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
+ */
+
+(function (root, factory)
+{
+    'use strict';
+
+    var moment;
+    if (typeof exports === 'object') {
+        // CommonJS module
+        // Load moment.js as an optional dependency
+        try { moment = require('moment'); } catch (e) {}
+        module.exports = factory(moment);
+    } else if (typeof define === 'function' && define.amd) {
+        // AMD. Register as an anonymous module.
+        define(function (req)
+        {
+            // Load moment.js as an optional dependency
+            var id = 'moment';
+            moment = req.defined && req.defined(id) ? req(id) : undefined;
+            return factory(moment);
+        });
+    } else {
+        root.Pikaday = factory(root.moment);
+    }
+}(this, function (moment)
+{
+    'use strict';
+
+    /**
+     * feature detection and helper functions
+     */
+    var hasMoment = typeof moment === 'function',
+
+    hasEventListeners = !!window.addEventListener,
+
+    document = window.document,
+
+    sto = window.setTimeout,
+
+    addEvent = function(el, e, callback, capture)
+    {
+        if (hasEventListeners) {
+            el.addEventListener(e, callback, !!capture);
+        } else {
+            el.attachEvent('on' + e, callback);
+        }
+    },
+
+    removeEvent = function(el, e, callback, capture)
+    {
+        if (hasEventListeners) {
+            el.removeEventListener(e, callback, !!capture);
+        } else {
+            el.detachEvent('on' + e, callback);
+        }
+    },
+
+    fireEvent = function(el, eventName, data)
+    {
+        var ev;
+
+        if (document.createEvent) {
+            ev = document.createEvent('HTMLEvents');
+            ev.initEvent(eventName, true, false);
+            ev = extend(ev, data);
+            el.dispatchEvent(ev);
+        } else if (document.createEventObject) {
+            ev = document.createEventObject();
+            ev = extend(ev, data);
+            el.fireEvent('on' + eventName, ev);
+        }
+    },
+
+    trim = function(str)
+    {
+        return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,'');
+    },
+
+    hasClass = function(el, cn)
+    {
+        return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;
+    },
+
+    addClass = function(el, cn)
+    {
+        if (!hasClass(el, cn)) {
+            el.className = (el.className === '') ? cn : el.className + ' ' + cn;
+        }
+    },
+
+    removeClass = function(el, cn)
+    {
+        el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));
+    },
+
+    isArray = function(obj)
+    {
+        return (/Array/).test(Object.prototype.toString.call(obj));
+    },
+
+    isDate = function(obj)
+    {
+        return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());
+    },
+
+    isLeapYear = function(year)
+    {
+        // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951
+        return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
+    },
+
+    getDaysInMonth = function(year, month)
+    {
+        return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
+    },
+
+    setToStartOfDay = function(date)
+    {
+        if (isDate(date)) date.setHours(0,0,0,0);
+    },
+
+    compareDates = function(a,b)
+    {
+        // weak date comparison (use setToStartOfDay(date) to ensure correct result)
+        return a.getTime() === b.getTime();
+    },
+
+    extend = function(to, from, overwrite)
+    {
+        var prop, hasProp;
+        for (prop in from) {
+            hasProp = to[prop] !== undefined;
+            if (hasProp && typeof from[prop] === 'object' && from[prop].nodeName === undefined) {
+                if (isDate(from[prop])) {
+                    if (overwrite) {
+                        to[prop] = new Date(from[prop].getTime());
+                    }
+                }
+                else if (isArray(from[prop])) {
+                    if (overwrite) {
+                        to[prop] = from[prop].slice(0);
+                    }
+                } else {
+                    to[prop] = extend({}, from[prop], overwrite);
+                }
+            } else if (overwrite || !hasProp) {
+                to[prop] = from[prop];
+            }
+        }
+        return to;
+    },
+
+
+    /**
+     * defaults and localisation
+     */
+    defaults = {
+
+        // bind the picker to a form field
+        field: null,
+
+        // automatically show/hide the picker on `field` focus (default `true` if `field` is set)
+        bound: undefined,
+
+        // position of the datepicker, relative to the field (default to bottom & left)
+        // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)
+        position: 'bottom left',
+
+        // the default output format for `.toString()` and `field` value
+        format: 'YYYY-MM-DD',
+
+        // the initial date to view when first opened
+        defaultDate: null,
+
+        // make the `defaultDate` the initial selected value
+        setDefaultDate: false,
+
+        // first day of week (0: Sunday, 1: Monday etc)
+        firstDay: 0,
+
+        // the minimum/earliest date that can be selected
+        minDate: null,
+        // the maximum/latest date that can be selected
+        maxDate: null,
+
+        // number of years either side, or array of upper/lower range
+        yearRange: 10,
+
+        // used internally (don't config outside)
+        minYear: 0,
+        maxYear: 9999,
+        minMonth: undefined,
+        maxMonth: undefined,
+
+        isRTL: false,
+
+        // Additional text to append to the year in the calendar title
+        yearSuffix: '',
+
+        // Render the month after year in the calendar title
+        showMonthAfterYear: false,
+
+        // how many months are visible (not implemented yet)
+        numberOfMonths: 1,
+
+        // internationalization
+        i18n: {
+            previousMonth : 'Previous Month',
+            nextMonth     : 'Next Month',
+            months        : ['January','February','March','April','May','June','July','August','September','October','November','December'],
+            weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
+            weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
+        },
+
+        // callback function
+        onSelect: null,
+        onOpen: null,
+        onClose: null,
+        onDraw: null
+    },
+
+
+    /**
+     * templating functions to abstract HTML rendering
+     */
+    renderDayName = function(opts, day, abbr)
+    {
+        day += opts.firstDay;
+        while (day >= 7) {
+            day -= 7;
+        }
+        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
+    },
+
+    renderDay = function(i, isSelected, isToday, isDisabled, isEmpty)
+    {
+        if (isEmpty) {
+            return '<td class="is-empty"></td>';
+        }
+        var arr = [];
+        if (isDisabled) {
+            arr.push('is-disabled');
+        }
+        if (isToday) {
+            arr.push('is-today');
+        }
+        if (isSelected) {
+            arr.push('is-selected');
+        }
+        return '<td data-day="' + i + '" class="' + arr.join(' ') + '"><button class="pika-button" type="button">' + i + '</button>' + '</td>';
+    },
+
+    renderRow = function(days, isRTL)
+    {
+        return '<tr>' + (isRTL ? days.reverse() : days).join('') + '</tr>';
+    },
+
+    renderBody = function(rows)
+    {
+        return '<tbody>' + rows.join('') + '</tbody>';
+    },
+
+    renderHead = function(opts)
+    {
+        var i, arr = [];
+        for (i = 0; i < 7; i++) {
+            arr.push('<th scope="col"><abbr title="' + renderDayName(opts, i) + '">' + renderDayName(opts, i, true) + '</abbr></th>');
+        }
+        return '<thead>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</thead>';
+    },
+
+    renderTitle = function(instance)
+    {
+        var i, j, arr,
+            opts = instance._o,
+            month = instance._m,
+            year  = instance._y,
+            isMinYear = year === opts.minYear,
+            isMaxYear = year === opts.maxYear,
+            html = '<div class="pika-title">',
+            monthHtml,
+            yearHtml,
+            prev = true,
+            next = true;
+
+        for (arr = [], i = 0; i < 12; i++) {
+            arr.push('<option value="' + i + '"' +
+                (i === month ? ' selected': '') +
+                ((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled' : '') + '>' +
+                opts.i18n.months[i] + '</option>');
+        }
+        monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month">' + arr.join('') + '</select></div>';
+
+        if (isArray(opts.yearRange)) {
+            i = opts.yearRange[0];
+            j = opts.yearRange[1] + 1;
+        } else {
+            i = year - opts.yearRange;
+            j = 1 + year + opts.yearRange;
+        }
+
+        for (arr = []; i < j && i <= opts.maxYear; i++) {
+            if (i >= opts.minYear) {
+                arr.push('<option value="' + i + '"' + (i === year ? ' selected': '') + '>' + (i) + '</option>');
+            }
+        }
+        yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year">' + arr.join('') + '</select></div>';
+
+        if (opts.showMonthAfterYear) {
+            html += yearHtml + monthHtml;
+        } else {
+            html += monthHtml + yearHtml;
+        }
+
+        if (isMinYear && (month === 0 || opts.minMonth >= month)) {
+            prev = false;
+        }
+
+        if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {
+            next = false;
+        }
+
+        html += '<button class="pika-prev' + (prev ? '' : ' is-disabled') + '" type="button">' + opts.i18n.previousMonth + '</button>';
+        html += '<button class="pika-next' + (next ? '' : ' is-disabled') + '" type="button">' + opts.i18n.nextMonth + '</button>';
+
+        return html += '</div>';
+    },
+
+    renderTable = function(opts, data)
+    {
+        return '<table cellpadding="0" cellspacing="0" class="pika-table">' + renderHead(opts) + renderBody(data) + '</table>';
+    },
+
+
+    /**
+     * Pikaday constructor
+     */
+    Pikaday = function(options)
+    {
+        var self = this,
+            opts = self.config(options);
+
+        self._onMouseDown = function(e)
+        {
+            if (!self._v) {
+                return;
+            }
+            e = e || window.event;
+            var target = e.target || e.srcElement;
+            if (!target) {
+                return;
+            }
+
+            if (!hasClass(target, 'is-disabled')) {
+                if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) {
+                    self.setDate(new Date(self._y, self._m, parseInt(target.innerHTML, 10)));
+                    if (opts.bound) {
+                        sto(function() {
+                            self.hide();
+                        }, 100);
+                    }
+                    return;
+                }
+                else if (hasClass(target, 'pika-prev')) {
+                    self.prevMonth();
+                }
+                else if (hasClass(target, 'pika-next')) {
+                    self.nextMonth();
+                }
+            }
+            if (!hasClass(target, 'pika-select')) {
+                if (e.preventDefault) {
+                    e.preventDefault();
+                } else {
+                    e.returnValue = false;
+                    return false;
+                }
+            } else {
+                self._c = true;
+            }
+        };
+
+        self._onChange = function(e)
+        {
+            e = e || window.event;
+            var target = e.target || e.srcElement;
+            if (!target) {
+                return;
+            }
+            if (hasClass(target, 'pika-select-month')) {
+                self.gotoMonth(target.value);
+            }
+            else if (hasClass(target, 'pika-select-year')) {
+                self.gotoYear(target.value);
+            }
+        };
+
+        self._onInputChange = function(e)
+        {
+            var date;
+
+            if (e.firedBy === self) {
+                return;
+            }
+            if (hasMoment) {
+                date = moment(opts.field.value, opts.format);
+                date = (date && date.isValid()) ? date.toDate() : null;
+            }
+            else {
+                date = new Date(Date.parse(opts.field.value));
+            }
+            self.setDate(isDate(date) ? date : null);
+            if (!self._v) {
+                self.show();
+            }
+        };
+
+        self._onInputFocus = function()
+        {
+            self.show();
+        };
+
+        self._onInputClick = function()
+        {
+            self.show();
+        };
+
+        self._onInputBlur = function()
+        {
+            if (!self._c) {
+                self._b = sto(function() {
+                    self.hide();
+                }, 50);
+            }
+            self._c = false;
+        };
+
+        self._onClick = function(e)
+        {
+            e = e || window.event;
+            var target = e.target || e.srcElement,
+                pEl = target;
+            if (!target) {
+                return;
+            }
+            if (!hasEventListeners && hasClass(target, 'pika-select')) {
+                if (!target.onchange) {
+                    target.setAttribute('onchange', 'return;');
+                    addEvent(target, 'change', self._onChange);
+                }
+            }
+            do {
+                if (hasClass(pEl, 'pika-single')) {
+                    return;
+                }
+            }
+            while ((pEl = pEl.parentNode));
+            if (self._v && target !== opts.trigger) {
+                self.hide();
+            }
+        };
+
+        self.el = document.createElement('div');
+        self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '');
+
+        addEvent(self.el, 'mousedown', self._onMouseDown, true);
+        addEvent(self.el, 'change', self._onChange);
+
+        if (opts.field) {
+            if (opts.bound) {
+                document.body.appendChild(self.el);
+            } else {
+                opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);
+            }
+            addEvent(opts.field, 'change', self._onInputChange);
+
+            if (!opts.defaultDate) {
+                if (hasMoment && opts.field.value) {
+                    opts.defaultDate = moment(opts.field.value, opts.format).toDate();
+                } else {
+                    opts.defaultDate = new Date(Date.parse(opts.field.value));
+                }
+                opts.setDefaultDate = true;
+            }
+        }
+
+        var defDate = opts.defaultDate;
+
+        if (isDate(defDate)) {
+            if (opts.setDefaultDate) {
+                self.setDate(defDate, true);
+            } else {
+                self.gotoDate(defDate);
+            }
+        } else {
+            self.gotoDate(new Date());
+        }
+
+        if (opts.bound) {
+            this.hide();
+            self.el.className += ' is-bound';
+            addEvent(opts.trigger, 'click', self._onInputClick);
+            addEvent(opts.trigger, 'focus', self._onInputFocus);
+            addEvent(opts.trigger, 'blur', self._onInputBlur);
+        } else {
+            this.show();
+        }
+
+    };
+
+
+    /**
+     * public Pikaday API
+     */
+    Pikaday.prototype = {
+
+
+        /**
+         * configure functionality
+         */
+        config: function(options)
+        {
+            if (!this._o) {
+                this._o = extend({}, defaults, true);
+            }
+
+            var opts = extend(this._o, options, true);
+
+            opts.isRTL = !!opts.isRTL;
+
+            opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;
+
+            opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);
+
+            opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;
+
+            var nom = parseInt(opts.numberOfMonths, 10) || 1;
+            opts.numberOfMonths = nom > 4 ? 4 : nom;
+
+            if (!isDate(opts.minDate)) {
+                opts.minDate = false;
+            }
+            if (!isDate(opts.maxDate)) {
+                opts.maxDate = false;
+            }
+            if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {
+                opts.maxDate = opts.minDate = false;
+            }
+            if (opts.minDate) {
+                setToStartOfDay(opts.minDate);
+                opts.minYear  = opts.minDate.getFullYear();
+                opts.minMonth = opts.minDate.getMonth();
+            }
+            if (opts.maxDate) {
+                setToStartOfDay(opts.maxDate);
+                opts.maxYear  = opts.maxDate.getFullYear();
+                opts.maxMonth = opts.maxDate.getMonth();
+            }
+
+            if (isArray(opts.yearRange)) {
+                var fallback = new Date().getFullYear() - 10;
+                opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;
+                opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;
+            } else {
+                opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;
+                if (opts.yearRange > 100) {
+                    opts.yearRange = 100;
+                }
+            }
+
+            return opts;
+        },
+
+        /**
+         * return a formatted string of the current selection (using Moment.js if available)
+         */
+        toString: function(format)
+        {
+            return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString();
+        },
+
+        /**
+         * return a Moment.js object of the current selection (if available)
+         */
+        getMoment: function()
+        {
+            return hasMoment ? moment(this._d) : null;
+        },
+
+        /**
+         * set the current selection from a Moment.js object (if available)
+         */
+        setMoment: function(date, preventOnSelect)
+        {
+            if (hasMoment && moment.isMoment(date)) {
+                this.setDate(date.toDate(), preventOnSelect);
+            }
+        },
+
+        /**
+         * return a Date object of the current selection
+         */
+        getDate: function()
+        {
+            return isDate(this._d) ? new Date(this._d.getTime()) : null;
+        },
+
+        /**
+         * set the current selection
+         */
+        setDate: function(date, preventOnSelect)
+        {
+            if (!date) {
+                this._d = null;
+                return this.draw();
+            }
+            if (typeof date === 'string') {
+                date = new Date(Date.parse(date));
+            }
+            if (!isDate(date)) {
+                return;
+            }
+
+            var min = this._o.minDate,
+                max = this._o.maxDate;
+
+            if (isDate(min) && date < min) {
+                date = min;
+            } else if (isDate(max) && date > max) {
+                date = max;
+            }
+
+            this._d = new Date(date.getTime());
+            setToStartOfDay(this._d);
+            this.gotoDate(this._d);
+
+            if (this._o.field) {
+                this._o.field.value = this.toString();
+                fireEvent(this._o.field, 'change', { firedBy: this });
+            }
+            if (!preventOnSelect && typeof this._o.onSelect === 'function') {
+                this._o.onSelect.call(this, this.getDate());
+            }
+        },
+
+        /**
+         * change view to a specific date
+         */
+        gotoDate: function(date)
+        {
+            if (!isDate(date)) {
+                return;
+            }
+            this._y = date.getFullYear();
+            this._m = date.getMonth();
+            this.draw();
+        },
+
+        gotoToday: function()
+        {
+            this.gotoDate(new Date());
+        },
+
+        /**
+         * change view to a specific month (zero-index, e.g. 0: January)
+         */
+        gotoMonth: function(month)
+        {
+            if (!isNaN( (month = parseInt(month, 10)) )) {
+                this._m = month < 0 ? 0 : month > 11 ? 11 : month;
+                this.draw();
+            }
+        },
+
+        nextMonth: function()
+        {
+            if (++this._m > 11) {
+                this._m = 0;
+                this._y++;
+            }
+            this.draw();
+        },
+
+        prevMonth: function()
+        {
+            if (--this._m < 0) {
+                this._m = 11;
+                this._y--;
+            }
+            this.draw();
+        },
+
+        /**
+         * change view to a specific full year (e.g. "2012")
+         */
+        gotoYear: function(year)
+        {
+            if (!isNaN(year)) {
+                this._y = parseInt(year, 10);
+                this.draw();
+            }
+        },
+
+        /**
+         * change the minDate
+         */
+        setMinDate: function(value)
+        {
+            this._o.minDate = value;
+        },
+
+        /**
+         * change the maxDate
+         */
+        setMaxDate: function(value)
+        {
+            this._o.maxDate = value;
+        },
+
+        /**
+         * refresh the HTML
+         */
+        draw: function(force)
+        {
+            if (!this._v && !force) {
+                return;
+            }
+            var opts = this._o,
+                minYear = opts.minYear,
+                maxYear = opts.maxYear,
+                minMonth = opts.minMonth,
+                maxMonth = opts.maxMonth;
+
+            if (this._y <= minYear) {
+                this._y = minYear;
+                if (!isNaN(minMonth) && this._m < minMonth) {
+                    this._m = minMonth;
+                }
+            }
+            if (this._y >= maxYear) {
+                this._y = maxYear;
+                if (!isNaN(maxMonth) && this._m > maxMonth) {
+                    this._m = maxMonth;
+                }
+            }
+
+            this.el.innerHTML = renderTitle(this) + this.render(this._y, this._m);
+
+            if (opts.bound) {
+                this.adjustPosition();
+                if(opts.field.type !== 'hidden') {
+                    sto(function() {
+                        opts.trigger.focus();
+                    }, 1);
+                }
+            }
+
+            if (typeof this._o.onDraw === 'function') {
+                var self = this;
+                sto(function() {
+                    self._o.onDraw.call(self);
+                }, 0);
+            }
+        },
+
+        adjustPosition: function()
+        {
+            var field = this._o.trigger, pEl = field,
+            width = this.el.offsetWidth, height = this.el.offsetHeight,
+            viewportWidth = window.innerWidth || document.documentElement.clientWidth,
+            viewportHeight = window.innerHeight || document.documentElement.clientHeight,
+            scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop,
+            left, top, clientRect;
+
+            if (typeof field.getBoundingClientRect === 'function') {
+                clientRect = field.getBoundingClientRect();
+                left = clientRect.left + window.pageXOffset;
+                top = clientRect.bottom + window.pageYOffset;
+            } else {
+                left = pEl.offsetLeft;
+                top  = pEl.offsetTop + pEl.offsetHeight;
+                while((pEl = pEl.offsetParent)) {
+                    left += pEl.offsetLeft;
+                    top  += pEl.offsetTop;
+                }
+            }
+
+            // default position is bottom & left
+            if (left + width > viewportWidth ||
+                (
+                    this._o.position.indexOf('right') > -1 &&
+                    left - width + field.offsetWidth > 0
+                )
+            ) {
+                left = left - width + field.offsetWidth;
+            }
+            if (top + height > viewportHeight + scrollTop ||
+                (
+                    this._o.position.indexOf('top') > -1 &&
+                    top - height - field.offsetHeight > 0
+                )
+            ) {
+                top = top - height - field.offsetHeight;
+            }
+            this.el.style.cssText = [
+                'position: absolute',
+                'left: ' + left + 'px',
+                'top: ' + top + 'px'
+            ].join(';');
+        },
+
+        /**
+         * render HTML for a particular month
+         */
+        render: function(year, month)
+        {
+            var opts   = this._o,
+                now    = new Date(),
+                days   = getDaysInMonth(year, month),
+                before = new Date(year, month, 1).getDay(),
+                data   = [],
+                row    = [];
+            setToStartOfDay(now);
+            if (opts.firstDay > 0) {
+                before -= opts.firstDay;
+                if (before < 0) {
+                    before += 7;
+                }
+            }
+            var cells = days + before,
+                after = cells;
+            while(after > 7) {
+                after -= 7;
+            }
+            cells += 7 - after;
+            for (var i = 0, r = 0; i < cells; i++)
+            {
+                var day = new Date(year, month, 1 + (i - before)),
+                    isDisabled = (opts.minDate && day < opts.minDate) || (opts.maxDate && day > opts.maxDate),
+                    isSelected = isDate(this._d) ? compareDates(day, this._d) : false,
+                    isToday = compareDates(day, now),
+                    isEmpty = i < before || i >= (days + before);
+
+                row.push(renderDay(1 + (i - before), isSelected, isToday, isDisabled, isEmpty));
+
+                if (++r === 7) {
+                    data.push(renderRow(row, opts.isRTL));
+                    row = [];
+                    r = 0;
+                }
+            }
+            return renderTable(opts, data);
+        },
+
+        isVisible: function()
+        {
+            return this._v;
+        },
+
+        show: function()
+        {
+            if (!this._v) {
+                if (this._o.bound) {
+                    addEvent(document, 'click', this._onClick);
+                }
+                removeClass(this.el, 'is-hidden');
+                this._v = true;
+                this.draw();
+                if (typeof this._o.onOpen === 'function') {
+                    this._o.onOpen.call(this);
+                }
+            }
+        },
+
+        hide: function()
+        {
+            var v = this._v;
+            if (v !== false) {
+                if (this._o.bound) {
+                    removeEvent(document, 'click', this._onClick);
+                }
+                this.el.style.cssText = '';
+                addClass(this.el, 'is-hidden');
+                this._v = false;
+                if (v !== undefined && typeof this._o.onClose === 'function') {
+                    this._o.onClose.call(this);
+                }
+            }
+        },
+
+        /**
+         * GAME OVER
+         */
+        destroy: function()
+        {
+            this.hide();
+            removeEvent(this.el, 'mousedown', this._onMouseDown, true);
+            removeEvent(this.el, 'change', this._onChange);
+            if (this._o.field) {
+                removeEvent(this._o.field, 'change', this._onInputChange);
+                if (this._o.bound) {
+                    removeEvent(this._o.trigger, 'click', this._onInputClick);
+                    removeEvent(this._o.trigger, 'focus', this._onInputFocus);
+                    removeEvent(this._o.trigger, 'blur', this._onInputBlur);
+                }
+            }
+            if (this.el.parentNode) {
+                this.el.parentNode.removeChild(this.el);
+            }
+        }
+
+    };
+
+    return Pikaday;
+
+}));
+
+/*!
+ * Pikaday jQuery plugin.
+ *
+ * Copyright © 2013 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
+ */
+
+(function (root, factory)
+{
+    'use strict';
+
+    if (typeof exports === 'object') {
+        // CommonJS module
+        factory(require('jquery'), require('../pikaday'));
+    } else if (typeof define === 'function' && define.amd) {
+        // AMD. Register as an anonymous module.
+        define(['jquery', 'pikaday'], factory);
+    } else {
+        // Browser globals
+        factory(root.jQuery, root.Pikaday);
+    }
+}(this, function ($, Pikaday)
+{
+    'use strict';
+
+    $.fn.pikaday = function()
+    {
+        var args = arguments;
+
+        if (!args || !args.length) {
+            args = [{ }];
+        }
+
+        return this.each(function()
+        {
+            var self   = $(this),
+                plugin = self.data('pikaday');
+
+            if (!(plugin instanceof Pikaday)) {
+                if (typeof args[0] === 'object') {
+                    var options = $.extend({}, args[0]);
+                    options.field = self[0];
+                    self.data('pikaday', new Pikaday(options));
+                }
+            } else {
+                if (typeof args[0] === 'string' && typeof plugin[args[0]] === 'function') {
+                    plugin[args[0]].apply(plugin, Array.prototype.slice.call(args,1));
+                }
+            }
+        });
+    };
+
+}));

+ 200 - 0
app/Resources/public/assets/datepair.js/lib/site.css

@@ -0,0 +1,200 @@
+body {
+    background: #015;
+    color: #bbb;
+    font-family: helvetica, arial, sans-serif;
+    font-size: 15px;
+    line-height: 1.3;
+    margin: 0;
+    padding: 0;
+}
+
+header,
+section,
+footer {
+    padding: 20px;
+}
+
+header,
+footer {
+    background: #111;
+    color: #666;
+    position: relative;
+}
+
+header h1 {
+    margin: 0;
+    padding: 0;
+}
+
+header h1 a {
+    font-family: Lucida Sans Unicode, Lucida Grande, sans-serif;
+    font-size: 60px;
+    font-weight: 200;
+    text-decoration: none;
+}
+
+header p {
+    font-size: 23px;
+}
+
+#header-links {
+    margin: 0;
+    padding: 0;
+    list-style: none;
+    position: absolute;
+    right: 20px;
+    top: 30px;
+    text-align: right;
+}
+
+#header-links a {
+    color: #888;
+}
+
+#header-links a:hover {
+    color: #06c;
+}
+
+h2 {
+    color: #eee;
+    font-size: 35px;
+    font-weight: normal;
+    margin: 0;
+    line-height: 1.1
+}
+
+p {
+    margin: 20px 0 0 0;
+}
+
+p:first-child {
+    margin-top: 0;
+}
+
+input {
+    font-size: 13px;
+    -webkit-border-radius: 3px;
+    -moz-border-radius: 5px;
+    border-radius: 5px;
+    padding: 3px;
+    background: #dde;
+    border: 1px solid #aac;
+}
+
+input.time {
+    width: 80px;
+}
+
+input.date {
+    width: 90px;
+}
+
+a {
+    color: #06c;
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+image {
+    border: 0;
+}
+
+#examples article {
+    padding-top: 100px;
+    clear: both;
+}
+
+#examples article:first-child {
+    padding-top: 0;
+}
+
+#examples .demo {
+    width: 450px;
+    float: left;
+}
+
+#examples .code {
+    font-size: 12px;
+    margin: 0 0 0 470px;
+}
+
+footer {
+    font-size: 12px;
+}
+
+div.ui-datepicker { font-size: 11px; }
+
+#alternateUiWidgetsExample .date { width: 120px; }
+
+/**
+ * Blackboard theme
+ *
+ * Adapted from Domenico Carbotta's TextMate theme of the same name
+ *
+ * @author Domenico Carbotta
+ * @author Craig Campbell
+ * @version 1.0.2
+ */
+pre {
+    background: #0B1022;
+    word-wrap: break-word;
+    margin: 0px;
+    padding: 0px;
+    padding: 10px;
+    color: #fff;
+    font-size: 12px;
+    margin: 0;
+    overflow-y: auto;
+    -webkit-border-radius: 8px;
+    -moz-border-radius: 8px;
+    border-radius: 8px;
+}
+
+pre, code {
+    font-family: Consolas, 'Monaco', courier, monospace;
+}
+
+pre .comment {
+    color: #727272;
+}
+
+pre .constant {
+    color: #D8FA3C;
+}
+
+pre .storage {
+    color: #FBDE2D;
+}
+
+pre .string, pre .comment.docstring {
+    color: #61CE3C;
+}
+
+pre .string.regexp, pre .support.tag.script, pre .support.tag.style {
+    color: #fff;
+}
+
+pre .keyword, pre .selector {
+    color: #FBDE2D;
+}
+
+pre .inherited-class {
+    font-style: italic;
+}
+
+pre .entity {
+    color: #FF6400;
+}
+
+pre .support, *[data-language="c"] .function.call {
+    color: #8DA6CE;
+}
+
+pre .variable.global, pre .variable.class, pre .variable.instance {
+    color: #FF6400;
+}
+
+

+ 10 - 0
app/Resources/public/assets/datepair.js/lib/site.js

@@ -0,0 +1,10 @@
+/* Rainbow v1.1.8 rainbowco.de | included languages: generic, javascript */
+window.Rainbow=function(){function q(a){var b,c=a.getAttribute&&a.getAttribute("data-language")||0;if(!c){a=a.attributes;for(b=0;b<a.length;++b)if("data-language"===a[b].nodeName)return a[b].nodeValue}return c}function B(a){var b=q(a)||q(a.parentNode);if(!b){var c=/\blang(?:uage)?-(\w+)/;(a=a.className.match(c)||a.parentNode.className.match(c))&&(b=a[1])}return b}function C(a,b){for(var c in e[d]){c=parseInt(c,10);if(a==c&&b==e[d][c]?0:a<=c&&b>=e[d][c])delete e[d][c],delete j[d][c];if(a>=c&&a<e[d][c]||
+b>c&&b<e[d][c])return!0}return!1}function r(a,b){return'<span class="'+a.replace(/\./g," ")+(l?" "+l:"")+'">'+b+"</span>"}function s(a,b,c,h){var f=a.exec(c);if(f){++t;!b.name&&"string"==typeof b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var k=f[0],i=f.index,u=f[0].length+i,g=function(){function f(){s(a,b,c,h)}t%100>0?f():setTimeout(f,0)};if(C(i,u))g();else{var m=v(b.matches),l=function(a,c,h){if(a>=c.length)h(k);else{var d=f[c[a]];if(d){var e=b.matches[c[a]],i=e.language,g=e.name&&e.matches?
+e.matches:e,j=function(b,d,e){var i;i=0;var g;for(g=1;g<c[a];++g)f[g]&&(i=i+f[g].length);d=e?r(e,d):d;k=k.substr(0,i)+k.substr(i).replace(b,d);l(++a,c,h)};i?n(d,i,function(a){j(d,a)}):typeof e==="string"?j(d,d,e):w(d,g.length?g:[g],function(a){j(d,a,e.matches?e.name:0)})}else l(++a,c,h)}};l(0,m,function(a){b.name&&(a=r(b.name,a));if(!j[d]){j[d]={};e[d]={}}j[d][i]={replace:f[0],"with":a};e[d][i]=u;g()})}}else h()}function v(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b.sort(function(a,
+b){return b-a})}function w(a,b,c){function h(b,k){k<b.length?s(b[k].pattern,b[k],a,function(){h(b,++k)}):D(a,function(a){delete j[d];delete e[d];--d;c(a)})}++d;h(b,0)}function D(a,b){function c(a,b,h,e){if(h<b.length){++x;var g=b[h],l=j[d][g],a=a.substr(0,g)+a.substr(g).replace(l.replace,l["with"]),g=function(){c(a,b,++h,e)};0<x%250?g():setTimeout(g,0)}else e(a)}var h=v(j[d]);c(a,h,0,b)}function n(a,b,c){var d=m[b]||[],f=m[y]||[],b=z[b]?d:d.concat(f);w(a.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&(?![\w\#]+;)/g,
+"&amp;"),b,c)}function o(a,b,c){if(b<a.length){var d=a[b],f=B(d);return!(-1<(" "+d.className+" ").indexOf(" rainbow "))&&f?(f=f.toLowerCase(),d.className+=d.className?" rainbow":"rainbow",n(d.innerHTML,f,function(k){d.innerHTML=k;j={};e={};p&&p(d,f);setTimeout(function(){o(a,++b,c)},0)})):o(a,++b,c)}c&&c()}function A(a,b){var a=a&&"function"==typeof a.getElementsByTagName?a:document,c=a.getElementsByTagName("pre"),d=a.getElementsByTagName("code"),f,e=[];for(f=0;f<d.length;++f)e.push(d[f]);for(f=0;f<
+c.length;++f)c[f].getElementsByTagName("code").length||e.push(c[f]);o(e,0,b)}var j={},e={},m={},z={},d=0,y=0,t=0,x=0,l,p;return{extend:function(a,b,c){1==arguments.length&&(b=a,a=y);z[a]=c;m[a]=b.concat(m[a]||[])},b:function(a){p=a},a:function(a){l=a},color:function(a,b,c){if("string"==typeof a)return n(a,b,c);if("function"==typeof a)return A(0,a);A(a,b)}}}();window.addEventListener?window.addEventListener("load",Rainbow.color,!1):window.attachEvent("onload",Rainbow.color);Rainbow.onHighlight=Rainbow.b;
+Rainbow.addClass=Rainbow.a;Rainbow.extend([{matches:{1:{name:"keyword.operator",pattern:/\=/g},2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\('|"){1}/g}}},pattern:/(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm},{name:"constant.numeric",pattern:/\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi},{matches:{1:"keyword"},pattern:/\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi},
+{name:"constant.language",pattern:/true|false|null/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g},{matches:{1:"function.call"},pattern:/(\w+?)(?=\()/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(function)\s(.*?)(?=\()/g}]);Rainbow.extend("javascript",[{name:"selector",pattern:/(\s|^)\$(?=\.|\()/g},{name:"support",pattern:/\b(window|document)\b/g},{matches:{1:"support.property"},pattern:/\.(length|node(Name|Value))\b/g},{matches:{1:"support.function"},pattern:/(setTimeout|setInterval)(?=\()/g},{matches:{1:"support.method"},pattern:/\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g},{matches:{1:"support.tag.script",2:[{name:"string",pattern:/('|")(.*?)(\1)/g},{name:"entity.tag.script",
+pattern:/(\w+)/g}],3:"support.tag.script"},pattern:/(&lt;\/?)(script.*?)(&gt;)/g},{name:"string.regexp",matches:{1:"string.regexp.open",2:{name:"constant.regexp.escape",pattern:/\\(.){1}/g},3:"string.regexp.close",4:"string.regexp.modifier"},pattern:/(\/)(?!\*)(.+)(\/)([igm]{0,3})/g},{matches:{1:"storage",3:"entity.function"},pattern:/(var)?(\s|^)(.*)(?=\s?=\s?function\()/g},{name:"entity.function",pattern:/(\w+)(?=:\s{0,}function)/g}]);

+ 24 - 0
app/Resources/public/assets/datepair.js/package.json

@@ -0,0 +1,24 @@
+{
+    "name": "datepair.js",
+    "description": "A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.",
+    "homepage": "http://jonthornton.github.com/Datepair.js",
+    "version": "0.4.16",
+    "main": "dist/datepair.js",
+    "author": {
+        "name": "Jon Thornton",
+        "url": "https://github.com/jonthornton"
+    },
+    "repository": {
+        "type" : "git",
+        "url" : "https://github.com/jonthornton/Datepair.js.git"
+    },
+    "license": "MIT",
+    "devDependencies": {
+        "grunt": "~0.4.1",
+        "grunt-contrib-uglify": "~0.4.0",
+        "grunt-rigger": "~0.5.0",
+        "grunt-contrib-jshint": "^0.11.3",
+        "grunt-contrib-watch": "~0.5.1"
+    },
+    "keywords": [ "timepicker", "datepicker", "time", "date", "picker", "ui", "calendar", "input", "form" ]
+}

+ 45 - 0
app/Resources/public/assets/datepair/.bower.json

@@ -0,0 +1,45 @@
+{
+  "name": "datepair.js",
+  "version": "0.4.16",
+  "main": [
+    "dist/datepair.js",
+    "dist/jquery.datepair.js"
+  ],
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "components",
+    "spec",
+    "Gruntfile.js",
+    "src",
+    "bower_components",
+    "test",
+    "tests"
+  ],
+  "homepage": "http://jonthornton.github.com/Datepair.js",
+  "authors": [
+    "Jon Thornton"
+  ],
+  "description": "A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.",
+  "keywords": [
+    "timepicker",
+    "datepicker",
+    "time",
+    "date",
+    "picker",
+    "ui",
+    "calendar",
+    "input",
+    "form"
+  ],
+  "license": "MIT",
+  "_release": "0.4.16",
+  "_resolution": {
+    "type": "version",
+    "tag": "0.4.16",
+    "commit": "d54ca5c1e9e5fce523b2976e0454d3cd556560ff"
+  },
+  "_source": "https://github.com/jonthornton/Datepair.js.git",
+  "_target": "*",
+  "_originalSource": "datepair"
+}

+ 55 - 0
app/Resources/public/assets/datepair/GruntFile.js

@@ -0,0 +1,55 @@
+module.exports = function(grunt) {
+    grunt.initConfig({
+        pkg: grunt.file.readJSON('package.json'),
+        meta: {
+            banner: '/*!\n' +
+            ' * <%= pkg.name %> v<%= pkg.version %> - <%= pkg.description %>\n' +
+            ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> - <%= pkg.homepage %>\n' +
+            ' * License: <%= pkg.license %>\n' +
+            ' */\n\n'
+        },
+
+        rig: {
+            options: {
+                banner: '<%= meta.banner %>'
+            },
+            dist: {
+                files: {
+                    'dist/datepair.js': ['src/wrapper.js'],
+                    'dist/jquery.datepair.js' : ['src/jquery.datepair.js'],
+                }
+            }
+        },
+
+        uglify: {
+            options: {
+                banner: '<%= meta.banner %>',
+                report: 'min'
+            },
+            dist: {
+                files: {
+                    'dist/datepair.min.js': 'dist/datepair.js',
+                    'dist/jquery.datepair.min.js': ['dist/datepair.js', 'dist/jquery.datepair.js'],
+                }
+            }
+        },
+        jshint: {
+            all: ['src/*.js']
+        },
+
+        watch: {
+            options : {
+                atBegin : true
+            },
+            files: ['src/*.js'],
+            tasks: ['rig']
+        }
+    });
+
+    grunt.loadNpmTasks('grunt-contrib-uglify');
+    grunt.loadNpmTasks('grunt-rigger');
+    grunt.loadNpmTasks('grunt-contrib-watch');
+    grunt.loadNpmTasks('grunt-contrib-jshint');
+
+    grunt.registerTask('default', ['rig', 'uglify']);
+};

+ 165 - 0
app/Resources/public/assets/datepair/README.md

@@ -0,0 +1,165 @@
+# Datepair.js
+
+[See a demo and examples here](http://jonthornton.github.com/Datepair.js)
+
+Datepair.js is a lightweight, modular javascript plugin for intelligently selecting date and time ranges, inspired by Google Calendar. It will keep the start and end date/times in sync and can set default values based on user action. There are no external dependencies, however it can easily be used with jQuery or Zepto. The plugin does not provide any UI widgets; it's preconfigured to work with [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker) and [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker), but you can use it with any datepicker or timepicker (or none at all).
+
+*Looking for [jquery-datepair](#jquery-plugin)? Scroll down.*
+
+## Requirements
+
+* [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker) (>= 1.3) (this dependency can be overridden)
+* [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker) (>= 1.3) (this dependency can be overridden)
+
+## Usage
+
+Include `dist/datepair.js` or `dist/jquery.datepair.min.js` in your app.
+
+```javascript
+var container = document.getElementById('container')
+var datepair = new Datepair(container, options);
+```
+
+Where `#container` contains time/date `<input />` elements with the appropriate class names. `options` is an optional javascript object with parameters explained below.
+
+Note that Datepair is triggered by `change` events and won't work unless the container has some `<input />` elements.
+
+## Options
+
+- **anchor**  
+The input that will control the other input. One of `"start"`, `"end"`, or `null`. See [demo page](http://jonthornton.github.io/Datepair.js/) for more information.
+*default: "start"*
+
+- **dateClass**  
+Class name of the date inputs, if any.  
+*default: "date"*
+
+- **defaultDateDelta**  
+Fill in the second date value with the specified range when the users selects the first date. Value is in days. Set this to ```null``` to disable automatically setting the second date.  
+*default: 0*
+
+- **defaultTimeDelta**  
+Fill in the second time value with the specified range when the users selects the first time. Value is in milliseconds; set this to ```7200000``` for a 2 hour range, for example. Set this to ```null``` to disable automatically setting the second time.  
+*default: 0*
+
+- **endClass**  
+Class name of the range end input(s).  
+*default: "end"*
+
+- **parseDate**  
+A function that takes a jQuery element for a date input and returns a local time ```Date``` object representing the date input value.  
+*default: function for [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker)*
+
+- **parseTime**  
+A function that takes a jQuery element for a time input and returns a local time ```Date``` object representing the time input value. See [example page](http://jonthornton.github.com/Datepair.js) for more info.  
+*default: function for [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker)*
+
+- **setMinTime**  
+A function that takes a jQuery element for a time input and a local time ```Date``` object representing the time, and sets the timepicker minTime value.  
+*default: function for [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker)*
+
+- **startClass**  
+Class name of the range start input(s).  
+*default: "start"*
+
+- **timeClass**  
+Class name of the time inputs, if any.  
+*default: "time"*
+
+- **updateDate**  
+A function that takes a jQuery element for a date input and a local time ```Date``` object representing the date, and sets the input value.  
+*default: function for [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker)*
+
+- **updateTime**  
+A function that takes a jQuery element for a time input and a local time ```Date``` object representing the time, and sets the input value.  
+*default: function for [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker)*
+
+
+## Methods
+
+- **getTimeDiff**  
+Get the date/time range size, in milliseconds.
+
+	```javascript
+	var milliseconds = datepair.getTimeDiff();
+	```
+
+- **refresh**  
+Call this method if you programmatically update the date/time fields after first initialization of datepair.  
+
+	```javascript
+	$('#someInput').val(someValue)
+	datepair.refresh();
+	```
+
+- **remove**  
+Unbind the datepair functionality from a set of inputs.  
+
+	```javascript
+	datepair.remove();
+	``` 
+
+## Events
+
+- **rangeError**  
+Fired after the user interacts with the datepair inputs but selects an invalid range, where the end time/date is before the start.
+
+- **rangeIncomplete**  
+Fired after the user interacts with the datepair inputs but one or more empty inputs remain. Unpaired inputs (such as a start date with no corresponding end date) will not be taken into account.
+
+- **rangeSelected**  
+Fired after the user interacts with the datepair inputs and all paired inputs have valid values.
+
+## jQuery Plugin
+
+Datepair.js includes an optional jQuery interface that can simplify usage when working with jQuery or Zepto. To activate, include both `datepair.js` and `jquery.datepair.js`, or just `jquery.datepair.min.js`. (The minified version includes both scripts.)
+
+### Usage
+
+```javascript
+$('#container').datepair(options);
+var milliseconds = $('#container').datepair('getTimeDiff');
+$('#container').datepair('remove');
+$('#container').datepair('refresh');
+```
+
+## jQuery-UI Datepicker
+
+By default, Datepair.js is configured to work with [Bootstrap Datepicker](https://github.com/eternicode/bootstrap-datepicker). This is different from [jQuery UI Datepicker](http://jqueryui.com/datepicker/). To use jQuery UI Datepicker, override the `parseDate` and `updateDate` methods:
+
+```javascript
+$('#some-container').datepair({
+    parseDate: function (el) {
+        var val = $(el).datepicker('getDate');
+        if (!val) {
+            return null;
+        }
+        var utc = new Date(val);
+        return utc && new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));
+    },
+    updateDate: function (el, v) {
+        $(el).datepicker('setDate', new Date(v.getTime() - (v.getTimezoneOffset() * 60000)));
+    }
+});
+```
+
+## Packaging
+
+https://www.npmjs.com/package/datepair.js  
+`npm install --save datepair.js`
+
+## Help
+
+Submit a [GitHub Issues request](https://github.com/jonthornton/Datepair.js/issues/new).
+
+## Development Guidelines
+
+* Install dependencies (grunt) `npm install`
+* To build and minify, run `grunt`
+* Use `grunt watch` to continuously build while developing
+
+Datepair.js follows [semantic versioning](http://semver.org/).
+
+- - -
+
+This software is made available under the open source MIT License. &copy; 2014 [Jon Thornton](http://www.jonthornton.com).

+ 23 - 0
app/Resources/public/assets/datepair/bower.json

@@ -0,0 +1,23 @@
+{
+  "name": "datepair.js",
+  "version": "0.4.16",
+  "main": ["dist/datepair.js", "dist/jquery.datepair.js"],
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "components",
+    "spec",
+    "Gruntfile.js",
+    "src",
+    "bower_components",
+    "test",
+    "tests"
+  ],
+  "homepage": "http://jonthornton.github.com/Datepair.js",
+  "authors": [
+    "Jon Thornton"
+  ],
+  "description": "A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.",
+  "keywords": [ "timepicker", "datepicker", "time", "date", "picker", "ui", "calendar", "input", "form" ],
+  "license": "MIT"
+}

+ 27 - 0
app/Resources/public/assets/datepair/datepair.jquery.json

@@ -0,0 +1,27 @@
+{
+	"name": "datepair",
+	"version": "0.4.10",
+	"title": "Datepair.js",
+	"description": "A plugin for intelligently selecting date and time ranges inspired by Google Calendar.",
+	"author": {
+		"name": "Jon Thornton",
+		"email": "thornton.jon@gmail.com",
+		"url": "https://github.com/jonthornton"
+	},
+	"licenses": [
+		{
+			"type": "MIT",
+			"url": "http://opensource.org/licenses/MIT"
+		}
+	],
+	"dependencies": {
+		"jquery": ">=1.7"
+	},
+	"keywords": [ "timepicker", "datepicker", "time", "date", "picker", "ui", "calendar", "input", "form" ],
+	"homepage": "http://jonthornton.github.com/jquery-datepair/",
+	"bugs": {
+		"url": "https://github.com/jonthornton/jquery-datepair/issues"
+	},
+	"docs": "https://github.com/jonthornton/jquery-datepair",
+	"download": "https://github.com/jonthornton/jquery-datepair"
+}

+ 360 - 0
app/Resources/public/assets/datepair/dist/datepair.js

@@ -0,0 +1,360 @@
+/*!
+ * datepair.js v0.4.16 - A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.
+ * Copyright (c) 2018 Jon Thornton - http://jonthornton.github.com/Datepair.js
+ * License: MIT
+ */
+
+(function(window, document) {
+
+	'use strict';
+
+	var _ONE_DAY = 86400000;
+	var jq = window.Zepto || window.jQuery;
+
+	function simpleExtend(obj1, obj2) {
+		var out = obj2 || {};
+
+		for (var i in obj1) {
+			if (!(i in out)) {
+				out[i] = obj1[i];
+			}
+		}
+
+		return out;
+	}
+
+	// IE's custom event support is totally borked.
+	// Use jQuery if possible
+	function triggerSimpleCustomEvent(el, eventName) {
+		if (jq) {
+			jq(el).trigger(eventName);
+		} else {
+			var event = document.createEvent('CustomEvent');
+			event.initCustomEvent(eventName, true, true, {});
+			el.dispatchEvent(event);
+		}
+	}
+
+	// el.classList not supported by < IE10
+	// use jQuery if available
+	function hasClass(el, className) {
+		if (jq) {
+			return jq(el).hasClass(className);
+		} else {
+			return el.classList.contains(className);
+		}
+	}
+
+	function Datepair(container, options) {
+		this.dateDelta = null;
+		this.timeDelta = null;
+		this._defaults =	{
+			startClass: 'start',
+			endClass: 'end',
+			timeClass: 'time',
+			dateClass: 'date',
+			defaultDateDelta: 0,
+			defaultTimeDelta: 3600000,
+			anchor: 'start',
+
+			// defaults for jquery-timepicker; override when using other input widgets
+			parseTime: function(input){
+				return jq(input).timepicker('getTime');
+			},
+			updateTime: function(input, dateObj){
+				jq(input).timepicker('setTime', dateObj);
+			},
+			setMinTime: function(input, dateObj){
+				jq(input).timepicker('option', 'minTime', dateObj);
+			},
+
+			// defaults for bootstrap datepicker; override when using other input widgets
+			parseDate: function(input){
+				return input.value && jq(input).datepicker('getDate');
+			},
+			updateDate: function(input, dateObj){
+				jq(input).datepicker('update', dateObj);
+			}
+		};
+
+		this.container = container;
+		this.settings = simpleExtend(this._defaults, options);
+
+		this.startDateInput = this.container.querySelector('.'+this.settings.startClass+'.'+this.settings.dateClass);
+		this.endDateInput = this.container.querySelector('.'+this.settings.endClass+'.'+this.settings.dateClass);
+		this.startTimeInput = this.container.querySelector('.'+this.settings.startClass+'.'+this.settings.timeClass);
+		this.endTimeInput = this.container.querySelector('.'+this.settings.endClass+'.'+this.settings.timeClass);
+
+		// initialize date and time deltas
+		this.refresh();
+
+		// init starts here
+		this._bindChangeHandler();
+	}
+
+	Datepair.prototype = {
+		constructor: Datepair,
+
+		option: function(key, value)
+		{
+			if (typeof key == 'object') {
+				this.settings = simpleExtend(this.settings, key);
+
+			} else if (typeof key == 'string' && typeof value != 'undefined') {
+				this.settings[key] = value;
+
+			} else if (typeof key == 'string') {
+				return this.settings[key];
+			}
+
+			this._updateEndMintime();
+		},
+
+		getTimeDiff: function()
+		{
+			// due to the fact that times can wrap around, timeDiff for any
+			// time-only pair will always be >= 0
+			var delta = this.dateDelta + this.timeDelta;
+			if (delta < 0 && (!this.startDateInput || !this.endDateInput) ) {
+				delta += _ONE_DAY;
+			}
+
+			return delta;
+		},
+
+		refresh: function()
+		{
+			if (this.startDateInput && this.startDateInput.value && this.endDateInput && this.endDateInput.value) {
+				var startDate = this.settings.parseDate(this.startDateInput);
+				var endDate = this.settings.parseDate(this.endDateInput);
+				if (startDate && endDate) {
+					this.dateDelta = endDate.getTime() - startDate.getTime();
+				}
+			}
+			if (this.startTimeInput && this.startTimeInput.value && this.endTimeInput && this.endTimeInput.value) {
+				var startTime = this.settings.parseTime(this.startTimeInput);
+				var endTime = this.settings.parseTime(this.endTimeInput);
+				if (startTime && endTime) {
+					this.timeDelta = endTime.getTime() - startTime.getTime();
+					this._updateEndMintime();
+				}
+			}
+		},
+
+		remove: function()
+		{
+			this._unbindChangeHandler();
+		},
+
+		_bindChangeHandler: function(){
+			// addEventListener doesn't work with synthetic "change" events
+			// fired by jQuery's trigger() functioin. If jQuery is present,
+			// use that for event binding
+			if (jq) {
+				jq(this.container).on('change.datepair', jq.proxy(this.handleEvent, this));
+			} else {
+				this.container.addEventListener('change', this, false);
+			}
+		},
+
+		_unbindChangeHandler: function(){
+			if (jq) {
+				jq(this.container).off('change.datepair');
+			} else {
+				this.container.removeEventListener('change', this, false);
+			}
+		},
+
+		// This function will be called when passing 'this' to addEventListener
+		handleEvent: function(e){
+			// temporarily unbind the change handler to prevent triggering this
+			// if we update other inputs
+			this._unbindChangeHandler();
+
+			if (hasClass(e.target, this.settings.dateClass)) {
+				if (e.target.value != '') {
+					this._dateChanged(e.target);
+					this._timeChanged(e.target);
+				} else {
+					this.dateDelta = null;
+				}
+
+			} else if (hasClass(e.target, this.settings.timeClass)) {
+				if (e.target.value != '') {
+					this._timeChanged(e.target);
+				} else {
+					this.timeDelta = null;
+				}
+			}
+
+			this._validateRanges();
+			this._updateEndMintime();
+			this._bindChangeHandler();
+		},
+
+		_dateChanged: function(target){
+			if (!this.startDateInput || !this.endDateInput) {
+				return;
+			}
+
+			var startDate = this.settings.parseDate(this.startDateInput);
+			var endDate = this.settings.parseDate(this.endDateInput);
+
+			if (!startDate || !endDate) {
+				if (this.settings.defaultDateDelta !== null) {
+					if (startDate) {
+						var newEnd = new Date(startDate.getTime() + this.settings.defaultDateDelta * _ONE_DAY);
+						this.settings.updateDate(this.endDateInput, newEnd);
+
+					} else if (endDate) {
+						var newStart = new Date(endDate.getTime() - this.settings.defaultDateDelta * _ONE_DAY);
+						this.settings.updateDate(this.startDateInput, newStart);
+					}
+
+					this.dateDelta = this.settings.defaultDateDelta * _ONE_DAY;
+				} else {
+					this.dateDelta = null;
+				}
+
+				return;
+			}
+
+			if (this.settings.anchor == 'start' && hasClass(target, this.settings.startClass)) {
+				var newDate = new Date(startDate.getTime() + this.dateDelta);
+				this.settings.updateDate(this.endDateInput, newDate);
+			} else if (this.settings.anchor == 'end' && hasClass(target, this.settings.endClass)) {
+				var newDate = new Date(endDate.getTime() - this.dateDelta);
+				this.settings.updateDate(this.startDateInput, newDate);
+			} else {
+				if (endDate < startDate) {
+					var otherInput = hasClass(target, this.settings.startClass) ? this.endDateInput : this.startDateInput;
+					var selectedDate = this.settings.parseDate(target);
+					this.dateDelta = 0;
+					this.settings.updateDate(otherInput, selectedDate);
+				} else {
+					this.dateDelta = endDate.getTime() - startDate.getTime();
+				}
+			}
+		},
+
+		_timeChanged: function(target){
+			if (!this.startTimeInput || !this.endTimeInput) {
+				return;
+			}
+
+			var startTime = this.settings.parseTime(this.startTimeInput);
+			var endTime = this.settings.parseTime(this.endTimeInput);
+
+			if (!startTime || !endTime) {
+				if (this.settings.defaultTimeDelta !== null) {
+					this.timeDelta = this.settings.defaultTimeDelta;
+
+					if (startTime) {
+						endTime = this._setTimeAndReturn(this.endTimeInput, new Date(startTime.getTime() + this.settings.defaultTimeDelta));
+						this._doMidnightRollover(startTime, endTime);
+					} else if (endTime) {
+						startTime = this._setTimeAndReturn(this.startTimeInput, new Date(endTime.getTime() - this.settings.defaultTimeDelta));
+						this._doMidnightRollover(startTime, endTime);
+					}
+				} else {
+					this.timeDelta = null;
+				}
+
+				return;
+			}
+
+			if (this.settings.anchor == 'start' && hasClass(target, this.settings.startClass)) {
+				endTime = this._setTimeAndReturn(this.endTimeInput, new Date(startTime.getTime() + this.timeDelta));
+				this._doMidnightRollover(startTime, endTime);
+			} else if (this.settings.anchor == 'end' && hasClass(target, this.settings.endClass)) {
+				startTime = this._setTimeAndReturn(this.startTimeInput, new Date(endTime.getTime() - this.timeDelta));
+				this._doMidnightRollover(startTime, endTime);
+			} else {
+				this._doMidnightRollover(startTime, endTime);
+
+				var startDate, endDate;
+				if (this.startDateInput && this.endDateInput) {
+					startDate = this.settings.parseDate(this.startDateInput);
+					endDate = this.settings.parseDate(this.endDateInput);
+				}
+
+				if ((+startDate == +endDate) && (endTime < startTime)) {
+					var thisInput  = hasClass(target, this.settings.endClass) ? this.endTimeInput : this.startTimeInput;
+					var otherInput = hasClass(target, this.settings.startClass) ? this.endTimeInput : this.startTimeInput;
+					var selectedTime = this.settings.parseTime(thisInput);
+					this.timeDelta = 0;
+					this.settings.updateTime(otherInput, selectedTime);
+				} else {
+					this.timeDelta = endTime.getTime() - startTime.getTime();
+				}
+			}
+
+
+		},
+
+		_setTimeAndReturn: function(input, newTime) {
+			this.settings.updateTime(input, newTime);
+			return this.settings.parseTime(input);
+		},
+
+		_doMidnightRollover: function(startTime, endTime) {
+			if (!this.startDateInput || !this.endDateInput) {
+				return;
+			}
+
+			var endDate = this.settings.parseDate(this.endDateInput);
+			var startDate = this.settings.parseDate(this.startDateInput);
+			var newDelta = endTime.getTime() - startTime.getTime();
+			var offset = (endTime < startTime) ? _ONE_DAY : -1 * _ONE_DAY;
+
+			if (this.dateDelta !== null
+					&& this.dateDelta + this.timeDelta <= _ONE_DAY
+					&& this.dateDelta + newDelta != 0
+					&& (offset > 0 || this.dateDelta != 0)
+					&& ((newDelta >= 0 && this.timeDelta < 0) || (newDelta < 0 && this.timeDelta >= 0))) {
+
+				if (this.settings.anchor == 'start') {
+					this.settings.updateDate(this.endDateInput, new Date(endDate.getTime() + offset));
+					this._dateChanged(this.endDateInput);
+				} else if (this.settings.anchor == 'end') {
+					this.settings.updateDate(this.startDateInput, new Date(startDate.getTime() - offset));
+					this._dateChanged(this.startDateInput);
+				}
+			}
+			this.timeDelta = newDelta;
+		},
+
+		_updateEndMintime: function(){
+			if (typeof this.settings.setMinTime != 'function') return;
+
+			var baseTime = null;
+			if (this.settings.anchor == 'start' && (!this.dateDelta || this.dateDelta < _ONE_DAY || (this.timeDelta && this.dateDelta + this.timeDelta < _ONE_DAY))) {
+				baseTime = this.settings.parseTime(this.startTimeInput);
+			}
+
+			this.settings.setMinTime(this.endTimeInput, baseTime);
+		},
+
+		_validateRanges: function(){
+			if (this.startTimeInput && this.endTimeInput && this.timeDelta === null) {
+				triggerSimpleCustomEvent(this.container, 'rangeIncomplete');
+				return;
+			}
+
+			if (this.startDateInput && this.endDateInput && this.dateDelta === null) {
+				triggerSimpleCustomEvent(this.container, 'rangeIncomplete');
+				return;
+			}
+
+			// due to the fact that times can wrap around, any time-only pair will be considered valid
+			if (!this.startDateInput || !this.endDateInput || this.dateDelta + this.timeDelta >= 0) {
+				triggerSimpleCustomEvent(this.container, 'rangeSelected');
+			} else {
+				triggerSimpleCustomEvent(this.container, 'rangeError');
+			}
+		}
+	};
+
+	window.Datepair = Datepair;
+
+}(window, document));

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 6 - 0
app/Resources/public/assets/datepair/dist/datepair.min.js


+ 51 - 0
app/Resources/public/assets/datepair/dist/jquery.datepair.js

@@ -0,0 +1,51 @@
+/*!
+ * datepair.js v0.4.16 - A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.
+ * Copyright (c) 2018 Jon Thornton - http://jonthornton.github.com/Datepair.js
+ * License: MIT
+ */
+
+(function($) {
+
+	if(!$) {
+		return;
+	}
+
+	////////////
+	// Plugin //
+	////////////
+
+	$.fn.datepair = function(option) {
+		var out;
+		this.each(function() {
+			var $this = $(this);
+			var data = $this.data('datepair');
+			var options = typeof option === 'object' && option;
+
+			if (!data) {
+				data = new Datepair(this, options);
+				$this.data('datepair', data);
+			}
+
+			if (option === 'remove') {
+				out = data['remove']();
+				$this.removeData('datepair', data);
+			}
+
+			if (typeof option === 'string') {
+				out = data[option]();
+			}
+		});
+
+		return out || this;
+	};
+
+	//////////////
+	// Data API //
+	//////////////
+
+	$('[data-datepair]').each(function() {
+		var $this = $(this);
+		$this.datepair($this.data());
+	});
+
+}(window.Zepto || window.jQuery));

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 6 - 0
app/Resources/public/assets/datepair/dist/jquery.datepair.min.js


+ 503 - 0
app/Resources/public/assets/datepair/index.html

@@ -0,0 +1,503 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset='utf-8'>
+
+    <title>Datepair.js &ndash; Demos and Documentation</title>
+    <meta name="description" content="A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar." />
+    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
+
+    <script src="https://jonthornton.github.io/jquery-timepicker/jquery.timepicker.js"></script>
+    <link rel="stylesheet" type="text/css" href="https://jonthornton.github.io/jquery-timepicker/jquery.timepicker.css" />
+
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
+    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.standalone.css" />
+
+    <script src="lib/pikaday.js"></script>
+    <link rel="stylesheet" type="text/css" href="lib/pikaday.css" />
+
+    <script src="lib/jquery.ptTimeSelect.js"></script>
+    <link rel="stylesheet" type="text/css" href="lib/jquery.ptTimeSelect.css" />
+    <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css" type="text/css" media="all" />
+
+    <script src="lib/moment.min.js"></script>
+    <script src="lib/site.js"></script>
+    <link rel="stylesheet" type="text/css" href="lib/site.css" />
+
+    <script src="dist/datepair.js"></script>
+    <script src="dist/jquery.datepair.js"></script>
+</head>
+
+<body>
+    <header>
+        <h1><a href="https://github.com/jonthornton/jquery-datepair">Datepair.js</a></h1>
+        <p>
+            A javascript plugin for intelligently selecting date and time ranges<br />
+            inspired by Google Calendar. <br />
+        </p>
+
+        <ul id="header-links">
+            <li><a href="https://github.com/jonthornton/jquery-datepair#datepair-plugin-for-jquery">Documentation</a></li>
+            <li><a href="https://github.com/jonthornton/jquery-datepair">Source code on GitHub</a></li>
+            <li><a href="https://github.com/jonthornton/jquery-datepair/zipball/master">Download (zip)</a></li>
+            <li><a href="https://github.com/jonthornton/jquery-datepair/issues?state=open">Help</a></li>
+        </ul>
+    </header>
+
+    <section>
+        <p>Use this plugin to link date and time inputs when you need to select ranges. <br />No dependencies, with optional support for jQuery/Zepto.</p>
+    </section>
+
+    <section id="examples">
+        <article>
+            <div class="demo">
+                <h2>Basic Example</h2>
+                <p>Datepair.js doesn't include any date or time picker widgets, but it's preconfigured to work with <a href="https://github.com/jonthornton/jquery-timepicker">jquery-timepicker</a> and <a href="https://github.com/eternicode/bootstrap-datepicker">Bootstrap Datepicker</a>. Include input widgets as you normally would, and then use Datepair.js to link them.</p>
+
+                <p id="basicExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+&lt;p id="basicExample"&gt;
+    &lt;input type="text" class="date start" /&gt;
+    &lt;input type="text" class="time start" /&gt; to
+    &lt;input type="text" class="time end" /&gt;
+    &lt;input type="text" class="date end" /&gt;
+&lt;/p&gt;
+
+&lt;!-- include input widgets; this is independent of Datepair.js --&gt;
+&lt;link rel="styleshee" type="text/css" href="jquery.timepicker.css" /&gt;
+&lt;link rel="stylesheet" type="text/css" href="bootstrap-datepicker.css" /&gt;
+&lt;script type="text/javascript" src="bootstrap-datepicker.js"&gt;&lt;/script&gt;
+&lt;script type="text/javascript" src="jquery.timepicker.js"&gt;&lt;/script&gt;
+
+&lt;script type="text/javascript" src="datepair.js"&gt;&lt;/script&gt;
+&lt;script&gt;
+    // initialize input widgets first
+    $('#basicExample .time').timepicker({
+        'showDuration': true,
+        'timeFormat': 'g:ia'
+    });
+
+    $('#basicExample .date').datepicker({
+        'format': 'm/d/yyyy',
+        'autoclose': true
+    });
+
+    // initialize datepair
+    var basicExampleEl = document.getElementById('basicExample');
+    var datepair = new Datepair(basicExampleEl);
+&lt;/script&gt;
+            </pre>
+
+            <script>
+                $('#basicExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#basicExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                var basicExampleEl = document.getElementById('basicExample');
+                var datepair = new Datepair(basicExampleEl);
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>jQuery Example</h2>
+                <p>Include the optional jquery.datepicker.js file to interact with Datepair.js with a jQuery interface.</p>
+
+                <p id="jqueryExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+&lt;p id="jqueryExample"&gt;
+    &lt;input type="text" class="date start" /&gt;
+    &lt;input type="text" class="time start" /&gt; to
+    &lt;input type="text" class="time end" /&gt;
+    &lt;input type="text" class="date end" /&gt;
+&lt;/p&gt;
+
+&lt;script type="text/javascript" src="datepair.js"&gt;&lt;/script&gt;
+&lt;script type="text/javascript" src="jquery.datepair.js"&gt;&lt;/script&gt;
+&lt;script&gt;
+    // initialize input widgets first
+    $('#jqueryExample .time').timepicker({
+        'showDuration': true,
+        'timeFormat': 'g:ia'
+    });
+
+    $('#jqueryExample .date').datepicker({
+        'format': 'm/d/yyyy',
+        'autoclose': true
+    });
+
+    // initialize datepair
+    $('#jqueryExample').datepair();
+&lt;/script&gt;
+            </pre>
+
+            <script>
+                $('#jqueryExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#jqueryExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                $('#jqueryExample').datepair();
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Date-only Example</h2>
+
+                <p>You can use datepair with just dates, or just times.</p>
+
+                <p id="dateOnlyExample">
+                    <input type="text" class="date start" /> to
+                    <input type="text" class="date end" />
+                </p>
+
+                <p id="timeOnlyExample">
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+// HTML not shown for brevity
+
+$('#timeOnlyExample .time').timepicker({
+    'showDuration': true,
+    'timeFormat': 'g:ia'
+});
+
+var timeOnlyExampleEl = document.getElementById('timeOnlyExample');
+var timeOnlyDatepair = new Datepair(timeOnlyExampleEl);
+
+$('#dateOnlyExample .date').datepicker({
+    'format': 'yyyy-m-d',
+    'autoclose': true
+});
+
+var dateOnlyExampleEl = document.getElementById('dateOnlyExample');
+var dateOnlyDatepair = new Datepair(dateOnlyExampleEl);
+            </pre>
+
+            <script>
+                $('#timeOnlyExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                var timeOnlyExampleEl = document.getElementById('timeOnlyExample');
+                var timeOnlyDatepair = new Datepair(timeOnlyExampleEl);
+
+                $('#dateOnlyExample .date').datepicker({
+                    'format': 'yyyy-m-d',
+                    'autoclose': true
+                });
+
+                var dateOnlyExampleEl = document.getElementById('dateOnlyExample');
+                var dateOnlyDatepair = new Datepair(dateOnlyExampleEl);
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Default Delta Example</h2>
+
+                <p>Datepair can automatically set the other input when a first value is selected.</p>
+
+                <p id="defaultDeltaExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+// HTML not shown for brevity
+
+var defaultDeltaExampleEl = document.getElementById('defaultDeltaExample');
+var defaultDeltaDatepair = new Datepair(defaultDeltaExampleEl, {
+    'defaultDateDelta': 1,      // days
+    'defaultTimeDelta': 7200000 // milliseconds
+});
+            </pre>
+
+            <script>
+                $('#defaultDeltaExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#defaultDeltaExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                var defaultDeltaExampleEl = document.getElementById('defaultDeltaExample');
+                var defaultDeltaDatepair = new Datepair(defaultDeltaExampleEl, {
+                    'defaultDateDelta': 1,
+                    'defaultTimeDelta': 7200000
+                });
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Alternate UI Widgets Example</h2>
+
+                <p>jquery-datepair is widget agnostic and can work with any date and time pickers. Here's an example with <a href="http://pttimeselect.sourceforge.net/example/index.html">jQuery.ptTimeSelect</a> and <a href="https://github.com/dbushell/Pikaday">Pikaday</a>.</p>
+
+                <p id="alternateUiWidgetsExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to<br />
+                    <input type="text" class="date end" />
+                    <input type="text" class="time end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+&lt;p id="alternateUiWidgetsExample"&gt;
+    &lt;input type="text" class="date start" /&gt;
+    &lt;input type="text" class="time start" /&gt; to&lt;br /&gt;
+    &lt;input type="text" class="date end" /&gt;
+    &lt;input type="text" class="time end" /&gt;
+&lt;/p>
+&lt;script type="text/javascript" src="pikaday.js"&gt;&lt;/script&gt;
+&lt;script type="text/javascript" src="jquery.ptTimeSelect.js"&gt;&lt;/script&gt;
+&lt;script type="text/javascript" src="moment.js"&gt;&lt;/script&gt;
+&lt;script&gt;
+    // initialize input widgets
+    // ptTimeSelect doesn't trigger change event by default
+    $('#alternateUiWidgetsExample .time').ptTimeSelect({
+        'onClose': function($self) {
+            $self.trigger('change');
+        }
+    });
+
+    $('#alternateUiWidgetsExample .date').pikaday();
+
+    var TIMEFORMAT = 'h:mm a';
+    var alternateUiWidgetsExampleEl = document.getElementById('alternateUiWidgetsExample');
+    var alternateWidgetsDatepair = new Datepair(alternateUiWidgetsExampleEl, {
+        parseTime: function(input){
+            // use moment.js to parse time
+            var m = moment(input.value, TIMEFORMAT);
+            return m.toDate();
+        },
+        updateTime: function(input, dateObj){
+            var m = moment(dateObj);
+            input.value = m.format(TIMEFORMAT);
+        },
+        parseDate: function(input){
+            var picker = $(input).data('pikaday');
+            return picker.getDate();
+        },
+        updateDate: function(input, dateObj){
+            var picker = $(input).data('pikaday');
+            return picker.setDate(dateObj);
+        }
+    });
+&lt;/script&gt;
+            </pre>
+
+            <script>
+                // initialize input widgets
+                // ptTimeSelect doesn't trigger change event by default
+                $('#alternateUiWidgetsExample .time').ptTimeSelect({
+                    'onClose': function($self) {
+                        $self.trigger('change');
+                    }
+                });
+
+                $('#alternateUiWidgetsExample .date').pikaday();
+
+                var TIMEFORMAT = 'h:mm a';
+                var alternateUiWidgetsExampleEl = document.getElementById('alternateUiWidgetsExample');
+                var alternateWidgetsDatepair = new Datepair(alternateUiWidgetsExampleEl, {
+                    parseTime: function(input){
+                        // use moment.js to parse time
+                        var m = moment(input.value, TIMEFORMAT);
+                        return m.toDate();
+                    },
+                    updateTime: function(input, dateObj){
+                        var m = moment(dateObj);
+                        input.value = m.format(TIMEFORMAT);
+                    },
+                    parseDate: function(input){
+                        var picker = $(input).data('pikaday');
+                        return picker.getDate();
+                    },
+                    updateDate: function(input, dateObj){
+                        var picker = $(input).data('pikaday');
+                        return picker.setDate(dateObj);
+                    }
+                });
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Events Example</h2>
+                <p>Datepair fires several events to indicate the status of the inputs.</p>
+
+                <p id="eventsExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+
+                <p id="eventsExampleStatus"></p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+// HTML not shown for brevity
+
+// initialize input widgets first
+$('#eventsExample .time').timepicker({
+    'showDuration': true,
+    'timeFormat': 'g:ia'
+});
+
+$('#eventsExample .date').datepicker({
+    'format': 'm/d/yyyy',
+    'autoclose': true
+});
+
+var eventsExampleEl = document.getElementById('eventsExample');
+var eventsExampleDatepair = new Datepair(eventsExampleEl);
+
+// some sample handlers
+$('#eventsExample').on('rangeSelected', function(){
+    $('#eventsExampleStatus').text('Valid range selected');
+}).on('rangeIncomplete', function(){
+    $('#eventsExampleStatus').text('Incomplete range');
+}).on('rangeError', function(){
+    $('#eventsExampleStatus').text('Invalid range');
+});
+            </pre>
+
+            <script>
+                $('#eventsExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#eventsExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                var eventsExampleEl = document.getElementById('eventsExample');
+                var eventsExampleDatepair = new Datepair(eventsExampleEl);
+
+                $('#eventsExample').on('rangeSelected', function(){
+                    $('#eventsExampleStatus').text('Valid range selected');
+                }).on('rangeIncomplete', function(){
+                    $('#eventsExampleStatus').text('Incomplete range');
+                }).on('rangeError', function(){
+                    $('#eventsExampleStatus').text('Invalid range');
+                });
+            </script>
+        </article>
+
+        <article>
+            <div class="demo">
+                <h2>Anchor Example</h2>
+                <p>Datepair defaults to move the end time/date based on changes to the start time/date. This can be changed to the end inputs, or disabled completely.</p>
+
+                <p>Anchor:
+                    <select id="anchorSelect">
+                        <option value="start">Start</option>
+                        <option value="end">End</option>
+                        <option value="">Null</option>
+                    </select>
+                </p>
+                <p id="anchorExample">
+                    <input type="text" class="date start" />
+                    <input type="text" class="time start" /> to
+                    <input type="text" class="time end" />
+                    <input type="text" class="date end" />
+                </p>
+            </div>
+
+            <pre class="code" data-language="javascript">
+var anchorExampleEl = document.getElementById('anchorExample');
+var anchorDatepair = new Datepair(anchorExampleEl, {
+    anchor: $('#anchorSelect').val()
+});
+
+$('#anchorSelect').on('change', function(){
+    anchorDatepair.option('anchor', $('#anchorSelect').val());
+});
+            </pre>
+
+            <script>
+                $('#anchorExample .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'g:ia'
+                });
+
+                $('#anchorExample .date').datepicker({
+                    'format': 'm/d/yyyy',
+                    'autoclose': true
+                });
+
+                var anchorExampleEl = document.getElementById('anchorExample');
+                var anchorDatepair = new Datepair(anchorExampleEl, {
+                    anchor: $('#anchorSelect').val()
+                });
+
+                $('#anchorSelect').on('change', function(){
+                    anchorDatepair.option('anchor', $('#anchorSelect').val());
+                });
+
+            </script>
+        </article>
+    </section>
+
+    <section>
+        <h2>Need Help?</h2>
+        <p>Check <a href="https://github.com/jonthornton/jquery-datepair#datepair-plugin-for-jquery">the documenation</a> or <a href="https://github.com/jonthornton/jquery-datepair/issues?state=open">submit an issue</a> on GitHub.</p>
+    </section>
+
+    <footer>
+        <p>&copy; 2014 <a href="http://jonthornton.com">Jon Thornton</a></p>
+    </footer>
+
+    <script>
+        (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','https://www.google-analytics.com/analytics.js','ga');
+
+        ga('create', 'UA-15605525-4', 'auto');
+        ga('send', 'pageview');
+    </script>
+
+</body>
+</html>

+ 83 - 0
app/Resources/public/assets/datepair/lib/jquery.ptTimeSelect.css

@@ -0,0 +1,83 @@
+/**
+ * FILE: jquery.ptTileSelect.css
+ * 	Default style for the timeselect container.
+ *
+ *  LAST UPDATED:
+ *
+ * 		- $Date: 2009/04/12 20:23:02 $
+ * 		- $Author: paulinho4u $
+ * 		- $Revision: 1.1 $
+ */
+#ptTimeSelectCntr {
+	width: 250px;
+	font-size: .9em;
+	position: absolute;
+	z-index: 10;
+	display: none;
+}
+#ptTimeSelectCntr .ui-widget{
+	padding: .2em;
+}
+#ptTimeSelectCntr .ui-widget-header {
+	padding: .2em;
+}
+#ptTimeSelectCntr #ptTimeSelectUserTime {
+	font-size: larger;
+	padding: .2em;
+	padding-left: 1em;
+	text-align: center;
+}
+#ptTimeSelectCntr #ptTimeSelectCloseCntr {
+	display: block;
+	padding: .2em;
+}
+#ptTimeSelectCntr #ptTimeSelectCloseCntr a {
+	display: block;
+	padding: .2em;
+}
+#ptTimeSelectCntr .ui-widget-content {
+	 margin-top: .1em;
+	 margin-bottom: .1em;
+	 padding: .2em;
+}
+#ptTimeSelectCntr .ui-widget.ui-widget-content {
+	margin-top: 0;
+}
+#ptTimeSelectCntr .ptTimeSelectLeftPane.ui-widget-content {
+	border-top:none;
+	border-bottom:none;
+	border-left:none;
+	border-right-width: 2px;
+}
+#ptTimeSelectCntr .ptTimeSelectRightPane.ui-widget-content {
+	border: none;
+}
+#ptTimeSelectCntr .ptTimeSelectHrCntr a,
+#ptTimeSelectCntr .ptTimeSelectMinCntr a {
+	display: block;
+	float: left;
+	padding: .2em;
+	width: 1.9em;
+	margin: 1px;
+	text-align: center;
+	text-decoration: none;
+}
+#ptTimeSelectCntr .ptTimeSelectHrAmPmCntr a {
+	text-align: center;
+	margin: 1px;
+}
+#ptTimeSelectCntr .ptTimeSelectTimeLabelsCntr {
+	font-weight: bold;
+	font-size: .9em;
+}
+#ptTimeSelectCntr #ptTimeSelectSetButton {
+	padding-top: .2em;
+	padding-bottom: .2em;
+}
+#ptTimeSelectCntr #ptTimeSelectSetButton a {
+ 	display: block;
+	padding: .2em;
+	width: 30%;
+	text-align: center;
+	float: right;
+}

+ 478 - 0
app/Resources/public/assets/datepair/lib/jquery.ptTimeSelect.js

@@ -0,0 +1,478 @@
+/**
+ * FILE: jQuery.ptTileSelect.js
+ *
+ * @fileOverview
+ * jQuery plugin for displaying a popup that allows a user
+ * to define a time and set that time back to a form's input
+ * field.
+ *
+ * @version 0.8
+ * @author  Paul Tavares, www.purtuga.com
+ * @see     http://pttimeselect.sourceforge.net
+ *
+ * @requires jQuery {@link http://www.jquery.com}
+ *
+ *
+ * LICENSE:
+ *
+ *  Copyright (c) 2007 Paul T. (purtuga.com)
+ *  Dual licensed under the:
+ *
+ *  -   MIT
+ *      <http://www.opensource.org/licenses/mit-license.php>
+ *
+ *  -   GPL
+ *      <http://www.opensource.org/licenses/gpl-license.php>
+ *
+ *  User can pick whichever one applies best for their project
+ *  and doesn not have to contact me.
+ *
+ *
+ * INSTALLATION:
+ *
+ * There are two files (.css and .js) delivered with this plugin and
+ * that must be included in your html page after the jquery.js library
+ * and the jQuery UI style sheet (the jQuery UI javascript library is
+ * not necessary).
+ * Both of these are to be included inside of the 'head' element of
+ * the document. Example below demonstrates this along side the jQuery
+ * libraries.
+ *
+ * |    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
+ * |    <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/themes/redmond/jquery-ui.css" />
+ * |
+ * |    <link rel="stylesheet" type="text/css" href="jquery.ptTimeSelect.css" />
+ * |    <script type="text/javascript" src="jquery.ptTimeSelect.js"></script>
+ * |
+ *
+ * USAGE:
+ *
+ *     -    See <$(ele).ptTimeSelect()>
+ *
+ *
+ *
+ * LAST UPDATED:
+ *
+ *         - $Date: 2012/08/05 19:40:21 $
+ *         - $Author: paulinho4u $
+ *         - $Revision: 1.8 $
+ *
+ */
+
+(function($){
+
+    /**
+     *  jQuery definition
+     *
+     *  @see    http://jquery.com/
+     *  @name   jQuery
+     *  @class  jQuery Library
+     */
+
+    /**
+     * jQuery 'fn' definition to anchor all public plugin methods.
+     *
+     * @see         http://jquery.com/
+     * @name        fn
+     * @class       jQuery Library public method anchor
+     * @memberOf    jQuery
+     */
+
+    /**
+     *  Namespace for all properties and methods
+     *
+     *  @namespace   ptTimeSelect
+     *  @memberOf    jQuery
+     */
+    jQuery.ptTimeSelect         = {};
+    jQuery.ptTimeSelect.version = "__BUILD_VERSION_NUMBER__";
+
+    /**
+     * The default options for all calls to ptTimeSelect. Can be
+     * overwriten with each individual call to {@link jQuery.fn.ptTimeSelect}
+     *
+     * @type {Object} options
+     * @memberOf jQuery.ptTimeSelect
+     * @see jQuery.fn.ptTimeSelect
+     */
+    jQuery.ptTimeSelect.options = {
+        containerClass: undefined,
+        containerWidth: '22em',
+        hoursLabel:     'Hour',
+        minutesLabel:   'Minutes',
+        setButtonLabel: 'Set',
+        popupImage:     undefined,
+        onFocusDisplay: true,
+        zIndex:         10,
+        onBeforeShow:   undefined,
+        onClose:        undefined
+    };
+
+    /**
+     * Internal method. Called when page is initialized to add the time
+     * selection area to the DOM.
+     *
+     * @private
+     * @memberOf jQuery.ptTimeSelect
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect._ptTimeSelectInit = function () {
+        jQuery(document).ready(
+            function () {
+                //if the html is not yet created in the document, then do it now
+                if (!jQuery('#ptTimeSelectCntr').length) {
+                    jQuery("body").append(
+                            '<div id="ptTimeSelectCntr" class="">'
+                        +    '        <div class="ui-widget ui-widget-content ui-corner-all">'
+                        +    '        <div class="ui-widget-header ui-corner-all">'
+                        +    '            <div id="ptTimeSelectCloseCntr" style="float: right;">'
+                        +    '                <a href="javascript: void(0);" onclick="jQuery.ptTimeSelect.closeCntr();" '
+                        +    '                        onmouseover="jQuery(this).removeClass(\'ui-state-default\').addClass(\'ui-state-hover\');" '
+                        +    '                        onmouseout="jQuery(this).removeClass(\'ui-state-hover\').addClass(\'ui-state-default\');"'
+                        +    '                        class="ui-corner-all ui-state-default">'
+                        +    '                    <span class="ui-icon ui-icon-circle-close">X</span>'
+                        +    '                </a>'
+                        +    '            </div>'
+                        +    '            <div id="ptTimeSelectUserTime" style="float: left;">'
+                        +    '                <span id="ptTimeSelectUserSelHr">1</span> : '
+                        +    '                <span id="ptTimeSelectUserSelMin">00</span> '
+                        +    '                <span id="ptTimeSelectUserSelAmPm">AM</span>'
+                        +    '            </div>'
+                        +    '            <br style="clear: both;" /><div></div>'
+                        +    '        </div>'
+                        +    '        <div class="ui-widget-content ui-corner-all">'
+                        +    '            <div>'
+                        +    '                <div class="ptTimeSelectTimeLabelsCntr">'
+                        +    '                    <div class="ptTimeSelectLeftPane" style="width: 50%; text-align: center; float: left;" class="">Hour</div>'
+                        +    '                    <div class="ptTimeSelectRightPane" style="width: 50%; text-align: center; float: left;">Minutes</div>'
+                        +    '                </div>'
+                        +    '                <div>'
+                        +    '                    <div style="float: left; width: 50%;">'
+                        +    '                        <div class="ui-widget-content ptTimeSelectLeftPane">'
+                        +    '                            <div class="ptTimeSelectHrAmPmCntr">'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);" '
+                        +    '                                        style="display: block; width: 45%; float: left;">AM</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);" '
+                        +    '                                        style="display: block; width: 45%; float: left;">PM</a>'
+                        +    '                                <br style="clear: left;" /><div></div>'
+                        +    '                            </div>'
+                        +    '                            <div class="ptTimeSelectHrCntr">'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">1</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">2</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">3</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">4</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">5</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">6</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">7</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">8</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">9</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">10</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">11</a>'
+                        +    '                                <a class="ptTimeSelectHr ui-state-default" href="javascript: void(0);">12</a>'
+                        +    '                                <br style="clear: left;" /><div></div>'
+                        +    '                            </div>'
+                        +    '                        </div>'
+                        +    '                    </div>'
+                        +    '                    <div style="width: 50%; float: left;">'
+                        +    '                        <div class="ui-widget-content ptTimeSelectRightPane">'
+                        +    '                            <div class="ptTimeSelectMinCntr">'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">00</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">05</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">10</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">15</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">20</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">25</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">30</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">35</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">40</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">45</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">50</a>'
+                        +    '                                <a class="ptTimeSelectMin ui-state-default" href="javascript: void(0);">55</a>'
+                        +    '                                <br style="clear: left;" /><div></div>'
+                        +    '                            </div>'
+                        +    '                        </div>'
+                        +    '                    </div>'
+                        +    '                </div>'
+                        +    '            </div>'
+                        +    '            <div style="clear: left;"></div>'
+                        +    '        </div>'
+                        +    '        <div id="ptTimeSelectSetButton">'
+                        +    '            <a href="javascript: void(0);" onclick="jQuery.ptTimeSelect.setTime()"'
+                        +    '                    onmouseover="jQuery(this).removeClass(\'ui-state-default\').addClass(\'ui-state-hover\');" '
+                        +    '                        onmouseout="jQuery(this).removeClass(\'ui-state-hover\').addClass(\'ui-state-default\');"'
+                        +    '                        class="ui-corner-all ui-state-default">'
+                        +    '                SET'
+                        +    '            </a>'
+                        +    '            <br style="clear: both;" /><div></div>'
+                        +    '        </div>'
+                        +    '        <!--[if lte IE 6.5]>'
+                        +    '            <iframe style="display:block; position:absolute;top: 0;left:0;z-index:-1;'
+                        +    '                filter:Alpha(Opacity=\'0\');width:3000px;height:3000px"></iframe>'
+                        +    '        <![endif]-->'
+                        +    '    </div></div>'
+                    );
+
+                    var e = jQuery('#ptTimeSelectCntr');
+
+                    // Add the events to the functions
+                    e.find('.ptTimeSelectMin')
+                        .bind("click", function(){
+                            jQuery.ptTimeSelect.setMin($(this).text());
+                         });
+
+                    e.find('.ptTimeSelectHr')
+                        .bind("click", function(){
+                            jQuery.ptTimeSelect.setHr($(this).text());
+                         });
+
+                    $(document).mousedown(jQuery.ptTimeSelect._doCheckMouseClick);
+                }//end if
+            }
+        );
+    }();// jQuery.ptTimeSelectInit()
+
+
+    /**
+     * Sets the hour selected by the user on the popup.
+     *
+     * @private
+     * @param  {Integer}   h   -   Interger indicating the hour. This value
+     *                      is the same as the text value displayed on the
+     *                      popup under the hour. This value can also be the
+     *                      words AM or PM.
+     * @return {undefined}
+     *
+     */
+    jQuery.ptTimeSelect.setHr = function(h) {
+        if (    h.toLowerCase() == "am"
+            ||  h.toLowerCase() == "pm"
+        ) {
+            jQuery('#ptTimeSelectUserSelAmPm').empty().append(h);
+        } else {
+            jQuery('#ptTimeSelectUserSelHr').empty().append(h);
+        }
+    };// END setHr() function
+
+    /**
+     * Sets the minutes selected by the user on the popup.
+     *
+     * @private
+     * @param {Integer}    m   - interger indicating the minutes. This
+     *          value is the same as the text value displayed on the popup
+     *          under the minutes.
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect.setMin = function(m) {
+        jQuery('#ptTimeSelectUserSelMin').empty().append(m);
+    };// END setMin() function
+
+    /**
+     * Takes the time defined by the user and sets it to the input
+     * element that the popup is currently opened for.
+     *
+     * @private
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect.setTime = function() {
+        var tSel = jQuery('#ptTimeSelectUserSelHr').text()
+                    + ":"
+                    + jQuery('#ptTimeSelectUserSelMin').text()
+                    + " "
+                    + jQuery('#ptTimeSelectUserSelAmPm').text();
+        jQuery(".isPtTimeSelectActive").val(tSel);
+        this.closeCntr();
+
+    };// END setTime() function
+
+    /**
+     * Displays the time definition area on the page, right below
+     * the input field.  Also sets the custom colors/css on the
+     * displayed area to what ever the input element options were
+     * set with.
+     *
+     * @private
+     * @param {String} uId - Id of the element for whom the area will
+     *                  be displayed. This ID was created when the
+     *                  ptTimeSelect() method was called.
+     * @return {undefined}
+     *
+     */
+    jQuery.ptTimeSelect.openCntr = function (ele) {
+        jQuery.ptTimeSelect.closeCntr();
+        jQuery(".isPtTimeSelectActive").removeClass("isPtTimeSelectActive");
+        var cntr            = jQuery("#ptTimeSelectCntr");
+        var i               = jQuery(ele).eq(0).addClass("isPtTimeSelectActive");
+        var opt             = i.data("ptTimeSelectOptions");
+        var style           = i.offset();
+        style['z-index']    = opt.zIndex;
+        style.top           = (style.top + i.outerHeight());
+        if (opt.containerWidth) {
+            style.width = opt.containerWidth;
+        }
+        if (opt.containerClass) {
+            cntr.addClass(opt.containerClass);
+        }
+        cntr.css(style);
+        var hr    = 1;
+        var min   = '00';
+        var tm    = 'AM';
+        if (i.val()) {
+            var re = /([0-9]{1,2}).*:.*([0-9]{2}).*(PM|AM)/i;
+            var match = re.exec(i.val());
+            if (match) {
+                hr    = match[1] || 1;
+                min    = match[2] || '00';
+                tm    = match[3] || 'AM';
+            }
+        }
+        cntr.find("#ptTimeSelectUserSelHr").empty().append(hr);
+        cntr.find("#ptTimeSelectUserSelMin").empty().append(min);
+        cntr.find("#ptTimeSelectUserSelAmPm").empty().append(tm);
+        cntr.find(".ptTimeSelectTimeLabelsCntr .ptTimeSelectLeftPane")
+            .empty().append(opt.hoursLabel);
+        cntr.find(".ptTimeSelectTimeLabelsCntr .ptTimeSelectRightPane")
+            .empty().append(opt.minutesLabel);
+        cntr.find("#ptTimeSelectSetButton a").empty().append(opt.setButtonLabel);
+        if (opt.onBeforeShow) {
+            opt.onBeforeShow(i, cntr);
+        }
+        cntr.slideDown("fast");
+
+    };// END openCntr()
+
+    /**
+     * Closes (hides it) the popup container.
+     * @private
+     * @param {Object} i    -   Optional. The input field for which the
+     *                          container is being closed.
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect.closeCntr = function(i) {
+        var e = $("#ptTimeSelectCntr");
+        if (e.is(":visible") == true) {
+
+            // If IE, then check to make sure it is realy visible
+            if (jQuery.support.tbody == false) {
+                if (!(e[0].offsetWidth > 0) && !(e[0].offsetHeight > 0) ) {
+                    return;
+                }
+            }
+
+            jQuery('#ptTimeSelectCntr')
+                .css("display", "none")
+                .removeClass()
+                .css("width", "");
+            if (!i) {
+                i = $(".isPtTimeSelectActive");
+            }
+            if (i) {
+                var opt = i.removeClass("isPtTimeSelectActive")
+                            .data("ptTimeSelectOptions");
+                if (opt && opt.onClose) {
+                    opt.onClose(i);
+                }
+            }
+        }
+        return;
+    };//end closeCntr()
+
+    /**
+     * Closes the timePicker popup if user is not longer focused on the
+     * input field or the timepicker
+     *
+     * @private
+     * @param {jQueryEvent} ev -    Event passed in by jQuery
+     * @return {undefined}
+     */
+    jQuery.ptTimeSelect._doCheckMouseClick = function(ev){
+        if (!$("#ptTimeSelectCntr:visible").length) {
+            return;
+        }
+        if (   !jQuery(ev.target).closest("#ptTimeSelectCntr").length
+            && jQuery(ev.target).not("input.isPtTimeSelectActive").length ){
+            jQuery.ptTimeSelect.closeCntr();
+        }
+
+    };// jQuery.ptTimeSelect._doCheckMouseClick
+
+    /**
+     * FUNCTION: $().ptTimeSelect()
+     * Attaches a ptTimeSelect widget to each matched element. Matched
+     * elements must be input fields that accept a values (input field).
+     * Each element, when focused upon, will display a time selection
+     * popoup where the user can define a time.
+     *
+     * @memberOf jQuery
+     *
+     * PARAMS:
+     *
+     * @param {Object}      [opt] - An object with the options for the time selection widget.
+     *
+     * @param {String}      [opt.containerClass=""] - A class to be associated with the popup widget.
+     *
+     * @param {String}      [opt.containerWidth=""] - Css width for the container.
+     *
+     * @param {String}      [opt.hoursLabel="Hours"] - Label for the Hours.
+     *
+     * @param {String}      [opt.minutesLabel="Minutes"] - Label for the Mintues container.
+     *
+     * @param {String}      [opt.setButtonLabel="Set"] - Label for the Set button.
+     *
+     * @param {String}      [opt.popupImage=""] - The html element (ex. img or text) to be appended next to each
+     *      input field and that will display the time select widget upon
+     *      click.
+     *
+     * @param {Integer}     [opt.zIndex=10] - Integer for the popup widget z-index.
+     *
+     * @param {Function}    [opt.onBeforeShow=undefined] - Function to be called before the widget is made visible to the
+     *      user. Function is passed 2 arguments: 1) the input field as a
+     *      jquery object and 2) the popup widget as a jquery object.
+     *
+     * @param {Function}    [opt.onClose=undefined] - Function to be called after closing the popup widget. Function
+     *      is passed 1 argument: the input field as a jquery object.
+     *
+     * @param {Bollean}     [opt.onFocusDisplay=true] - True or False indicating if popup is auto displayed upon focus
+     *      of the input field.
+     *
+     *
+     * RETURN:
+     * @return {jQuery} selection
+     *
+     *
+     *
+     * EXAMPLE:
+     * @example
+     *  $('#fooTime').ptTimeSelect();
+     *
+     */
+    jQuery.fn.ptTimeSelect = function (opt) {
+        return this.each(function(){
+            if(this.nodeName.toLowerCase() != 'input') return;
+            var e = jQuery(this);
+            if (e.hasClass('hasPtTimeSelect')){
+                return this;
+            }
+            var thisOpt = {};
+            thisOpt = $.extend(thisOpt, jQuery.ptTimeSelect.options, opt);
+            e.addClass('hasPtTimeSelect').data("ptTimeSelectOptions", thisOpt);
+
+            //Wrap the input field in a <div> element with
+            // a unique id for later referencing.
+            if (thisOpt.popupImage || !thisOpt.onFocusDisplay) {
+                var img = jQuery('<span>&nbsp;</span><a href="javascript:" onclick="' +
+                        'jQuery.ptTimeSelect.openCntr(jQuery(this).data(\'ptTimeSelectEle\'));">' +
+                        thisOpt.popupImage + '</a>'
+                    )
+                    .data("ptTimeSelectEle", e);
+                e.after(img);
+            }
+            if (thisOpt.onFocusDisplay){
+                e.focus(function(){
+                    jQuery.ptTimeSelect.openCntr(this);
+                });
+            }
+            return this;
+        });
+    };// End of jQuery.fn.ptTimeSelect
+
+})(jQuery);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 5 - 0
app/Resources/public/assets/datepair/lib/moment.min.js


+ 173 - 0
app/Resources/public/assets/datepair/lib/pikaday.css

@@ -0,0 +1,173 @@
+@charset "UTF-8";
+
+/*!
+ * Pikaday
+ * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/
+ */
+
+.pika-single {
+    z-index: 9999;
+    display: block;
+    position: relative;
+    width: 240px;
+    padding: 8px;
+    color: #333;
+    background: #fff;
+    border: 1px solid #ccc;
+    border-bottom-color: #bbb;
+    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+}
+
+.pika-single.is-hidden {
+    display: none;
+}
+
+.pika-single.is-bound {
+    position: absolute;
+    box-shadow: 0 5px 15px -5px rgba(0,0,0,.5);
+}
+
+.pika-title {
+    position: relative;
+    text-align: center;
+}
+
+.pika-label {
+    display: inline-block;
+    *display: inline;
+    position: relative;
+    z-index: 9999;
+    overflow: hidden;
+    margin: 0;
+    padding: 5px 3px;
+    font-size: 14px;
+    line-height: 20px;
+    font-weight: bold;
+    background-color: #fff;
+}
+.pika-title select {
+    cursor: pointer;
+    position: absolute;
+    z-index: 9998;
+    margin: 0;
+    left: 0;
+    top: 5px;
+    filter: alpha(opacity=0);
+    opacity: 0;
+}
+
+.pika-prev,
+.pika-next {
+    display: block;
+    cursor: pointer;
+    position: relative;
+    outline: none;
+    border: 0;
+    padding: 0;
+    width: 20px;
+    height: 30px;
+    /* hide text using text-indent trick, using width value (it's enough) */
+    text-indent: 20px;
+    white-space: nowrap;
+    overflow: hidden;
+    background-color: transparent;
+    background-position: center center;
+    background-repeat: no-repeat;
+    background-size: 75% 75%;
+    opacity: .5;
+    *position: absolute;
+    *top: 0;
+}
+
+.pika-prev:hover,
+.pika-next:hover {
+    opacity: 1;
+}
+
+.pika-prev,
+.is-rtl .pika-next {
+    float: left;
+    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==');
+    *left: 0;
+}
+
+.pika-next,
+.is-rtl .pika-prev {
+    float: right;
+    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=');
+    *right: 0;
+}
+
+.pika-prev.is-disabled,
+.pika-next.is-disabled {
+    cursor: default;
+    opacity: .2;
+}
+
+.pika-select {
+    display: inline-block;
+    *display: inline;
+}
+
+.pika-table {
+    width: 100%;
+    border-collapse: collapse;
+    border-spacing: 0;
+    border: 0;
+}
+
+.pika-table th,
+.pika-table td {
+    width: 14.285714285714286%;
+    padding: 0;
+}
+
+.pika-table th {
+    color: #999;
+    font-size: 12px;
+    line-height: 25px;
+    font-weight: bold;
+    text-align: center;
+}
+
+.pika-button {
+    cursor: pointer;
+    display: block;
+    outline: none;
+    border: 0;
+    margin: 0;
+    width: 100%;
+    padding: 5px;
+    color: #666;
+    font-size: 12px;
+    line-height: 15px;
+    text-align: right;
+    background: #f5f5f5;
+}
+
+.is-today .pika-button {
+    color: #33aaff;
+    font-weight: bold;
+}
+
+.is-selected .pika-button {
+    color: #fff;
+    font-weight: bold;
+    background: #33aaff;
+    box-shadow: inset 0 1px 3px #178fe5;
+    border-radius: 3px;
+}
+
+.is-disabled .pika-button {
+    pointer-events: none;
+    cursor: default;
+    color: #999;
+    opacity: .3;
+}
+
+.pika-button:hover {
+    color: #fff !important;
+    background: #ff8000 !important;
+    box-shadow: none !important;
+    border-radius: 3px !important;
+}

+ 973 - 0
app/Resources/public/assets/datepair/lib/pikaday.js

@@ -0,0 +1,973 @@
+/*!
+ * Pikaday
+ *
+ * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
+ */
+
+(function (root, factory)
+{
+    'use strict';
+
+    var moment;
+    if (typeof exports === 'object') {
+        // CommonJS module
+        // Load moment.js as an optional dependency
+        try { moment = require('moment'); } catch (e) {}
+        module.exports = factory(moment);
+    } else if (typeof define === 'function' && define.amd) {
+        // AMD. Register as an anonymous module.
+        define(function (req)
+        {
+            // Load moment.js as an optional dependency
+            var id = 'moment';
+            moment = req.defined && req.defined(id) ? req(id) : undefined;
+            return factory(moment);
+        });
+    } else {
+        root.Pikaday = factory(root.moment);
+    }
+}(this, function (moment)
+{
+    'use strict';
+
+    /**
+     * feature detection and helper functions
+     */
+    var hasMoment = typeof moment === 'function',
+
+    hasEventListeners = !!window.addEventListener,
+
+    document = window.document,
+
+    sto = window.setTimeout,
+
+    addEvent = function(el, e, callback, capture)
+    {
+        if (hasEventListeners) {
+            el.addEventListener(e, callback, !!capture);
+        } else {
+            el.attachEvent('on' + e, callback);
+        }
+    },
+
+    removeEvent = function(el, e, callback, capture)
+    {
+        if (hasEventListeners) {
+            el.removeEventListener(e, callback, !!capture);
+        } else {
+            el.detachEvent('on' + e, callback);
+        }
+    },
+
+    fireEvent = function(el, eventName, data)
+    {
+        var ev;
+
+        if (document.createEvent) {
+            ev = document.createEvent('HTMLEvents');
+            ev.initEvent(eventName, true, false);
+            ev = extend(ev, data);
+            el.dispatchEvent(ev);
+        } else if (document.createEventObject) {
+            ev = document.createEventObject();
+            ev = extend(ev, data);
+            el.fireEvent('on' + eventName, ev);
+        }
+    },
+
+    trim = function(str)
+    {
+        return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,'');
+    },
+
+    hasClass = function(el, cn)
+    {
+        return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;
+    },
+
+    addClass = function(el, cn)
+    {
+        if (!hasClass(el, cn)) {
+            el.className = (el.className === '') ? cn : el.className + ' ' + cn;
+        }
+    },
+
+    removeClass = function(el, cn)
+    {
+        el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));
+    },
+
+    isArray = function(obj)
+    {
+        return (/Array/).test(Object.prototype.toString.call(obj));
+    },
+
+    isDate = function(obj)
+    {
+        return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());
+    },
+
+    isLeapYear = function(year)
+    {
+        // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951
+        return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
+    },
+
+    getDaysInMonth = function(year, month)
+    {
+        return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
+    },
+
+    setToStartOfDay = function(date)
+    {
+        if (isDate(date)) date.setHours(0,0,0,0);
+    },
+
+    compareDates = function(a,b)
+    {
+        // weak date comparison (use setToStartOfDay(date) to ensure correct result)
+        return a.getTime() === b.getTime();
+    },
+
+    extend = function(to, from, overwrite)
+    {
+        var prop, hasProp;
+        for (prop in from) {
+            hasProp = to[prop] !== undefined;
+            if (hasProp && typeof from[prop] === 'object' && from[prop].nodeName === undefined) {
+                if (isDate(from[prop])) {
+                    if (overwrite) {
+                        to[prop] = new Date(from[prop].getTime());
+                    }
+                }
+                else if (isArray(from[prop])) {
+                    if (overwrite) {
+                        to[prop] = from[prop].slice(0);
+                    }
+                } else {
+                    to[prop] = extend({}, from[prop], overwrite);
+                }
+            } else if (overwrite || !hasProp) {
+                to[prop] = from[prop];
+            }
+        }
+        return to;
+    },
+
+
+    /**
+     * defaults and localisation
+     */
+    defaults = {
+
+        // bind the picker to a form field
+        field: null,
+
+        // automatically show/hide the picker on `field` focus (default `true` if `field` is set)
+        bound: undefined,
+
+        // position of the datepicker, relative to the field (default to bottom & left)
+        // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)
+        position: 'bottom left',
+
+        // the default output format for `.toString()` and `field` value
+        format: 'YYYY-MM-DD',
+
+        // the initial date to view when first opened
+        defaultDate: null,
+
+        // make the `defaultDate` the initial selected value
+        setDefaultDate: false,
+
+        // first day of week (0: Sunday, 1: Monday etc)
+        firstDay: 0,
+
+        // the minimum/earliest date that can be selected
+        minDate: null,
+        // the maximum/latest date that can be selected
+        maxDate: null,
+
+        // number of years either side, or array of upper/lower range
+        yearRange: 10,
+
+        // used internally (don't config outside)
+        minYear: 0,
+        maxYear: 9999,
+        minMonth: undefined,
+        maxMonth: undefined,
+
+        isRTL: false,
+
+        // Additional text to append to the year in the calendar title
+        yearSuffix: '',
+
+        // Render the month after year in the calendar title
+        showMonthAfterYear: false,
+
+        // how many months are visible (not implemented yet)
+        numberOfMonths: 1,
+
+        // internationalization
+        i18n: {
+            previousMonth : 'Previous Month',
+            nextMonth     : 'Next Month',
+            months        : ['January','February','March','April','May','June','July','August','September','October','November','December'],
+            weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
+            weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
+        },
+
+        // callback function
+        onSelect: null,
+        onOpen: null,
+        onClose: null,
+        onDraw: null
+    },
+
+
+    /**
+     * templating functions to abstract HTML rendering
+     */
+    renderDayName = function(opts, day, abbr)
+    {
+        day += opts.firstDay;
+        while (day >= 7) {
+            day -= 7;
+        }
+        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
+    },
+
+    renderDay = function(i, isSelected, isToday, isDisabled, isEmpty)
+    {
+        if (isEmpty) {
+            return '<td class="is-empty"></td>';
+        }
+        var arr = [];
+        if (isDisabled) {
+            arr.push('is-disabled');
+        }
+        if (isToday) {
+            arr.push('is-today');
+        }
+        if (isSelected) {
+            arr.push('is-selected');
+        }
+        return '<td data-day="' + i + '" class="' + arr.join(' ') + '"><button class="pika-button" type="button">' + i + '</button>' + '</td>';
+    },
+
+    renderRow = function(days, isRTL)
+    {
+        return '<tr>' + (isRTL ? days.reverse() : days).join('') + '</tr>';
+    },
+
+    renderBody = function(rows)
+    {
+        return '<tbody>' + rows.join('') + '</tbody>';
+    },
+
+    renderHead = function(opts)
+    {
+        var i, arr = [];
+        for (i = 0; i < 7; i++) {
+            arr.push('<th scope="col"><abbr title="' + renderDayName(opts, i) + '">' + renderDayName(opts, i, true) + '</abbr></th>');
+        }
+        return '<thead>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</thead>';
+    },
+
+    renderTitle = function(instance)
+    {
+        var i, j, arr,
+            opts = instance._o,
+            month = instance._m,
+            year  = instance._y,
+            isMinYear = year === opts.minYear,
+            isMaxYear = year === opts.maxYear,
+            html = '<div class="pika-title">',
+            monthHtml,
+            yearHtml,
+            prev = true,
+            next = true;
+
+        for (arr = [], i = 0; i < 12; i++) {
+            arr.push('<option value="' + i + '"' +
+                (i === month ? ' selected': '') +
+                ((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled' : '') + '>' +
+                opts.i18n.months[i] + '</option>');
+        }
+        monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month">' + arr.join('') + '</select></div>';
+
+        if (isArray(opts.yearRange)) {
+            i = opts.yearRange[0];
+            j = opts.yearRange[1] + 1;
+        } else {
+            i = year - opts.yearRange;
+            j = 1 + year + opts.yearRange;
+        }
+
+        for (arr = []; i < j && i <= opts.maxYear; i++) {
+            if (i >= opts.minYear) {
+                arr.push('<option value="' + i + '"' + (i === year ? ' selected': '') + '>' + (i) + '</option>');
+            }
+        }
+        yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year">' + arr.join('') + '</select></div>';
+
+        if (opts.showMonthAfterYear) {
+            html += yearHtml + monthHtml;
+        } else {
+            html += monthHtml + yearHtml;
+        }
+
+        if (isMinYear && (month === 0 || opts.minMonth >= month)) {
+            prev = false;
+        }
+
+        if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {
+            next = false;
+        }
+
+        html += '<button class="pika-prev' + (prev ? '' : ' is-disabled') + '" type="button">' + opts.i18n.previousMonth + '</button>';
+        html += '<button class="pika-next' + (next ? '' : ' is-disabled') + '" type="button">' + opts.i18n.nextMonth + '</button>';
+
+        return html += '</div>';
+    },
+
+    renderTable = function(opts, data)
+    {
+        return '<table cellpadding="0" cellspacing="0" class="pika-table">' + renderHead(opts) + renderBody(data) + '</table>';
+    },
+
+
+    /**
+     * Pikaday constructor
+     */
+    Pikaday = function(options)
+    {
+        var self = this,
+            opts = self.config(options);
+
+        self._onMouseDown = function(e)
+        {
+            if (!self._v) {
+                return;
+            }
+            e = e || window.event;
+            var target = e.target || e.srcElement;
+            if (!target) {
+                return;
+            }
+
+            if (!hasClass(target, 'is-disabled')) {
+                if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) {
+                    self.setDate(new Date(self._y, self._m, parseInt(target.innerHTML, 10)));
+                    if (opts.bound) {
+                        sto(function() {
+                            self.hide();
+                        }, 100);
+                    }
+                    return;
+                }
+                else if (hasClass(target, 'pika-prev')) {
+                    self.prevMonth();
+                }
+                else if (hasClass(target, 'pika-next')) {
+                    self.nextMonth();
+                }
+            }
+            if (!hasClass(target, 'pika-select')) {
+                if (e.preventDefault) {
+                    e.preventDefault();
+                } else {
+                    e.returnValue = false;
+                    return false;
+                }
+            } else {
+                self._c = true;
+            }
+        };
+
+        self._onChange = function(e)
+        {
+            e = e || window.event;
+            var target = e.target || e.srcElement;
+            if (!target) {
+                return;
+            }
+            if (hasClass(target, 'pika-select-month')) {
+                self.gotoMonth(target.value);
+            }
+            else if (hasClass(target, 'pika-select-year')) {
+                self.gotoYear(target.value);
+            }
+        };
+
+        self._onInputChange = function(e)
+        {
+            var date;
+
+            if (e.firedBy === self) {
+                return;
+            }
+            if (hasMoment) {
+                date = moment(opts.field.value, opts.format);
+                date = (date && date.isValid()) ? date.toDate() : null;
+            }
+            else {
+                date = new Date(Date.parse(opts.field.value));
+            }
+            self.setDate(isDate(date) ? date : null);
+            if (!self._v) {
+                self.show();
+            }
+        };
+
+        self._onInputFocus = function()
+        {
+            self.show();
+        };
+
+        self._onInputClick = function()
+        {
+            self.show();
+        };
+
+        self._onInputBlur = function()
+        {
+            if (!self._c) {
+                self._b = sto(function() {
+                    self.hide();
+                }, 50);
+            }
+            self._c = false;
+        };
+
+        self._onClick = function(e)
+        {
+            e = e || window.event;
+            var target = e.target || e.srcElement,
+                pEl = target;
+            if (!target) {
+                return;
+            }
+            if (!hasEventListeners && hasClass(target, 'pika-select')) {
+                if (!target.onchange) {
+                    target.setAttribute('onchange', 'return;');
+                    addEvent(target, 'change', self._onChange);
+                }
+            }
+            do {
+                if (hasClass(pEl, 'pika-single')) {
+                    return;
+                }
+            }
+            while ((pEl = pEl.parentNode));
+            if (self._v && target !== opts.trigger) {
+                self.hide();
+            }
+        };
+
+        self.el = document.createElement('div');
+        self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '');
+
+        addEvent(self.el, 'mousedown', self._onMouseDown, true);
+        addEvent(self.el, 'change', self._onChange);
+
+        if (opts.field) {
+            if (opts.bound) {
+                document.body.appendChild(self.el);
+            } else {
+                opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);
+            }
+            addEvent(opts.field, 'change', self._onInputChange);
+
+            if (!opts.defaultDate) {
+                if (hasMoment && opts.field.value) {
+                    opts.defaultDate = moment(opts.field.value, opts.format).toDate();
+                } else {
+                    opts.defaultDate = new Date(Date.parse(opts.field.value));
+                }
+                opts.setDefaultDate = true;
+            }
+        }
+
+        var defDate = opts.defaultDate;
+
+        if (isDate(defDate)) {
+            if (opts.setDefaultDate) {
+                self.setDate(defDate, true);
+            } else {
+                self.gotoDate(defDate);
+            }
+        } else {
+            self.gotoDate(new Date());
+        }
+
+        if (opts.bound) {
+            this.hide();
+            self.el.className += ' is-bound';
+            addEvent(opts.trigger, 'click', self._onInputClick);
+            addEvent(opts.trigger, 'focus', self._onInputFocus);
+            addEvent(opts.trigger, 'blur', self._onInputBlur);
+        } else {
+            this.show();
+        }
+
+    };
+
+
+    /**
+     * public Pikaday API
+     */
+    Pikaday.prototype = {
+
+
+        /**
+         * configure functionality
+         */
+        config: function(options)
+        {
+            if (!this._o) {
+                this._o = extend({}, defaults, true);
+            }
+
+            var opts = extend(this._o, options, true);
+
+            opts.isRTL = !!opts.isRTL;
+
+            opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;
+
+            opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);
+
+            opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;
+
+            var nom = parseInt(opts.numberOfMonths, 10) || 1;
+            opts.numberOfMonths = nom > 4 ? 4 : nom;
+
+            if (!isDate(opts.minDate)) {
+                opts.minDate = false;
+            }
+            if (!isDate(opts.maxDate)) {
+                opts.maxDate = false;
+            }
+            if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {
+                opts.maxDate = opts.minDate = false;
+            }
+            if (opts.minDate) {
+                setToStartOfDay(opts.minDate);
+                opts.minYear  = opts.minDate.getFullYear();
+                opts.minMonth = opts.minDate.getMonth();
+            }
+            if (opts.maxDate) {
+                setToStartOfDay(opts.maxDate);
+                opts.maxYear  = opts.maxDate.getFullYear();
+                opts.maxMonth = opts.maxDate.getMonth();
+            }
+
+            if (isArray(opts.yearRange)) {
+                var fallback = new Date().getFullYear() - 10;
+                opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;
+                opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;
+            } else {
+                opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;
+                if (opts.yearRange > 100) {
+                    opts.yearRange = 100;
+                }
+            }
+
+            return opts;
+        },
+
+        /**
+         * return a formatted string of the current selection (using Moment.js if available)
+         */
+        toString: function(format)
+        {
+            return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString();
+        },
+
+        /**
+         * return a Moment.js object of the current selection (if available)
+         */
+        getMoment: function()
+        {
+            return hasMoment ? moment(this._d) : null;
+        },
+
+        /**
+         * set the current selection from a Moment.js object (if available)
+         */
+        setMoment: function(date, preventOnSelect)
+        {
+            if (hasMoment && moment.isMoment(date)) {
+                this.setDate(date.toDate(), preventOnSelect);
+            }
+        },
+
+        /**
+         * return a Date object of the current selection
+         */
+        getDate: function()
+        {
+            return isDate(this._d) ? new Date(this._d.getTime()) : null;
+        },
+
+        /**
+         * set the current selection
+         */
+        setDate: function(date, preventOnSelect)
+        {
+            if (!date) {
+                this._d = null;
+                return this.draw();
+            }
+            if (typeof date === 'string') {
+                date = new Date(Date.parse(date));
+            }
+            if (!isDate(date)) {
+                return;
+            }
+
+            var min = this._o.minDate,
+                max = this._o.maxDate;
+
+            if (isDate(min) && date < min) {
+                date = min;
+            } else if (isDate(max) && date > max) {
+                date = max;
+            }
+
+            this._d = new Date(date.getTime());
+            setToStartOfDay(this._d);
+            this.gotoDate(this._d);
+
+            if (this._o.field) {
+                this._o.field.value = this.toString();
+                fireEvent(this._o.field, 'change', { firedBy: this });
+            }
+            if (!preventOnSelect && typeof this._o.onSelect === 'function') {
+                this._o.onSelect.call(this, this.getDate());
+            }
+        },
+
+        /**
+         * change view to a specific date
+         */
+        gotoDate: function(date)
+        {
+            if (!isDate(date)) {
+                return;
+            }
+            this._y = date.getFullYear();
+            this._m = date.getMonth();
+            this.draw();
+        },
+
+        gotoToday: function()
+        {
+            this.gotoDate(new Date());
+        },
+
+        /**
+         * change view to a specific month (zero-index, e.g. 0: January)
+         */
+        gotoMonth: function(month)
+        {
+            if (!isNaN( (month = parseInt(month, 10)) )) {
+                this._m = month < 0 ? 0 : month > 11 ? 11 : month;
+                this.draw();
+            }
+        },
+
+        nextMonth: function()
+        {
+            if (++this._m > 11) {
+                this._m = 0;
+                this._y++;
+            }
+            this.draw();
+        },
+
+        prevMonth: function()
+        {
+            if (--this._m < 0) {
+                this._m = 11;
+                this._y--;
+            }
+            this.draw();
+        },
+
+        /**
+         * change view to a specific full year (e.g. "2012")
+         */
+        gotoYear: function(year)
+        {
+            if (!isNaN(year)) {
+                this._y = parseInt(year, 10);
+                this.draw();
+            }
+        },
+
+        /**
+         * change the minDate
+         */
+        setMinDate: function(value)
+        {
+            this._o.minDate = value;
+        },
+
+        /**
+         * change the maxDate
+         */
+        setMaxDate: function(value)
+        {
+            this._o.maxDate = value;
+        },
+
+        /**
+         * refresh the HTML
+         */
+        draw: function(force)
+        {
+            if (!this._v && !force) {
+                return;
+            }
+            var opts = this._o,
+                minYear = opts.minYear,
+                maxYear = opts.maxYear,
+                minMonth = opts.minMonth,
+                maxMonth = opts.maxMonth;
+
+            if (this._y <= minYear) {
+                this._y = minYear;
+                if (!isNaN(minMonth) && this._m < minMonth) {
+                    this._m = minMonth;
+                }
+            }
+            if (this._y >= maxYear) {
+                this._y = maxYear;
+                if (!isNaN(maxMonth) && this._m > maxMonth) {
+                    this._m = maxMonth;
+                }
+            }
+
+            this.el.innerHTML = renderTitle(this) + this.render(this._y, this._m);
+
+            if (opts.bound) {
+                this.adjustPosition();
+                if(opts.field.type !== 'hidden') {
+                    sto(function() {
+                        opts.trigger.focus();
+                    }, 1);
+                }
+            }
+
+            if (typeof this._o.onDraw === 'function') {
+                var self = this;
+                sto(function() {
+                    self._o.onDraw.call(self);
+                }, 0);
+            }
+        },
+
+        adjustPosition: function()
+        {
+            var field = this._o.trigger, pEl = field,
+            width = this.el.offsetWidth, height = this.el.offsetHeight,
+            viewportWidth = window.innerWidth || document.documentElement.clientWidth,
+            viewportHeight = window.innerHeight || document.documentElement.clientHeight,
+            scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop,
+            left, top, clientRect;
+
+            if (typeof field.getBoundingClientRect === 'function') {
+                clientRect = field.getBoundingClientRect();
+                left = clientRect.left + window.pageXOffset;
+                top = clientRect.bottom + window.pageYOffset;
+            } else {
+                left = pEl.offsetLeft;
+                top  = pEl.offsetTop + pEl.offsetHeight;
+                while((pEl = pEl.offsetParent)) {
+                    left += pEl.offsetLeft;
+                    top  += pEl.offsetTop;
+                }
+            }
+
+            // default position is bottom & left
+            if (left + width > viewportWidth ||
+                (
+                    this._o.position.indexOf('right') > -1 &&
+                    left - width + field.offsetWidth > 0
+                )
+            ) {
+                left = left - width + field.offsetWidth;
+            }
+            if (top + height > viewportHeight + scrollTop ||
+                (
+                    this._o.position.indexOf('top') > -1 &&
+                    top - height - field.offsetHeight > 0
+                )
+            ) {
+                top = top - height - field.offsetHeight;
+            }
+            this.el.style.cssText = [
+                'position: absolute',
+                'left: ' + left + 'px',
+                'top: ' + top + 'px'
+            ].join(';');
+        },
+
+        /**
+         * render HTML for a particular month
+         */
+        render: function(year, month)
+        {
+            var opts   = this._o,
+                now    = new Date(),
+                days   = getDaysInMonth(year, month),
+                before = new Date(year, month, 1).getDay(),
+                data   = [],
+                row    = [];
+            setToStartOfDay(now);
+            if (opts.firstDay > 0) {
+                before -= opts.firstDay;
+                if (before < 0) {
+                    before += 7;
+                }
+            }
+            var cells = days + before,
+                after = cells;
+            while(after > 7) {
+                after -= 7;
+            }
+            cells += 7 - after;
+            for (var i = 0, r = 0; i < cells; i++)
+            {
+                var day = new Date(year, month, 1 + (i - before)),
+                    isDisabled = (opts.minDate && day < opts.minDate) || (opts.maxDate && day > opts.maxDate),
+                    isSelected = isDate(this._d) ? compareDates(day, this._d) : false,
+                    isToday = compareDates(day, now),
+                    isEmpty = i < before || i >= (days + before);
+
+                row.push(renderDay(1 + (i - before), isSelected, isToday, isDisabled, isEmpty));
+
+                if (++r === 7) {
+                    data.push(renderRow(row, opts.isRTL));
+                    row = [];
+                    r = 0;
+                }
+            }
+            return renderTable(opts, data);
+        },
+
+        isVisible: function()
+        {
+            return this._v;
+        },
+
+        show: function()
+        {
+            if (!this._v) {
+                if (this._o.bound) {
+                    addEvent(document, 'click', this._onClick);
+                }
+                removeClass(this.el, 'is-hidden');
+                this._v = true;
+                this.draw();
+                if (typeof this._o.onOpen === 'function') {
+                    this._o.onOpen.call(this);
+                }
+            }
+        },
+
+        hide: function()
+        {
+            var v = this._v;
+            if (v !== false) {
+                if (this._o.bound) {
+                    removeEvent(document, 'click', this._onClick);
+                }
+                this.el.style.cssText = '';
+                addClass(this.el, 'is-hidden');
+                this._v = false;
+                if (v !== undefined && typeof this._o.onClose === 'function') {
+                    this._o.onClose.call(this);
+                }
+            }
+        },
+
+        /**
+         * GAME OVER
+         */
+        destroy: function()
+        {
+            this.hide();
+            removeEvent(this.el, 'mousedown', this._onMouseDown, true);
+            removeEvent(this.el, 'change', this._onChange);
+            if (this._o.field) {
+                removeEvent(this._o.field, 'change', this._onInputChange);
+                if (this._o.bound) {
+                    removeEvent(this._o.trigger, 'click', this._onInputClick);
+                    removeEvent(this._o.trigger, 'focus', this._onInputFocus);
+                    removeEvent(this._o.trigger, 'blur', this._onInputBlur);
+                }
+            }
+            if (this.el.parentNode) {
+                this.el.parentNode.removeChild(this.el);
+            }
+        }
+
+    };
+
+    return Pikaday;
+
+}));
+
+/*!
+ * Pikaday jQuery plugin.
+ *
+ * Copyright © 2013 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
+ */
+
+(function (root, factory)
+{
+    'use strict';
+
+    if (typeof exports === 'object') {
+        // CommonJS module
+        factory(require('jquery'), require('../pikaday'));
+    } else if (typeof define === 'function' && define.amd) {
+        // AMD. Register as an anonymous module.
+        define(['jquery', 'pikaday'], factory);
+    } else {
+        // Browser globals
+        factory(root.jQuery, root.Pikaday);
+    }
+}(this, function ($, Pikaday)
+{
+    'use strict';
+
+    $.fn.pikaday = function()
+    {
+        var args = arguments;
+
+        if (!args || !args.length) {
+            args = [{ }];
+        }
+
+        return this.each(function()
+        {
+            var self   = $(this),
+                plugin = self.data('pikaday');
+
+            if (!(plugin instanceof Pikaday)) {
+                if (typeof args[0] === 'object') {
+                    var options = $.extend({}, args[0]);
+                    options.field = self[0];
+                    self.data('pikaday', new Pikaday(options));
+                }
+            } else {
+                if (typeof args[0] === 'string' && typeof plugin[args[0]] === 'function') {
+                    plugin[args[0]].apply(plugin, Array.prototype.slice.call(args,1));
+                }
+            }
+        });
+    };
+
+}));

+ 200 - 0
app/Resources/public/assets/datepair/lib/site.css

@@ -0,0 +1,200 @@
+body {
+    background: #015;
+    color: #bbb;
+    font-family: helvetica, arial, sans-serif;
+    font-size: 15px;
+    line-height: 1.3;
+    margin: 0;
+    padding: 0;
+}
+
+header,
+section,
+footer {
+    padding: 20px;
+}
+
+header,
+footer {
+    background: #111;
+    color: #666;
+    position: relative;
+}
+
+header h1 {
+    margin: 0;
+    padding: 0;
+}
+
+header h1 a {
+    font-family: Lucida Sans Unicode, Lucida Grande, sans-serif;
+    font-size: 60px;
+    font-weight: 200;
+    text-decoration: none;
+}
+
+header p {
+    font-size: 23px;
+}
+
+#header-links {
+    margin: 0;
+    padding: 0;
+    list-style: none;
+    position: absolute;
+    right: 20px;
+    top: 30px;
+    text-align: right;
+}
+
+#header-links a {
+    color: #888;
+}
+
+#header-links a:hover {
+    color: #06c;
+}
+
+h2 {
+    color: #eee;
+    font-size: 35px;
+    font-weight: normal;
+    margin: 0;
+    line-height: 1.1
+}
+
+p {
+    margin: 20px 0 0 0;
+}
+
+p:first-child {
+    margin-top: 0;
+}
+
+input {
+    font-size: 13px;
+    -webkit-border-radius: 3px;
+    -moz-border-radius: 5px;
+    border-radius: 5px;
+    padding: 3px;
+    background: #dde;
+    border: 1px solid #aac;
+}
+
+input.time {
+    width: 80px;
+}
+
+input.date {
+    width: 90px;
+}
+
+a {
+    color: #06c;
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+image {
+    border: 0;
+}
+
+#examples article {
+    padding-top: 100px;
+    clear: both;
+}
+
+#examples article:first-child {
+    padding-top: 0;
+}
+
+#examples .demo {
+    width: 450px;
+    float: left;
+}
+
+#examples .code {
+    font-size: 12px;
+    margin: 0 0 0 470px;
+}
+
+footer {
+    font-size: 12px;
+}
+
+div.ui-datepicker { font-size: 11px; }
+
+#alternateUiWidgetsExample .date { width: 120px; }
+
+/**
+ * Blackboard theme
+ *
+ * Adapted from Domenico Carbotta's TextMate theme of the same name
+ *
+ * @author Domenico Carbotta
+ * @author Craig Campbell
+ * @version 1.0.2
+ */
+pre {
+    background: #0B1022;
+    word-wrap: break-word;
+    margin: 0px;
+    padding: 0px;
+    padding: 10px;
+    color: #fff;
+    font-size: 12px;
+    margin: 0;
+    overflow-y: auto;
+    -webkit-border-radius: 8px;
+    -moz-border-radius: 8px;
+    border-radius: 8px;
+}
+
+pre, code {
+    font-family: Consolas, 'Monaco', courier, monospace;
+}
+
+pre .comment {
+    color: #727272;
+}
+
+pre .constant {
+    color: #D8FA3C;
+}
+
+pre .storage {
+    color: #FBDE2D;
+}
+
+pre .string, pre .comment.docstring {
+    color: #61CE3C;
+}
+
+pre .string.regexp, pre .support.tag.script, pre .support.tag.style {
+    color: #fff;
+}
+
+pre .keyword, pre .selector {
+    color: #FBDE2D;
+}
+
+pre .inherited-class {
+    font-style: italic;
+}
+
+pre .entity {
+    color: #FF6400;
+}
+
+pre .support, *[data-language="c"] .function.call {
+    color: #8DA6CE;
+}
+
+pre .variable.global, pre .variable.class, pre .variable.instance {
+    color: #FF6400;
+}
+
+

+ 10 - 0
app/Resources/public/assets/datepair/lib/site.js

@@ -0,0 +1,10 @@
+/* Rainbow v1.1.8 rainbowco.de | included languages: generic, javascript */
+window.Rainbow=function(){function q(a){var b,c=a.getAttribute&&a.getAttribute("data-language")||0;if(!c){a=a.attributes;for(b=0;b<a.length;++b)if("data-language"===a[b].nodeName)return a[b].nodeValue}return c}function B(a){var b=q(a)||q(a.parentNode);if(!b){var c=/\blang(?:uage)?-(\w+)/;(a=a.className.match(c)||a.parentNode.className.match(c))&&(b=a[1])}return b}function C(a,b){for(var c in e[d]){c=parseInt(c,10);if(a==c&&b==e[d][c]?0:a<=c&&b>=e[d][c])delete e[d][c],delete j[d][c];if(a>=c&&a<e[d][c]||
+b>c&&b<e[d][c])return!0}return!1}function r(a,b){return'<span class="'+a.replace(/\./g," ")+(l?" "+l:"")+'">'+b+"</span>"}function s(a,b,c,h){var f=a.exec(c);if(f){++t;!b.name&&"string"==typeof b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var k=f[0],i=f.index,u=f[0].length+i,g=function(){function f(){s(a,b,c,h)}t%100>0?f():setTimeout(f,0)};if(C(i,u))g();else{var m=v(b.matches),l=function(a,c,h){if(a>=c.length)h(k);else{var d=f[c[a]];if(d){var e=b.matches[c[a]],i=e.language,g=e.name&&e.matches?
+e.matches:e,j=function(b,d,e){var i;i=0;var g;for(g=1;g<c[a];++g)f[g]&&(i=i+f[g].length);d=e?r(e,d):d;k=k.substr(0,i)+k.substr(i).replace(b,d);l(++a,c,h)};i?n(d,i,function(a){j(d,a)}):typeof e==="string"?j(d,d,e):w(d,g.length?g:[g],function(a){j(d,a,e.matches?e.name:0)})}else l(++a,c,h)}};l(0,m,function(a){b.name&&(a=r(b.name,a));if(!j[d]){j[d]={};e[d]={}}j[d][i]={replace:f[0],"with":a};e[d][i]=u;g()})}}else h()}function v(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b.sort(function(a,
+b){return b-a})}function w(a,b,c){function h(b,k){k<b.length?s(b[k].pattern,b[k],a,function(){h(b,++k)}):D(a,function(a){delete j[d];delete e[d];--d;c(a)})}++d;h(b,0)}function D(a,b){function c(a,b,h,e){if(h<b.length){++x;var g=b[h],l=j[d][g],a=a.substr(0,g)+a.substr(g).replace(l.replace,l["with"]),g=function(){c(a,b,++h,e)};0<x%250?g():setTimeout(g,0)}else e(a)}var h=v(j[d]);c(a,h,0,b)}function n(a,b,c){var d=m[b]||[],f=m[y]||[],b=z[b]?d:d.concat(f);w(a.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&(?![\w\#]+;)/g,
+"&amp;"),b,c)}function o(a,b,c){if(b<a.length){var d=a[b],f=B(d);return!(-1<(" "+d.className+" ").indexOf(" rainbow "))&&f?(f=f.toLowerCase(),d.className+=d.className?" rainbow":"rainbow",n(d.innerHTML,f,function(k){d.innerHTML=k;j={};e={};p&&p(d,f);setTimeout(function(){o(a,++b,c)},0)})):o(a,++b,c)}c&&c()}function A(a,b){var a=a&&"function"==typeof a.getElementsByTagName?a:document,c=a.getElementsByTagName("pre"),d=a.getElementsByTagName("code"),f,e=[];for(f=0;f<d.length;++f)e.push(d[f]);for(f=0;f<
+c.length;++f)c[f].getElementsByTagName("code").length||e.push(c[f]);o(e,0,b)}var j={},e={},m={},z={},d=0,y=0,t=0,x=0,l,p;return{extend:function(a,b,c){1==arguments.length&&(b=a,a=y);z[a]=c;m[a]=b.concat(m[a]||[])},b:function(a){p=a},a:function(a){l=a},color:function(a,b,c){if("string"==typeof a)return n(a,b,c);if("function"==typeof a)return A(0,a);A(a,b)}}}();window.addEventListener?window.addEventListener("load",Rainbow.color,!1):window.attachEvent("onload",Rainbow.color);Rainbow.onHighlight=Rainbow.b;
+Rainbow.addClass=Rainbow.a;Rainbow.extend([{matches:{1:{name:"keyword.operator",pattern:/\=/g},2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\('|"){1}/g}}},pattern:/(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm},{name:"constant.numeric",pattern:/\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi},{matches:{1:"keyword"},pattern:/\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi},
+{name:"constant.language",pattern:/true|false|null/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g},{matches:{1:"function.call"},pattern:/(\w+?)(?=\()/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(function)\s(.*?)(?=\()/g}]);Rainbow.extend("javascript",[{name:"selector",pattern:/(\s|^)\$(?=\.|\()/g},{name:"support",pattern:/\b(window|document)\b/g},{matches:{1:"support.property"},pattern:/\.(length|node(Name|Value))\b/g},{matches:{1:"support.function"},pattern:/(setTimeout|setInterval)(?=\()/g},{matches:{1:"support.method"},pattern:/\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g},{matches:{1:"support.tag.script",2:[{name:"string",pattern:/('|")(.*?)(\1)/g},{name:"entity.tag.script",
+pattern:/(\w+)/g}],3:"support.tag.script"},pattern:/(&lt;\/?)(script.*?)(&gt;)/g},{name:"string.regexp",matches:{1:"string.regexp.open",2:{name:"constant.regexp.escape",pattern:/\\(.){1}/g},3:"string.regexp.close",4:"string.regexp.modifier"},pattern:/(\/)(?!\*)(.+)(\/)([igm]{0,3})/g},{matches:{1:"storage",3:"entity.function"},pattern:/(var)?(\s|^)(.*)(?=\s?=\s?function\()/g},{name:"entity.function",pattern:/(\w+)(?=:\s{0,}function)/g}]);

+ 24 - 0
app/Resources/public/assets/datepair/package.json

@@ -0,0 +1,24 @@
+{
+    "name": "datepair.js",
+    "description": "A javascript plugin for intelligently selecting date and time ranges inspired by Google Calendar.",
+    "homepage": "http://jonthornton.github.com/Datepair.js",
+    "version": "0.4.16",
+    "main": "dist/datepair.js",
+    "author": {
+        "name": "Jon Thornton",
+        "url": "https://github.com/jonthornton"
+    },
+    "repository": {
+        "type" : "git",
+        "url" : "https://github.com/jonthornton/Datepair.js.git"
+    },
+    "license": "MIT",
+    "devDependencies": {
+        "grunt": "~0.4.1",
+        "grunt-contrib-uglify": "~0.4.0",
+        "grunt-rigger": "~0.5.0",
+        "grunt-contrib-jshint": "^0.11.3",
+        "grunt-contrib-watch": "~0.5.1"
+    },
+    "keywords": [ "timepicker", "datepicker", "time", "date", "picker", "ui", "calendar", "input", "form" ]
+}

+ 32 - 0
app/Resources/public/assets/jt.timepicker/.bower.json

@@ -0,0 +1,32 @@
+{
+  "name": "jt.timepicker",
+  "version": "1.11.14",
+  "description": "A jQuery timepicker plugin inspired by Google Calendar.",
+  "homepage": "http://jonthornton.github.com/jquery-timepicker",
+  "main": [
+    "./jquery.timepicker.js",
+    "./jquery.timepicker.css"
+  ],
+  "dependencies": {
+    "jquery": ">= 1.7"
+  },
+  "keywords": [
+    "time",
+    "picker",
+    "google calendar"
+  ],
+  "author": {
+    "name": "Jon Thornton",
+    "web": "https://github.com/jonthornton"
+  },
+  "license": "http://opensource.org/licenses/MIT",
+  "_release": "1.11.14",
+  "_resolution": {
+    "type": "version",
+    "tag": "1.11.14",
+    "commit": "b53338cc92270da3750d5c0cc6abe60fb27a0d89"
+  },
+  "_source": "https://github.com/jonthornton/jquery-timepicker.git",
+  "_target": "*",
+  "_originalSource": "jt.timepicker"
+}

+ 3 - 0
app/Resources/public/assets/jt.timepicker/.eslintrc.json

@@ -0,0 +1,3 @@
+{
+
+}

+ 6 - 0
app/Resources/public/assets/jt.timepicker/.gitignore

@@ -0,0 +1,6 @@
+.DS_store
+*.sw*
+node_modules
+.idea
+package-lock.json
+yarn.lock

+ 41 - 0
app/Resources/public/assets/jt.timepicker/GruntFile.js

@@ -0,0 +1,41 @@
+module.exports = function(grunt) {
+
+	grunt.initConfig({
+		pkg: grunt.file.readJSON('package.json'),
+		meta: {
+			banner : '/*!\n' +
+			' * <%= pkg.title %> v<%= pkg.version %> - <%= pkg.description %>\n' +
+			' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> - <%= pkg.homepage %>\n' +
+			' * License: <%= pkg.license %>\n' +
+			' */\n\n'
+		},
+		uglify: {
+			options : {
+				banner : '<%= meta.banner %>',
+				report: 'gzip'
+			},
+			dist: {
+				files: {
+					'jquery.timepicker.min.js': ['jquery.timepicker.js']
+				}
+			}
+		},
+		cssmin: {
+			minify: {
+				files: {
+					'jquery.timepicker.min.css': ['jquery.timepicker.css']
+				}
+			}
+		},
+		jshint: {
+			all: ['jquery.timepicker.js']
+		},
+	});
+
+	grunt.loadNpmTasks('grunt-contrib-uglify');
+	grunt.loadNpmTasks('grunt-contrib-cssmin');
+	grunt.loadNpmTasks('grunt-contrib-jshint');
+
+	grunt.registerTask('default', ['uglify', 'cssmin']);
+
+};

+ 294 - 0
app/Resources/public/assets/jt.timepicker/README.md

@@ -0,0 +1,294 @@
+Timepicker Plugin for jQuery
+========================
+
+[<img src="http://jonthornton.github.com/jquery-timepicker/lib/screenshot.png" alt="timepicker screenshot" />](http://jonthornton.github.com/jquery-timepicker)
+
+[See a demo and examples here](http://jonthornton.github.com/jquery-timepicker)
+
+jquery.timepicker is a lightweight timepicker plugin for jQuery inspired by Google Calendar. It supports both mouse and keyboard navigation, and weighs in at 2.7kb minified and gzipped.
+
+Requirements
+------------
+* [jQuery](http://jquery.com/) (>= 1.7)
+
+Usage
+-----
+
+```javascript
+$('.some-time-inputs').timepicker(options);
+```
+
+Include `jquery.timepicker.css` and `jquery.timepicker.min.js` in your page.
+
+```options``` is an optional javascript object with parameters explained below.
+
+You can also set options as [data attributes](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes) on the intput elements, like ```<input type="text" data-time-format="H:i:s" />```. Timepicker still needs to be initialized by calling ```$('#someElement').timepicker(options);```. Data attributes will override any conflicting initialization options.
+
+The defaults for all options are exposed through the ```$.fn.timepicker.defaults``` object. Properties changed in this object (same properties configurable through the constructor) will take effect for every instance created after the change.
+
+Options
+-------
+
+- **appendTo**  
+Override where the dropdown is appended.  
+Takes either a `string` to use as a selector, a `function` that gets passed the clicked input element as argument or a jquery `object` to use directly.  
+*default: "body"*
+
+- **className**  
+A class name to apply to the HTML element that contains the timepicker dropdown.  
+*default: null*
+
+- **closeOnWindowScroll**  
+Close the timepicker when the window is scrolled. (Replicates ```<select>``` behavior.)  
+*default: false*
+
+- **disableTimeRanges**  
+Disable selection of certain time ranges. Input is an array of time pairs, like ```[['3:00am', '4:30am'], ['5:00pm', '8:00pm']]```. The start of the interval will be disabled but the end won't.
+*default: []*
+
+- **disableTextInput**  
+Disable typing in the timepicker input box; force users to select from list. [More information here.](https://github.com/jonthornton/jquery-timepicker/issues/425#issuecomment-133262458)  
+*default: false*
+
+- **disableTouchKeyboard**  
+Disable the onscreen keyboard for touch devices. There can be instances where Firefox or Chrome have touch events enabled (such as on Surface tablets but not actually be a touch device. In this case `disableTouchKeyboard` will prevent the timepicker input field from being focused. [More information here.](https://github.com/jonthornton/jquery-timepicker/issues/413)  
+*default: false*
+
+- **durationTime**  
+The time against which ```showDuration``` will compute relative times. If this is a function, its result will be used.  
+*default: minTime*
+
+- **forceRoundTime**  
+Force update the time to ```step``` settings as soon as it loses focus.  
+*default: false*
+
+- **lang**  
+Language constants used in the timepicker. Can override the defaults by passing an object with one or more of the following properties: decimal, mins, hr, hrs.  
+*default:* ```{
+	am: 'am',
+	pm: 'pm',
+	AM: 'AM',
+	PM: 'PM',
+	decimal: '.',
+	mins: 'mins',
+	hr: 'hr',
+	hrs: 'hrs'
+}```
+
+- **maxTime**  
+The time that should appear last in the dropdown list. Can be used to limit the range of time options.  
+*default: 24 hours after minTime*
+
+- **minTime**  
+The time that should appear first in the dropdown list.  
+*default: 12:00am*
+
+- **noneOption**  
+Adds one or more custom options to the top of the dropdown. Can accept several different value types:  
+Boolean (```true```): Adds a "None" option that results in an empty input value  
+String: Adds an option with a custom label that results in an empty input value  
+Object: Similar to string, but allows customizing the element's class name and the resulting input value. Can contain ```label```, ```value```, and ```className``` properties. ```value``` must be a string type.  
+Array: An array of strings or objects to add multiple non-time options  
+*default: false*
+
+- **orientation**  
+By default the timepicker dropdown will be aligned to the bottom right of the input element, or aligned to the top left if there isn't enough room below the input. Force alignment with `l` (left), `r` (right), `t` (top), and `b` (bottom). Examples: `tl`, `rb`.
+*default: 'l'*
+
+- **roundingFunction**  
+Function used to compute rounded times. The function will receive time in seconds and a settings object as arguments. The function should handle a null value for seconds.
+*default: round to nearest step*
+
+- **scrollDefault**  
+If no time value is selected, set the dropdown scroll position to show the time provided, e.g. "09:00". A time string, Date object, or integer (seconds past midnight) is acceptible, as well as the string `'now'`.   
+*default: null*
+
+- **selectOnBlur**  
+Update the input with the currently highlighted time value when the timepicker loses focus.  
+*default: false*
+
+- **show2400**  
+Show "24:00" as an option when using 24-hour time format. You must also set `timeFormat` for this option to work.  
+*default: false*
+
+- **showDuration**  
+Shows the relative time for each item in the dropdown. ```minTime``` or ```durationTime``` must be set.  
+*default: false*
+
+- **showOn**  
+Display a timepicker dropdown when the input fires a particular event. Set to null or an empty array to disable automatic display. Setting should be an array of strings.
+*default: ['focus']*
+
+- **showOnFocus**  
+DEPRECATED: Display a timepicker dropdown when the input gains focus.  
+*default: true*
+
+- **step**  
+The amount of time, in minutes, between each item in the dropdown. Alternately, you can specify a function to generate steps dynamically. The function will receive a count integer (0, 1, 2...) and is expected to return a step integer.  
+*default: 30*
+
+- **stopScrollPropagation**  
+When scrolling on the edge of the picker, it prevent parent containers (<body>) to scroll.
+*default: false*
+
+- **timeFormat**  
+How times should be displayed in the list and input element. Uses [PHP's date() formatting syntax](http://php.net/manual/en/function.date.php). Characters can be escaped with a preceeding double slash (e.g. `H\\hi`). Alternatively, you can specify a function instead of a string, to use completely custom time formatting. In this case, the format function receives a Date object and is expected to return a formatted time as a string.
+*default: 'g:ia'*
+
+- **typeaheadHighlight**  
+Highlight the nearest corresponding time option as a value is typed into the form input.  
+*default: true*
+
+- **useSelect**  
+Convert the input to an HTML `<SELECT>` control. This is ideal for small screen devices, or if you want to prevent the user from entering arbitrary values. This option is not compatible with the following options: ```appendTo```, ```closeOnWindowScroll```, ```disableTouchKeyboard```, ```forceRoundTime```, ```scrollDefault```, ```selectOnBlur```, ```typeAheadHighlight```.  
+*default: false*
+
+- **wrapHours**  
+If a time greater than 24 hours (27:30, for example) is entered, apply modolo 24 to create a valid time. Setting this to `false` will cause an input of 27:30 to result in a `timeFormatError` event.  
+*default: true*
+
+Methods
+-------
+
+- **getSecondsFromMidnight**  
+Get the time as an integer, expressed as seconds from 12am.
+
+	```javascript
+	$('#getTimeExample').timepicker('getSecondsFromMidnight');
+	```
+
+- **getTime**  
+Get the time using a Javascript Date object, relative to a Date object (default: today's date).
+
+	```javascript
+	$('#getTimeExample').timepicker('getTime');
+	$('#getTimeExample').timepicker('getTime', new Date());
+	```
+
+	You can get the time as a string using jQuery's built-in ```val()``` function:
+
+	```javascript
+	$('#getTimeExample').val();
+	```
+
+- **hide**  
+Close the timepicker dropdown.
+
+	```javascript
+	$('#hideExample').timepicker('hide');
+	```
+
+- **isVisible**  
+Check if the timepicker attached to *a specific input* is visible. Not compatible with the `useSelect` option.
+
+	```javascript
+	$('#hideExample').timepicker('isVisible');
+	```
+
+- **option**  
+Change the settings of an existing timepicker. Calling ```option``` on a visible timepicker will cause the picker to be hidden.
+
+	```javascript
+	$('#optionExample').timepicker({ 'timeFormat': 'g:ia' }); // initialize the timepicker sometime earlier in your code
+	...
+	$('#optionExample').timepicker('option', 'minTime', '2:00am');
+	$('#optionExample').timepicker('option', { 'minTime': '4:00am', 'timeFormat': 'H:i' });
+	```
+
+- **remove**  
+Unbind an existing timepicker element.
+
+	```javascript
+	$('#removeExample').timepicker('remove');
+	```
+
+- **setTime**  
+Set the time using a Javascript Date object.
+
+	```javascript
+	$('#setTimeExample').timepicker('setTime', new Date());
+	```
+
+- **show**  
+Display the timepicker dropdown.
+
+	```javascript
+	$('#showExample').timepicker('show');
+	```
+
+Events
+------
+
+- **change**  
+The native ```onChange``` event will fire any time the input value is updated, whether by selection from the timepicker list or manual entry into the text input. Your code should bind to ```change``` after initializing timepicker, or use [event delegation](http://api.jquery.com/on/).
+
+- **changeTime**  
+Called after a valid time value is entered or selected. See ```timeFormatError``` and ```timeRangeError``` for error events. Fires before ```change``` event.
+
+- **hideTimepicker**  
+Called after the timepicker is closed.
+
+- **selectTime**  
+Called after a time value is selected from the timepicker list. Fires before ```change``` event.
+
+- **showTimepicker**  
+Called after the timepicker is shown.
+
+- **timeFormatError**  
+Called if an unparseable time string is manually entered into the timepicker input. Fires before ```change``` event.
+
+- **timeRangeError**  
+Called if maxTime and minTime, or disableTimeRanges is set and an invalid time is manually entered into the timepicker input. Fires before ```change``` event.
+
+The `selectTime` and `hideTimepicker` events fire slightly differently when using the `useSelect` option. See https://github.com/jonthornton/jquery-timepicker/issues/427 for more information.
+
+Theming
+-------
+
+Sample markup with class names:
+
+```html
+<input value="5:00pm" class="ui-timepicker-input" type="text">
+...
+<div class="ui-timepicker-wrapper ui-timepicker-positioned-top optional-custom-classname" tabindex="-1">
+	<ul class="ui-timepicker-list">
+		<li class="ui-timepicker-am">12:00am</li>
+		<li class="ui-timepicker-am">12:30am</li>
+		...
+		<li class="ui-timepicker-pm">4:30pm</li>
+		<li class="ui-timepicker-pm ui-timepicker-selected">5:00pm</li>
+		<li class="ui-timepicker-pm ui-timepicker-disabled">5:30pm</li>
+		<li class="ui-timepicker-pm">6:00pm <span class="ui-timepicker-duration">(1 hour)</span></li>
+		<li class="ui-timepicker-pm">6:30pm</li>
+		...
+		<li class="ui-timepicker-pm">11:30pm</li>
+	</ul>
+</div>
+```
+
+The `ui-timepicker-positioned-top` class will be applied only when the dropdown is positioned above the input.
+
+## Packaging
+
+NPM [npm install --save timepicker](https://www.npmjs.com/package/timepicker)
+
+CDN [https://cdn.jsdelivr.net/npm/timepicker/](https://cdn.jsdelivr.net/npm/timepicker/)  [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/timepicker/badge)](https://www.jsdelivr.com/package/npm/timepicker)
+
+An AngularJS directive is available at https://github.com/Recras/angular-jquery-timepicker
+
+Help
+----
+
+Submit a [GitHub Issues request](https://github.com/jonthornton/jquery-timepicker/issues/new). Please try provide code that demonstrates the problem; you can use [this jsFiddle](http://jsfiddle.net/jonthornton/28uvg/) as a starting point.
+
+Development guidelines
+----------------------
+
+1. Install dependencies (jquery + grunt) `npm install`
+2. For sanity checks and minification run `grunt`, or just `grunt lint` to have the code linted
+ 
+jquery-timepicker follows [semantic versioning](http://semver.org/).
+
+- - -
+
+This software is made available under the open source MIT License. &copy; 2014 [Jon Thornton](http://www.jonthornton.com) and [contributors](https://github.com/jonthornton/jquery-timepicker/graphs/contributors)

+ 16 - 0
app/Resources/public/assets/jt.timepicker/bower.json

@@ -0,0 +1,16 @@
+{
+  "name": "jt.timepicker",
+  "version": "1.11.14",
+  "description": "A jQuery timepicker plugin inspired by Google Calendar.",
+  "homepage": "http://jonthornton.github.com/jquery-timepicker",
+  "main": ["./jquery.timepicker.js", "./jquery.timepicker.css"],
+  "dependencies": {
+    "jquery": ">= 1.7"
+  },
+  "keywords": ["time", "picker", "google calendar"],
+  "author": {
+    "name": "Jon Thornton",
+    "web": "https://github.com/jonthornton"
+  },
+  "license": "http://opensource.org/licenses/MIT"
+}

+ 23 - 0
app/Resources/public/assets/jt.timepicker/composer.json

@@ -0,0 +1,23 @@
+{
+  "name": "jonthornton/jquery-timepicker",
+  "description":
+    "A javascript timepicker plugin for jQuery inspired by Google Calendar.",
+  "type": "component",
+  "homepage": "http://jonthornton.github.io/jquery-timepicker/",
+  "license": "MIT",
+  "authors": [
+    {
+      "name": "Jon Thornton"
+    }
+  ],
+  "require": {
+    "robloach/component-installer": "*",
+    "components/jquery": "*"
+  },
+  "extra": {
+    "component": {
+      "scripts": ["jquery.timepicker.js"],
+      "files": ["jquery.timepicker.min.js", "jquery.timepicker.css"]
+    }
+  }
+}

+ 369 - 0
app/Resources/public/assets/jt.timepicker/index.html

@@ -0,0 +1,369 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+	<meta charset='utf-8'>
+	<title>Timepicker for jQuery &ndash; Demos and Documentation</title>
+	<meta name="description" content="A lightweight, customizable jQuery timepicker plugin inspired by Google Calendar. Add a user-friendly javascript timepicker dropdown to your app in minutes." />
+	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
+	<script type="text/javascript" src="jquery.timepicker.js"></script>
+	<link rel="stylesheet" type="text/css" href="jquery.timepicker.css" />
+	<script type="text/javascript" src="lib/bootstrap-datepicker.js"></script>
+	<link rel="stylesheet" type="text/css" href="lib/bootstrap-datepicker.css" />
+	<script type="text/javascript" src="lib/site.js"></script>
+	<link rel="stylesheet" type="text/css" href="lib/site.css" />
+</head>
+
+<body>
+	<header>
+		<h1><a href="https://github.com/jonthornton/jquery-timepicker">jquery.timepicker</a></h1>
+		<p class="body-text">
+			A lightweight, customizable javascript timepicker plugin for jQuery inspired by Google Calendar.
+		</p>
+		<ul id="header-links">
+			<li><a href="https://github.com/jonthornton/jquery-timepicker#timepicker-plugin-for-jquery">Documentation</a></li>
+			<li><a href="https://github.com/jonthornton/jquery-timepicker">Source code on GitHub</a></li>
+			<li><a href="https://github.com/jonthornton/jquery-timepicker/zipball/master">Download (zip)</a></li>
+			<li><a href="https://github.com/jonthornton/jquery-timepicker/issues?state=open">Help</a></li>
+		</ul>
+	</header>
+	<section>
+		<p class="body-text">Use this plugin to unobtrusively add a timepicker dropdown to your forms. It's lightweight (2.7kb minified and gzipped) and easy to customize.</p>
+	</section>
+	<section id="examples">
+		<article>
+			<div class="demo">
+				<h2>Basic Example</h2>
+				<p>
+					<input id="basicExample" type="text" class="time" />
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#basicExample').timepicker();
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#basicExample').timepicker();</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>Scroll Default Example</h2>
+				<p>Set the scroll position to local time if no value selected.</p>
+				<p>
+					<input id="scrollDefaultExample" type="text" class="time" />
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#scrollDefaultExample').timepicker({ 'scrollDefault': 'now' });
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#scrollDefaultExample').timepicker({ 'scrollDefault': 'now' });</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>Set Time Example</h2>
+				<p>Dynamically set the time using a Javascript Date object.</p>
+				<p>
+					<input id="setTimeExample" type="text" class="time" />
+					<button id="setTimeButton">Set current time</button>
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#setTimeExample').timepicker();
+				$('#setTimeButton').on('click', function() {
+					$('#setTimeExample').timepicker('setTime', new Date());
+				});
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#setTimeExample').timepicker();
+$('#setTimeButton').on('click', function (){
+	$('#setTimeExample').timepicker('setTime', new Date());
+});</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>Duration Example</h2>
+				<p>Set a starting time and see duration from that starting time. You can optionally set an maxTime as well.</p>
+				<p>
+					<input id="durationExample" type="text" class="time" />
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#durationExample').timepicker({
+					'minTime': '2:00pm',
+					'maxTime': '11:30pm',
+					'showDuration': true
+				});
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#durationExample').timepicker({
+	'minTime': '2:00pm',
+	'maxTime': '11:30pm',
+	'showDuration': true
+});</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>Event Example</h2>
+				<p>Trigger an event after selecting a value. Fires before the input onchange event.</p>
+				<p>
+					<input id="onselectExample" type="text" class="time" />
+					<span id="onselectTarget" style="margin-left: 30px;"></span>
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#onselectExample').timepicker();
+				$('#onselectExample').on('changeTime', function() {
+					$('#onselectTarget').text($(this).val());
+				});
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#onselectExample').timepicker();
+$('#onselectExample').on('changeTime', function() {
+	$('#onselectTarget').text($(this).val());
+});</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>DisableTimeRanges Example</h2>
+				<p>Prevent selection of certain time values.</p>
+				<p>
+					<input id="disableTimeRangesExample" type="text" class="time" />
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#disableTimeRangesExample').timepicker({ 'disableTimeRanges': [
+						['1am', '2am'],
+						['3am', '4:01am']
+					] });
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#disableTimeRangesExample').timepicker({
+	'disableTimeRanges': [
+		['1am', '2am'],
+		['3am', '4:01am']
+	]
+});</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>noneOption Example</h2>
+				<p>Custom options can be added to the dropdown menu.</p>
+				<p>
+					<input id="noneOptionExample" type="text" class="time" />
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#noneOptionExample').timepicker({
+					'noneOption': [{
+							'label': 'Foobar',
+							'className': 'shibby',
+							'value': '42'
+						},
+						'Foobar2'
+					]
+				});
+			});
+			</script>
+			<pre class="code" data-language="javascript">
+$('#noneOptionExample').timepicker({
+	'noneOption': [
+		{
+			'label': 'Foobar',
+			'className': 'shibby',
+			'value': '42'
+		},
+		'Foobar2'
+	]
+});
+		</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>timeFormat Example</h2>
+				<p>timepicker.jquery uses the time portion of <a href="http://php.net/manual/en/function.date.php">PHP's date formatting commands</a>.</p>
+				<p>
+					<input id="timeformatExample1" type="text" class="time" />
+					<input id="timeformatExample2" type="text" class="time" />
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#timeformatExample1').timepicker({ 'timeFormat': 'H:i:s' });
+				$('#timeformatExample2').timepicker({ 'timeFormat': 'h:i A' });
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#timeformatExample1').timepicker({ 'timeFormat': 'H:i:s' });
+$('#timeformatExample2').timepicker({ 'timeFormat': 'h:i A' });</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>Step Example</h2>
+				<p>Generate drop-down options with varying levels of precision.</p>
+				<p>
+					<input id="stepExample1" type="text" class="time" />
+					<input id="stepExample2" type="text" class="time" />
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#stepExample1').timepicker({ 'step': 15 });
+				$('#stepExample2').timepicker({
+					'step': function(i) {
+						return (i % 2) ? 15 : 45;
+					}
+				});
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#stepExample1').timepicker({ 'step': 15 });
+$('#stepExample2').timepicker({
+	'step': function(i) {
+		return (i%2) ? 15 : 45;
+	}
+});</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>forceRoundTime Example</h2>
+				<p>jquery-timepicker allows entering times via the keyboard. Setting forceRoundTime to true will round the entered time to the nearest option on the dropdown list.</p>
+				<p>
+					<input id="roundTimeExample" type="text" class="time" /> </p>
+			</div>
+			<script>
+			$(function() {
+				$('#roundTimeExample').timepicker({ 'forceRoundTime': true });
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#roundTimeExample').timepicker({ 'forceRoundTime': true });</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>Select Example</h2>
+				<p>jquery-timepicker can render itself as a select element too.</p>
+				<p>
+					<input id="selectExample" class="time" name="foo" />
+					<button id="selectButton">Toggle</button>
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#selectExample').timepicker();
+				$('#selectButton').click(function(e) {
+					$('#selectExample').timepicker('option', { useSelect: true });
+					$(this).hide();
+				});
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#selectExample').timepicker();
+$('#selectButton').click(function(e) {
+  $('#selectExample').timepicker('option', { useSelect: true });
+  $(this).hide();
+});</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>Non-input Example</h2>
+				<p>jquery-timepicker can be bound to any visibile DOM element, such as spans or divs.</p>
+				<p><span id="spanExample" style="background:#f00; padding:0 10px; margin-right:100px;"></span>
+					<button id="openSpanExample">Pick Time</button>
+				</p>
+			</div>
+			<script>
+			$(function() {
+				$('#spanExample').timepicker();
+				$('#openSpanExample').on('click', function() {
+					$('#spanExample').timepicker('show');
+				});
+			});
+			</script>
+			<pre class="code" data-language="javascript">$('#spanExample').timepicker();
+	$('#openSpanExample').on('click', function(){
+	$('#spanExample').timepicker('show');
+});</pre>
+		</article>
+		<article>
+			<div class="demo">
+				<h2>Datepair Plugin Example</h2>
+				<p>jquery-timepicker is designed to work with the <a href="http://jonthornton.github.com/Datepair.js">jquery-datepair plugin</a>.
+					<p id="datepairExample">
+						<input type="text" class="date start" />
+						<input type="text" class="time start" /> to
+						<input type="text" class="time end" />
+						<input type="text" class="date end" />
+					</p>
+			</div>
+			<script src="http://jonthornton.github.io/Datepair.js/dist/datepair.js"></script>
+			<script src="http://jonthornton.github.io/Datepair.js/dist/jquery.datepair.js"></script>
+			<script>
+			$('#datepairExample .time').timepicker({
+				'showDuration': true,
+				'timeFormat': 'g:ia'
+			});
+
+			$('#datepairExample .date').datepicker({
+				'format': 'm/d/yyyy',
+				'autoclose': true
+			});
+
+			$('#datepairExample').datepair();
+			</script>
+			<pre class="code" data-language="javascript">
+&lt;p id="datepairExample"&gt;
+	&lt;input type="text" class="date start" /&gt;
+	&lt;input type="text" class="time start" /&gt; to
+	&lt;input type="text" class="time end" /&gt;
+	&lt;input type="text" class="date end" /&gt;
+&lt;/p&gt;
+
+&lt;script type="text/javascript" src="datepair.js"&gt;&lt;/script&gt;
+&lt;script type="text/javascript" src="jquery.datepair.js"&gt;&lt;/script&gt;
+&lt;script&gt;
+	// initialize input widgets first
+	$('#datepairExample .time').timepicker({
+		'showDuration': true,
+		'timeFormat': 'g:ia'
+	});
+
+	$('#datepairExample .date').datepicker({
+		'format': 'yyyy-m-d',
+		'autoclose': true
+	});
+
+	// initialize datepair
+	$('#datepairExample').datepair();
+&lt;/script&gt;</pre>
+		</article>
+	</section>
+	<section>
+		<h2>Need Help?</h2>
+		<p>Check <a href="https://github.com/jonthornton/jquery-timepicker#timepicker-plugin-for-jquery">the documentation</a> or <a href="https://github.com/jonthornton/jquery-timepicker/issues?state=open">submit an issue</a> on GitHub.</p>
+	</section>
+	<footer>
+		<p>&copy; 2014 <a href="http://jonthornton.com">Jon Thornton</a></p>
+	</footer>
+	<script>
+	(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', 'https://www.google-analytics.com/analytics.js', 'ga');
+
+	ga('create', 'UA-15605525-4', 'auto');
+	ga('send', 'pageview');
+	</script>
+	</div>
+</body>
+
+</html>

+ 72 - 0
app/Resources/public/assets/jt.timepicker/jquery.timepicker.css

@@ -0,0 +1,72 @@
+.ui-timepicker-wrapper {
+	overflow-y: auto;
+	max-height: 150px;
+	width: 6.5em;
+	background: #fff;
+	border: 1px solid #ddd;
+	-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);
+	-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);
+	box-shadow:0 5px 10px rgba(0,0,0,0.2);
+	outline: none;
+	z-index: 10052;
+	margin: 0;
+}
+
+.ui-timepicker-wrapper.ui-timepicker-with-duration {
+	width: 13em;
+}
+
+.ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-30,
+.ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-60 {
+	width: 11em;
+}
+
+.ui-timepicker-list {
+	margin: 0;
+	padding: 0;
+	list-style: none;
+}
+
+.ui-timepicker-duration {
+	margin-left: 5px; color: #888;
+}
+
+.ui-timepicker-list:hover .ui-timepicker-duration {
+	color: #888;
+}
+
+.ui-timepicker-list li {
+	padding: 3px 0 3px 5px;
+	cursor: pointer;
+	white-space: nowrap;
+	color: #000;
+	list-style: none;
+	margin: 0;
+}
+
+.ui-timepicker-list:hover .ui-timepicker-selected {
+	background: #fff; color: #000;
+}
+
+li.ui-timepicker-selected,
+.ui-timepicker-list li:hover,
+.ui-timepicker-list .ui-timepicker-selected:hover {
+	background: #1980EC; color: #fff;
+}
+
+li.ui-timepicker-selected .ui-timepicker-duration,
+.ui-timepicker-list li:hover .ui-timepicker-duration {
+	color: #ccc;
+}
+
+.ui-timepicker-list li.ui-timepicker-disabled,
+.ui-timepicker-list li.ui-timepicker-disabled:hover,
+.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
+	color: #888;
+	cursor: default;
+}
+
+.ui-timepicker-list li.ui-timepicker-disabled:hover,
+.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
+	background: #f2f2f2;
+}

+ 152 - 0
app/Resources/public/assets/jt.timepicker/jquery.timepicker.d.ts

@@ -0,0 +1,152 @@
+// Type definitions for jQuery.timepicker 1.11.14
+// https://github.com/jonthornton/jquery-timepicker
+
+/**
+ * Declaring a namespace because there are several jquery timepickers already out there on DefinitelyTyped. Jt stands for Jon Thornton
+ */
+declare namespace Jt.Timepicker {
+
+    /**
+     * Options object for the jquery.timepicker
+     */
+    export interface Options {
+        /**
+         * Default: 'body'
+         * Override where the dropdown is appended.
+         * Takes either a string to use as a selector, a function that gets passed the clicked input element as argument or a jquery object to use directly.
+         */
+        appendTo?: string | ((clickedElement) => string);
+        /**
+         * Default: null
+         * A class name to apply to the HTML element that contains the timepicker dropdown.
+         */
+        className?: string;
+        /**
+         * Default: false
+         * Close the timepicker when the window is scrolled. (Replicates <select> behavior.)
+         */
+        closeOnWindowScroll?: boolean;
+        /**
+         * Default: false
+         * Disable typing in the timepicker input box; force users to select from list.
+         * More information https://github.com/jonthornton/jquery-timepicker/issues/425#issuecomment-133262458
+         */
+        disableTextInput?: boolean;
+        /**
+         * Default: []
+         * Disable selection of certain time ranges. Input is an array of time pairs, like `[['3:00am', '4:30am'], ['5:00pm', '8:00pm']].
+         * The start of the interval will be disabled but the end won't.
+         */
+        disableTimeRanges?: Array<string[]>;
+        /**
+         * Default: false
+         * Disables the onscreen keyboard for touch devices. There can be instances where Firefox or Chrome have touch events enabled
+         * (such as on Surface tablets but not actually be a touch device. In this case disableTouchKeyboard will prevent the timepicker
+         * input field from being focused.
+         * More information: https://github.com/jonthornton/jquery-timepicker/issues/413
+         */
+        disableTouchKeyboard?: boolean;
+        /**
+         * Default: Same as the minTime
+         * The time against which showDuration will compute relative times. This should be given as a formatted date string.
+         */
+        durationTime?: string | Date | (() => string | Date);
+        /**
+         * Default: false
+         * Force update the time to step settings as soon as it loses focus`.
+         */
+        forceRoundTime?: boolean;
+        /**
+         * Default: 24 hours after minTime
+         * The time that should appear last in the dropdown list. Can be used to limit the range of time options.
+         */
+        maxTime?: Date | string;
+        /**
+         * Default: 12:00 am
+         * The time that should appear first in the dropdown list.
+         */
+        minTime?: Date | string;
+        /**
+         * Default: false.
+         * Adds one or more custom options to the top of the dropdown. Can accept several different value types:
+         * Boolean (true): Adds a "None" option that results in an empty input value
+         * String: Adds an option with a custom label that results in an empty input value
+         * Object: Similar to string, but allows customizing the element's class name and the resulting input value. Can contain label, value, and className properties. The value property must be a string type.
+         * Array: An array of strings or objects to add multiple non-time options
+         */
+        noneOption?: boolean | string | string[] | NoneObject;
+        /**
+         * default: 'l'
+         * By default the timepicker dropdown will be aligned to the bottom right of the input element, or aligned to the top left if there isn't enough room below the input. Force alignment with l (left), r (right), t (top), and b (bottom). Examples: tl, rb.
+         */
+        orientation?: string;
+        /**
+         * Default: Rounds to the nearest step
+         * Function used to compute rounded times. The function will receive time in seconds and a settings object as arguments. The function should handle a null value for seconds
+         */
+        roundingFunction?: (seconds: number, settings: Options) => number;
+        /**
+         * Default: null
+         * If no time value is selected, set the dropdown scroll position to show the time provided, e.g. "09:00". A time string, Date object, or integer (seconds past midnight) is acceptible, as well as the string 'now'
+         */
+        scrollDefault?: string | Date | number | {};
+        /**
+         * Default: false
+         * Update the input with the currently highlighted time value when the timepicker loses focus.
+         */
+        selectOnBlur?: boolean;
+        /**
+         * Default: false
+         * Show "24:00" as an option when using 24-hour time format
+         */
+        show2400?: boolean;
+        /**
+         * Default: false
+         * Shows the relative time for each item in the dropdown. minTime or durationTime must be set.
+         */
+        showDuration?: boolean;
+        /**
+         * Default: ["click", "focus"]
+         * Display a timepicker dropdown when the input fires a particular event. Set to null or an empty array to disable automatic display. Setting should be an array of strings
+         */
+        showOn?: string[];
+        /**
+         * @deprecated Display a timepicker dropdown when the input gains focus.
+         * Default: true
+         */
+        showOnFocus?: boolean;
+        /**
+         * Default: 30
+         * The amount of time, in minutes, between each item in the dropdown. Alternately, you can specify a function to generate steps dynamically. The function will receive a count integer (0, 1, 2...) and is expected to return a step integer.
+         */
+        step?: number;
+        /**
+         * Default: false
+         * When scrolling on the edge of the picker, it prevent parent containers () to scroll
+         */
+        stopScrollPropagation?: boolean;
+        /**
+         * Default: 'g:ia'
+         * How times should be displayed in the list and input element. Uses PHP's date() formatting syntax. Characters can be escaped with a preceeding double slash (e.g. H\\hi). Alternatively, you can specify a function instead of a string, to use completely custom time formatting. In this case, * the format function receives a Date object and is expected to return a formatted time as a string
+         */
+        timeFormat?: string | ((givenDate: Date) => string);
+        /**
+         * Default: true
+         * Highlight the nearest corresponding time option as a value is typed into the form input.
+         */
+        typeaheadHighlight?: boolean;
+        /**
+         * Default: false
+         * Convert the input to an HTML <SELECT> control. This is ideal for small screen devices, or if you want to prevent the user from entering
+         * arbitrary values. This option is not compatible with the following options: appendTo, closeOnWindowScroll, disableTouchKeyboard,
+         * scrollDefault, selectOnBlur, typeAheadHighlight.
+         */
+        useSelect?: boolean;
+    }
+
+    export interface NoneObject {
+        label: string;
+        value: string;
+        className: string;
+    }
+}

+ 1386 - 0
app/Resources/public/assets/jt.timepicker/jquery.timepicker.js

@@ -0,0 +1,1386 @@
+/*!
+ * jquery-timepicker v1.11.14 - A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.
+ * Copyright (c) 2015 Jon Thornton - http://jonthornton.github.com/jquery-timepicker/
+ * License: MIT
+ */
+
+(function(factory) {
+  if (
+    typeof exports === "object" &&
+    exports &&
+    typeof module === "object" &&
+    module &&
+    module.exports === exports
+  ) {
+    // Browserify. Attach to jQuery module.
+    factory(require("jquery"));
+  } else if (typeof define === "function" && define.amd) {
+    // AMD. Register as an anonymous module.
+    define(["jquery"], factory);
+  } else {
+    // Browser globals
+    factory(jQuery);
+  }
+})(function($) {
+  var _ONE_DAY = 86400;
+  var _lang = {
+    am: "am",
+    pm: "pm",
+    AM: "AM",
+    PM: "PM",
+    decimal: ".",
+    mins: "mins",
+    hr: "hr",
+    hrs: "hrs"
+  };
+
+  var _DEFAULTS = {
+    appendTo: "body",
+    className: null,
+    closeOnWindowScroll: false,
+    disableTextInput: false,
+    disableTimeRanges: [],
+    disableTouchKeyboard: false,
+    durationTime: null,
+    forceRoundTime: false,
+    maxTime: null,
+    minTime: null,
+    noneOption: false,
+    orientation: "l",
+    roundingFunction: function(seconds, settings) {
+      if (seconds === null) {
+        return null;
+      } else if (typeof settings.step !== "number") {
+        // TODO: nearest fit irregular steps
+        return seconds;
+      } else {
+        var offset = seconds % (settings.step * 60); // step is in minutes
+
+        var start = settings.minTime || 0;
+
+        // adjust offset by start mod step so that the offset is aligned not to 00:00 but to the start
+        offset -= start % (settings.step * 60);
+
+        if (offset >= settings.step * 30) {
+          // if offset is larger than a half step, round up
+          seconds += settings.step * 60 - offset;
+        } else {
+          // round down
+          seconds -= offset;
+        }
+
+        return _moduloSeconds(seconds, settings);
+      }
+    },
+    scrollDefault: null,
+    selectOnBlur: false,
+    show2400: false,
+    showDuration: false,
+    showOn: ["click", "focus"],
+    showOnFocus: true,
+    step: 30,
+    stopScrollPropagation: false,
+    timeFormat: "g:ia",
+    typeaheadHighlight: true,
+    useSelect: false,
+    wrapHours: true
+  };
+
+  var methods = {
+    init: function(options) {
+      return this.each(function() {
+        var self = $(this);
+
+        // pick up settings from data attributes
+        var attributeOptions = [];
+        for (var key in _DEFAULTS) {
+          if (self.data(key)) {
+            attributeOptions[key] = self.data(key);
+          }
+        }
+
+        var settings = $.extend({}, _DEFAULTS, options, attributeOptions);
+
+        if (settings.lang) {
+          _lang = $.extend(_lang, settings.lang);
+        }
+
+        settings = _parseSettings(settings);
+        self.data("timepicker-settings", settings);
+        self.addClass("ui-timepicker-input");
+
+        if (settings.useSelect) {
+          _render(self);
+        } else {
+          self.prop("autocomplete", "off");
+          if (settings.showOn) {
+            for (var i in settings.showOn) {
+              self.on(settings.showOn[i] + ".timepicker", methods.show);
+            }
+          }
+          self.on("change.timepicker", _formatValue);
+          self.on("keydown.timepicker", _keydownhandler);
+          self.on("keyup.timepicker", _keyuphandler);
+          if (settings.disableTextInput) {
+            self.on("keydown.timepicker", _disableTextInputHandler);
+          }
+          self.on("cut.timepicker", _keyuphandler);
+          self.on("paste.timepicker", _keyuphandler);
+
+          _formatValue.call(self.get(0), null, "initial");
+        }
+      });
+    },
+
+    show: function(e) {
+      var self = $(this);
+      var settings = self.data("timepicker-settings");
+
+      if (e) {
+        e.preventDefault();
+      }
+
+      if (settings.useSelect) {
+        self.data("timepicker-list").focus();
+        return;
+      }
+
+      if (_hideKeyboard(self)) {
+        // block the keyboard on mobile devices
+        self.blur();
+      }
+
+      var list = self.data("timepicker-list");
+
+      // check if input is readonly
+      if (self.prop("readonly")) {
+        return;
+      }
+
+      // check if list needs to be rendered
+      if (
+        !list ||
+        list.length === 0 ||
+        typeof settings.durationTime === "function"
+      ) {
+        _render(self);
+        list = self.data("timepicker-list");
+      }
+
+      if (_isVisible(list)) {
+        return;
+      }
+
+      self.data("ui-timepicker-value", self.val());
+      _setSelected(self, list);
+
+      // make sure other pickers are hidden
+      methods.hide();
+
+      // position the dropdown relative to the input
+      list.show();
+      var listOffset = {};
+
+      if (settings.orientation.match(/r/)) {
+        // right-align the dropdown
+        listOffset.left =
+          self.offset().left +
+          self.outerWidth() -
+          list.outerWidth() +
+          parseInt(list.css("marginLeft").replace("px", ""), 10);
+      } else {
+        // left-align the dropdown
+        listOffset.left =
+          self.offset().left +
+          parseInt(list.css("marginLeft").replace("px", ""), 10);
+      }
+
+      var verticalOrientation;
+      if (settings.orientation.match(/t/)) {
+        verticalOrientation = "t";
+      } else if (settings.orientation.match(/b/)) {
+        verticalOrientation = "b";
+      } else if (
+        self.offset().top + self.outerHeight(true) + list.outerHeight() >
+        $(window).height() + $(window).scrollTop()
+      ) {
+        verticalOrientation = "t";
+      } else {
+        verticalOrientation = "b";
+      }
+
+      if (verticalOrientation == "t") {
+        // position the dropdown on top
+        list.addClass("ui-timepicker-positioned-top");
+        listOffset.top =
+          self.offset().top -
+          list.outerHeight() +
+          parseInt(list.css("marginTop").replace("px", ""), 10);
+      } else {
+        // put it under the input
+        list.removeClass("ui-timepicker-positioned-top");
+        listOffset.top =
+          self.offset().top +
+          self.outerHeight() +
+          parseInt(list.css("marginTop").replace("px", ""), 10);
+      }
+
+      list.offset(listOffset);
+
+      // position scrolling
+      var selected = list.find(".ui-timepicker-selected");
+
+      if (!selected.length) {
+        var timeInt = _time2int(_getTimeValue(self));
+        if (timeInt !== null) {
+          selected = _findRow(self, list, timeInt);
+        } else if (settings.scrollDefault) {
+          selected = _findRow(self, list, settings.scrollDefault());
+        }
+      }
+
+      // if not found or disabled, intelligently find first selectable element
+      if (!selected.length || selected.hasClass("ui-timepicker-disabled")) {
+        selected = list.find("li:not(.ui-timepicker-disabled):first");
+      }
+
+      if (selected && selected.length) {
+        var topOffset =
+          list.scrollTop() + selected.position().top - selected.outerHeight();
+        list.scrollTop(topOffset);
+      } else {
+        list.scrollTop(0);
+      }
+
+      // prevent scroll propagation
+      if (settings.stopScrollPropagation) {
+        $(
+          document
+        ).on("wheel.ui-timepicker", ".ui-timepicker-wrapper", function(e) {
+          e.preventDefault();
+          var currentScroll = $(this).scrollTop();
+          $(this).scrollTop(currentScroll + e.originalEvent.deltaY);
+        });
+      }
+
+      // attach close handlers
+      $(document).on(
+        "touchstart.ui-timepicker mousedown.ui-timepicker",
+        _closeHandler
+      );
+      $(window).on("resize.ui-timepicker", _closeHandler);
+      if (settings.closeOnWindowScroll) {
+        $(document).on("scroll.ui-timepicker", _closeHandler);
+      }
+
+      self.trigger("showTimepicker");
+
+      return this;
+    },
+
+    hide: function(e) {
+      var self = $(this);
+      var settings = self.data("timepicker-settings");
+
+      if (settings && settings.useSelect) {
+        self.blur();
+      }
+
+      $(".ui-timepicker-wrapper").each(function() {
+        var list = $(this);
+        if (!_isVisible(list)) {
+          return;
+        }
+
+        var self = list.data("timepicker-input");
+        var settings = self.data("timepicker-settings");
+
+        if (settings && settings.selectOnBlur) {
+          _selectValue(self);
+        }
+
+        list.hide();
+        self.trigger("hideTimepicker");
+      });
+
+      return this;
+    },
+
+    option: function(key, value) {
+      if (typeof key == "string" && typeof value == "undefined") {
+        return $(this).data("timepicker-settings")[key];
+      }
+
+      return this.each(function() {
+        var self = $(this);
+        var settings = self.data("timepicker-settings");
+        var list = self.data("timepicker-list");
+
+        if (typeof key == "object") {
+          settings = $.extend(settings, key);
+        } else if (typeof key == "string") {
+          settings[key] = value;
+        }
+
+        settings = _parseSettings(settings);
+
+        self.data("timepicker-settings", settings);
+
+        _formatValue.call(self.get(0), { type: "change" }, "initial");
+
+        if (list) {
+          list.remove();
+          self.data("timepicker-list", false);
+        }
+
+        if (settings.useSelect) {
+          _render(self);
+        }
+      });
+    },
+
+    getSecondsFromMidnight: function() {
+      return _time2int(_getTimeValue(this));
+    },
+
+    getTime: function(relative_date) {
+      var self = this;
+
+      var time_string = _getTimeValue(self);
+      if (!time_string) {
+        return null;
+      }
+
+      var offset = _time2int(time_string);
+      if (offset === null) {
+        return null;
+      }
+
+      if (!relative_date) {
+        relative_date = new Date();
+      }
+
+      // construct a Date from relative date, and offset's time
+      var time = new Date(relative_date);
+      time.setHours(offset / 3600);
+      time.setMinutes((offset % 3600) / 60);
+      time.setSeconds(offset % 60);
+      time.setMilliseconds(0);
+
+      return time;
+    },
+
+    isVisible: function() {
+      var self = this;
+      var list = self.data("timepicker-list");
+      return !!(list && _isVisible(list));
+    },
+
+    setTime: function(value) {
+      var self = this;
+      var settings = self.data("timepicker-settings");
+
+      if (settings.forceRoundTime) {
+        var prettyTime = _roundAndFormatTime(_time2int(value), settings);
+      } else {
+        var prettyTime = _int2time(_time2int(value), settings);
+      }
+
+      if (value && prettyTime === null && settings.noneOption) {
+        prettyTime = value;
+      }
+
+      _setTimeValue(self, prettyTime, "initial");
+      _formatValue.call(self.get(0), { type: "change" }, "initial");
+
+      if (self.data("timepicker-list")) {
+        _setSelected(self, self.data("timepicker-list"));
+      }
+
+      return this;
+    },
+
+    remove: function() {
+      var self = this;
+
+      // check if this element is a timepicker
+      if (!self.hasClass("ui-timepicker-input")) {
+        return;
+      }
+
+      var settings = self.data("timepicker-settings");
+      self.removeAttr("autocomplete", "off");
+      self.removeClass("ui-timepicker-input");
+      self.removeData("timepicker-settings");
+      self.off(".timepicker");
+
+      // timepicker-list won't be present unless the user has interacted with this timepicker
+      if (self.data("timepicker-list")) {
+        self.data("timepicker-list").remove();
+      }
+
+      if (settings.useSelect) {
+        self.show();
+      }
+
+      self.removeData("timepicker-list");
+
+      return this;
+    }
+  };
+
+  // private methods
+
+  function _isVisible(elem) {
+    var el = elem[0];
+    return el.offsetWidth > 0 && el.offsetHeight > 0;
+  }
+
+  function _parseSettings(settings) {
+    if (settings.minTime) {
+      settings.minTime = _time2int(settings.minTime);
+    }
+
+    if (settings.maxTime) {
+      settings.maxTime = _time2int(settings.maxTime);
+    }
+
+    if (settings.durationTime && typeof settings.durationTime !== "function") {
+      settings.durationTime = _time2int(settings.durationTime);
+    }
+
+    if (settings.scrollDefault == "now") {
+      settings.scrollDefault = function() {
+        return settings.roundingFunction(_time2int(new Date()), settings);
+      };
+    } else if (
+      settings.scrollDefault &&
+      typeof settings.scrollDefault != "function"
+    ) {
+      var val = settings.scrollDefault;
+      settings.scrollDefault = function() {
+        return settings.roundingFunction(_time2int(val), settings);
+      };
+    } else if (settings.minTime) {
+      settings.scrollDefault = function() {
+        return settings.roundingFunction(settings.minTime, settings);
+      };
+    }
+
+    if (
+      $.type(settings.timeFormat) === "string" &&
+      settings.timeFormat.match(/[gh]/)
+    ) {
+      settings._twelveHourTime = true;
+    }
+
+    if (
+      settings.showOnFocus === false &&
+      settings.showOn.indexOf("focus") != -1
+    ) {
+      settings.showOn.splice(settings.showOn.indexOf("focus"), 1);
+    }
+
+    if (settings.disableTimeRanges.length > 0) {
+      // convert string times to integers
+      for (var i in settings.disableTimeRanges) {
+        settings.disableTimeRanges[i] = [
+          _time2int(settings.disableTimeRanges[i][0]),
+          _time2int(settings.disableTimeRanges[i][1])
+        ];
+      }
+
+      // sort by starting time
+      settings.disableTimeRanges = settings.disableTimeRanges.sort(function(
+        a,
+        b
+      ) {
+        return a[0] - b[0];
+      });
+
+      // merge any overlapping ranges
+      for (var i = settings.disableTimeRanges.length - 1; i > 0; i--) {
+        if (
+          settings.disableTimeRanges[i][0] <=
+          settings.disableTimeRanges[i - 1][1]
+        ) {
+          settings.disableTimeRanges[i - 1] = [
+            Math.min(
+              settings.disableTimeRanges[i][0],
+              settings.disableTimeRanges[i - 1][0]
+            ),
+            Math.max(
+              settings.disableTimeRanges[i][1],
+              settings.disableTimeRanges[i - 1][1]
+            )
+          ];
+          settings.disableTimeRanges.splice(i, 1);
+        }
+      }
+    }
+
+    return settings;
+  }
+
+  function _render(self) {
+    var settings = self.data("timepicker-settings");
+    var list = self.data("timepicker-list");
+
+    if (list && list.length) {
+      list.remove();
+      self.data("timepicker-list", false);
+    }
+
+    if (settings.useSelect) {
+      list = $("<select />", { class: "ui-timepicker-select" });
+      if (self.attr('name')) {
+        list.attr('name', 'ui-timepicker-' + self.attr('name'));
+      }
+      var wrapped_list = list;
+    } else {
+      list = $("<ul />", { class: "ui-timepicker-list" });
+
+      var wrapped_list = $("<div />", {
+        class: "ui-timepicker-wrapper",
+        tabindex: -1
+      });
+      wrapped_list.css({ display: "none", position: "absolute" }).append(list);
+    }
+
+    if (settings.noneOption) {
+      if (settings.noneOption === true) {
+        settings.noneOption = settings.useSelect ? "Time..." : "None";
+      }
+
+      if ($.isArray(settings.noneOption)) {
+        for (var i in settings.noneOption) {
+          if (parseInt(i, 10) == i) {
+            var noneElement = _generateNoneElement(
+              settings.noneOption[i],
+              settings.useSelect
+            );
+            list.append(noneElement);
+          }
+        }
+      } else {
+        var noneElement = _generateNoneElement(
+          settings.noneOption,
+          settings.useSelect
+        );
+        list.append(noneElement);
+      }
+    }
+
+    if (settings.className) {
+      wrapped_list.addClass(settings.className);
+    }
+
+    if (
+      (settings.minTime !== null || settings.durationTime !== null) &&
+      settings.showDuration
+    ) {
+      var stepval =
+        typeof settings.step == "function" ? "function" : settings.step;
+      wrapped_list.addClass("ui-timepicker-with-duration");
+      wrapped_list.addClass("ui-timepicker-step-" + settings.step);
+    }
+
+    var durStart = settings.minTime;
+    if (typeof settings.durationTime === "function") {
+      durStart = _time2int(settings.durationTime());
+    } else if (settings.durationTime !== null) {
+      durStart = settings.durationTime;
+    }
+    var start = settings.minTime !== null ? settings.minTime : 0;
+    var end =
+      settings.maxTime !== null ? settings.maxTime : start + _ONE_DAY - 1;
+
+    if (end < start) {
+      // make sure the end time is greater than start time, otherwise there will be no list to show
+      end += _ONE_DAY;
+    }
+
+    if (
+      end === _ONE_DAY - 1 &&
+      $.type(settings.timeFormat) === "string" &&
+      settings.show2400
+    ) {
+      // show a 24:00 option when using military time
+      end = _ONE_DAY;
+    }
+
+    var dr = settings.disableTimeRanges;
+    var drCur = 0;
+    var drLen = dr.length;
+
+    var stepFunc = settings.step;
+    if (typeof stepFunc != "function") {
+      stepFunc = function() {
+        return settings.step;
+      };
+    }
+
+    for (var i = start, j = 0; i <= end; j++, i += stepFunc(j) * 60) {
+      var timeInt = i;
+      var timeString = _int2time(timeInt, settings);
+
+      if (settings.useSelect) {
+        var row = $("<option />", { value: timeString });
+        row.text(timeString);
+      } else {
+        var row = $("<li />");
+        row.addClass(
+          timeInt % _ONE_DAY < _ONE_DAY / 2
+            ? "ui-timepicker-am"
+            : "ui-timepicker-pm"
+        );
+        row.data("time", _moduloSeconds(timeInt, settings));
+        row.text(timeString);
+      }
+
+      if (
+        (settings.minTime !== null || settings.durationTime !== null) &&
+        settings.showDuration
+      ) {
+        var durationString = _int2duration(i - durStart, settings.step);
+        if (settings.useSelect) {
+          row.text(row.text() + " (" + durationString + ")");
+        } else {
+          var duration = $("<span />", { class: "ui-timepicker-duration" });
+          duration.text(" (" + durationString + ")");
+          row.append(duration);
+        }
+      }
+
+      if (drCur < drLen) {
+        if (timeInt >= dr[drCur][1]) {
+          drCur += 1;
+        }
+
+        if (dr[drCur] && timeInt >= dr[drCur][0] && timeInt < dr[drCur][1]) {
+          if (settings.useSelect) {
+            row.prop("disabled", true);
+          } else {
+            row.addClass("ui-timepicker-disabled");
+          }
+        }
+      }
+
+      list.append(row);
+    }
+
+    wrapped_list.data("timepicker-input", self);
+    self.data("timepicker-list", wrapped_list);
+
+    if (settings.useSelect) {
+      if (self.val()) {
+        list.val(_roundAndFormatTime(_time2int(self.val()), settings));
+      }
+
+      list.on("focus", function() {
+        $(this)
+          .data("timepicker-input")
+          .trigger("showTimepicker");
+      });
+      list.on("blur", function() {
+        $(this)
+          .data("timepicker-input")
+          .trigger("hideTimepicker");
+      });
+      list.on("change", function() {
+        _setTimeValue(self, $(this).val(), "select");
+      });
+
+      _setTimeValue(self, list.val(), "initial");
+      self.hide().after(list);
+    } else {
+      var appendTo = settings.appendTo;
+      if (typeof appendTo === "string") {
+        appendTo = $(appendTo);
+      } else if (typeof appendTo === "function") {
+        appendTo = appendTo(self);
+      }
+      appendTo.append(wrapped_list);
+      _setSelected(self, list);
+
+      list.on("mousedown click", "li", function(e) {
+        // hack: temporarily disable the focus handler
+        // to deal with the fact that IE fires 'focus'
+        // events asynchronously
+        self.off("focus.timepicker");
+        self.on("focus.timepicker-ie-hack", function() {
+          self.off("focus.timepicker-ie-hack");
+          self.on("focus.timepicker", methods.show);
+        });
+
+        if (!_hideKeyboard(self)) {
+          self[0].focus();
+        }
+
+        // make sure only the clicked row is selected
+        list.find("li").removeClass("ui-timepicker-selected");
+        $(this).addClass("ui-timepicker-selected");
+
+        if (_selectValue(self)) {
+          self.trigger("hideTimepicker");
+
+          list.on("mouseup.timepicker click.timepicker", "li", function(e) {
+            list.off("mouseup.timepicker click.timepicker");
+            wrapped_list.hide();
+          });
+        }
+      });
+    }
+  }
+
+  function _generateNoneElement(optionValue, useSelect) {
+    var label, className, value;
+
+    if (typeof optionValue == "object") {
+      label = optionValue.label;
+      className = optionValue.className;
+      value = optionValue.value;
+    } else if (typeof optionValue == "string") {
+      label = optionValue;
+      value = '';
+    } else {
+      $.error("Invalid noneOption value");
+    }
+
+    if (useSelect) {
+      return $("<option />", {
+        value: value,
+        class: className,
+        text: label
+      });
+    } else {
+      return $("<li />", {
+        class: className,
+        text: label
+      }).data("time", String(value));
+    }
+  }
+
+  function _roundAndFormatTime(seconds, settings) {
+    seconds = settings.roundingFunction(seconds, settings);
+    if (seconds !== null) {
+      return _int2time(seconds, settings);
+    }
+  }
+
+  // event handler to decide whether to close timepicker
+  function _closeHandler(e) {
+    if (e.target == window) {
+      // mobile Chrome fires focus events against window for some reason
+      return;
+    }
+
+    var target = $(e.target);
+
+    if (
+      target.closest(".ui-timepicker-input").length ||
+      target.closest(".ui-timepicker-wrapper").length
+    ) {
+      // active timepicker was focused. ignore
+      return;
+    }
+
+    methods.hide();
+    $(document).unbind(".ui-timepicker");
+    $(window).unbind(".ui-timepicker");
+  }
+
+  function _hideKeyboard(self) {
+    var settings = self.data("timepicker-settings");
+    return (
+      (window.navigator.msMaxTouchPoints || "ontouchstart" in document) &&
+      settings.disableTouchKeyboard
+    );
+  }
+
+  function _findRow(self, list, value) {
+    if (!value && value !== 0) {
+      return false;
+    }
+
+    var settings = self.data("timepicker-settings");
+    var out = false;
+    var value = settings.roundingFunction(value, settings);
+
+    // loop through the menu items
+    list.find("li").each(function(i, obj) {
+      var jObj = $(obj);
+      if (typeof jObj.data("time") != "number") {
+        return;
+      }
+
+      if (jObj.data("time") == value) {
+        out = jObj;
+        return false;
+      }
+    });
+
+    return out;
+  }
+
+  function _setSelected(self, list) {
+    list.find("li").removeClass("ui-timepicker-selected");
+
+    var settings = self.data("timepicker-settings");
+    var timeValue = _time2int(_getTimeValue(self), settings);
+    if (timeValue === null) {
+      return;
+    }
+
+    var selected = _findRow(self, list, timeValue);
+    if (selected) {
+      var topDelta = selected.offset().top - list.offset().top;
+
+      if (
+        topDelta + selected.outerHeight() > list.outerHeight() ||
+        topDelta < 0
+      ) {
+        list.scrollTop(
+          list.scrollTop() + selected.position().top - selected.outerHeight()
+        );
+      }
+
+      if (settings.forceRoundTime || selected.data("time") === timeValue) {
+        selected.addClass("ui-timepicker-selected");
+      }
+    }
+  }
+
+  function _formatValue(e, origin) {
+    if (origin == "timepicker") {
+      return;
+    }
+
+    var self = $(this);
+
+    if (this.value === "") {
+      _setTimeValue(self, null, origin);
+      return;
+    }
+
+    if (self.is(":focus") && (!e || e.type != "change")) {
+      return;
+    }
+
+    var settings = self.data("timepicker-settings");
+    var seconds = _time2int(this.value, settings);
+
+    if (seconds === null) {
+      self.trigger("timeFormatError");
+      return;
+    }
+
+    var rangeError = false;
+    // check that the time in within bounds
+    if (
+      settings.minTime !== null &&
+      settings.maxTime !== null &&
+      (seconds < settings.minTime || seconds > settings.maxTime)
+    ) {
+      rangeError = true;
+    }
+
+    // check that time isn't within disabled time ranges
+    $.each(settings.disableTimeRanges, function() {
+      if (seconds >= this[0] && seconds < this[1]) {
+        rangeError = true;
+        return false;
+      }
+    });
+
+    if (settings.forceRoundTime) {
+      var roundSeconds = settings.roundingFunction(seconds, settings);
+      if (roundSeconds != seconds) {
+        seconds = roundSeconds;
+        origin = null;
+      }
+    }
+
+    var prettyTime = _int2time(seconds, settings);
+
+    if (rangeError) {
+      if (
+        _setTimeValue(self, prettyTime, "error") ||
+        (e && e.type == "change")
+      ) {
+        self.trigger("timeRangeError");
+      }
+    } else {
+      _setTimeValue(self, prettyTime, origin);
+    }
+  }
+
+  function _getTimeValue(self) {
+    if (self.is("input")) {
+      return self.val();
+    } else {
+      // use the element's data attributes to store values
+      return self.data("ui-timepicker-value");
+    }
+  }
+
+  function _setTimeValue(self, value, source) {
+    if (self.is("input")) {
+      self.val(value);
+
+      var settings = self.data("timepicker-settings");
+      if (settings.useSelect && source != "select" && self.data("timepicker-list")) {
+        self
+          .data("timepicker-list")
+          .val(_roundAndFormatTime(_time2int(value), settings));
+      }
+    }
+
+    if (self.data("ui-timepicker-value") != value) {
+      self.data("ui-timepicker-value", value);
+      if (source == "select") {
+        self
+          .trigger("selectTime")
+          .trigger("changeTime")
+          .trigger("change", "timepicker");
+      } else if (["error", "initial"].indexOf(source) == -1) {
+        self.trigger("changeTime");
+      }
+
+      return true;
+    } else {
+      if (["error", "initial"].indexOf(source) == -1) {
+        self.trigger("selectTime");
+      }
+      return false;
+    }
+  }
+
+  /*
+	*  Filter freeform input
+	*/
+  function _disableTextInputHandler(e) {
+    switch (e.keyCode) {
+      case 13: // return
+      case 9: //tab
+        return;
+
+      default:
+        e.preventDefault();
+    }
+  }
+
+  /*
+	*  Keyboard navigation via arrow keys
+	*/
+  function _keydownhandler(e) {
+    var self = $(this);
+    var list = self.data("timepicker-list");
+
+    if (!list || !_isVisible(list)) {
+      if (e.keyCode == 40) {
+        // show the list!
+        methods.show.call(self.get(0));
+        list = self.data("timepicker-list");
+        if (!_hideKeyboard(self)) {
+          self.focus();
+        }
+      } else {
+        return true;
+      }
+    }
+
+    switch (e.keyCode) {
+      case 13: // return
+        if (_selectValue(self)) {
+          _formatValue.call(self.get(0), { type: "change" });
+          methods.hide.apply(this);
+        }
+
+        e.preventDefault();
+        return false;
+
+      case 38: // up
+        var selected = list.find(".ui-timepicker-selected");
+
+        if (!selected.length) {
+          list.find("li").each(function(i, obj) {
+            if ($(obj).position().top > 0) {
+              selected = $(obj);
+              return false;
+            }
+          });
+          selected.addClass("ui-timepicker-selected");
+        } else if (!selected.is(":first-child")) {
+          selected.removeClass("ui-timepicker-selected");
+          selected.prev().addClass("ui-timepicker-selected");
+
+          if (selected.prev().position().top < selected.outerHeight()) {
+            list.scrollTop(list.scrollTop() - selected.outerHeight());
+          }
+        }
+
+        return false;
+
+      case 40: // down
+        selected = list.find(".ui-timepicker-selected");
+
+        if (selected.length === 0) {
+          list.find("li").each(function(i, obj) {
+            if ($(obj).position().top > 0) {
+              selected = $(obj);
+              return false;
+            }
+          });
+
+          selected.addClass("ui-timepicker-selected");
+        } else if (!selected.is(":last-child")) {
+          selected.removeClass("ui-timepicker-selected");
+          selected.next().addClass("ui-timepicker-selected");
+
+          if (
+            selected.next().position().top + 2 * selected.outerHeight() >
+            list.outerHeight()
+          ) {
+            list.scrollTop(list.scrollTop() + selected.outerHeight());
+          }
+        }
+
+        return false;
+
+      case 27: // escape
+        list.find("li").removeClass("ui-timepicker-selected");
+        methods.hide();
+        break;
+
+      case 9: //tab
+        methods.hide();
+        break;
+
+      default:
+        return true;
+    }
+  }
+
+  /*
+	*	Time typeahead
+	*/
+  function _keyuphandler(e) {
+    var self = $(this);
+    var list = self.data("timepicker-list");
+    var settings = self.data("timepicker-settings");
+
+    if (!list || !_isVisible(list) || settings.disableTextInput) {
+      return true;
+    }
+
+    if (e.type === "paste" || e.type === "cut") {
+      setTimeout(function() {
+        if (settings.typeaheadHighlight) {
+          _setSelected(self, list);
+        } else {
+          list.hide();
+        }
+      }, 0);
+      return;
+    }
+
+    switch (e.keyCode) {
+      case 96: // numpad numerals
+      case 97:
+      case 98:
+      case 99:
+      case 100:
+      case 101:
+      case 102:
+      case 103:
+      case 104:
+      case 105:
+      case 48: // numerals
+      case 49:
+      case 50:
+      case 51:
+      case 52:
+      case 53:
+      case 54:
+      case 55:
+      case 56:
+      case 57:
+      case 65: // a
+      case 77: // m
+      case 80: // p
+      case 186: // colon
+      case 8: // backspace
+      case 46: // delete
+        if (settings.typeaheadHighlight) {
+          _setSelected(self, list);
+        } else {
+          list.hide();
+        }
+        break;
+    }
+  }
+
+  function _selectValue(self) {
+    var settings = self.data("timepicker-settings");
+    var list = self.data("timepicker-list");
+    var timeValue = null;
+
+    var cursor = list.find(".ui-timepicker-selected");
+
+    if (cursor.hasClass("ui-timepicker-disabled")) {
+      return false;
+    }
+
+    if (cursor.length) {
+      // selected value found
+      timeValue = cursor.data("time");
+    }
+
+    if (timeValue !== null) {
+      if (typeof timeValue != "string") {
+        timeValue = _int2time(timeValue, settings);
+      }
+
+      _setTimeValue(self, timeValue, "select");
+    }
+
+    return true;
+  }
+
+  function _int2duration(seconds, step) {
+    seconds = Math.abs(seconds);
+    var minutes = Math.round(seconds / 60),
+      duration = [],
+      hours,
+      mins;
+
+    if (minutes < 60) {
+      // Only show (x mins) under 1 hour
+      duration = [minutes, _lang.mins];
+    } else {
+      hours = Math.floor(minutes / 60);
+      mins = minutes % 60;
+
+      // Show decimal notation (eg: 1.5 hrs) for 30 minute steps
+      if (step == 30 && mins == 30) {
+        hours += _lang.decimal + 5;
+      }
+
+      duration.push(hours);
+      duration.push(hours == 1 ? _lang.hr : _lang.hrs);
+
+      // Show remainder minutes notation (eg: 1 hr 15 mins) for non-30 minute steps
+      // and only if there are remainder minutes to show
+      if (step != 30 && mins) {
+        duration.push(mins);
+        duration.push(_lang.mins);
+      }
+    }
+
+    return duration.join(" ");
+  }
+
+  function _int2time(timeInt, settings) {
+    if (typeof timeInt != "number") {
+      return null;
+    }
+
+    var seconds = parseInt(timeInt % 60),
+      minutes = parseInt((timeInt / 60) % 60),
+      hours = parseInt((timeInt / (60 * 60)) % 24);
+
+    var time = new Date(1970, 0, 2, hours, minutes, seconds, 0);
+
+    if (isNaN(time.getTime())) {
+      return null;
+    }
+
+    if ($.type(settings.timeFormat) === "function") {
+      return settings.timeFormat(time);
+    }
+
+    var output = "";
+    var hour, code;
+    for (var i = 0; i < settings.timeFormat.length; i++) {
+      code = settings.timeFormat.charAt(i);
+      switch (code) {
+        case "a":
+          output += time.getHours() > 11 ? _lang.pm : _lang.am;
+          break;
+
+        case "A":
+          output += time.getHours() > 11 ? _lang.PM : _lang.AM;
+          break;
+
+        case "g":
+          hour = time.getHours() % 12;
+          output += hour === 0 ? "12" : hour;
+          break;
+
+        case "G":
+          hour = time.getHours();
+          if (timeInt === _ONE_DAY) hour = settings.show2400 ? 24 : 0;
+          output += hour;
+          break;
+
+        case "h":
+          hour = time.getHours() % 12;
+
+          if (hour !== 0 && hour < 10) {
+            hour = "0" + hour;
+          }
+
+          output += hour === 0 ? "12" : hour;
+          break;
+
+        case "H":
+          hour = time.getHours();
+          if (timeInt === _ONE_DAY) hour = settings.show2400 ? 24 : 0;
+          output += hour > 9 ? hour : "0" + hour;
+          break;
+
+        case "i":
+          var minutes = time.getMinutes();
+          output += minutes > 9 ? minutes : "0" + minutes;
+          break;
+
+        case "s":
+          seconds = time.getSeconds();
+          output += seconds > 9 ? seconds : "0" + seconds;
+          break;
+
+        case "\\":
+          // escape character; add the next character and skip ahead
+          i++;
+          output += settings.timeFormat.charAt(i);
+          break;
+
+        default:
+          output += code;
+      }
+    }
+
+    return output;
+  }
+
+  function _time2int(timeString, settings) {
+    if (timeString === "" || timeString === null) return null;
+    if (typeof timeString == "object") {
+      return (
+        timeString.getHours() * 3600 +
+        timeString.getMinutes() * 60 +
+        timeString.getSeconds()
+      );
+    }
+    if (typeof timeString != "string") {
+      return timeString;
+    }
+
+    timeString = timeString.toLowerCase().replace(/[\s\.]/g, "");
+
+    // if the last character is an "a" or "p", add the "m"
+    if (timeString.slice(-1) == "a" || timeString.slice(-1) == "p") {
+      timeString += "m";
+    }
+
+    var ampmRegex =
+      "(" +
+      _lang.am.replace(".", "") +
+      "|" +
+      _lang.pm.replace(".", "") +
+      "|" +
+      _lang.AM.replace(".", "") +
+      "|" +
+      _lang.PM.replace(".", "") +
+      ")?";
+
+    // try to parse time input
+    var pattern = new RegExp(
+      "^" +
+        ampmRegex +
+        "([0-9]?[0-9])\\W?([0-5][0-9])?\\W?([0-5][0-9])?" +
+        ampmRegex +
+        "$"
+    );
+
+    var time = timeString.match(pattern);
+    if (!time) {
+      return null;
+    }
+
+    var hour = parseInt(time[2] * 1, 10);
+    var ampm = time[1] || time[5];
+    var hours = hour;
+    var minutes = time[3] * 1 || 0;
+    var seconds = time[4] * 1 || 0;
+
+    if (hour <= 12 && ampm) {
+      var isPm = ampm == _lang.pm || ampm == _lang.PM;
+
+      if (hour == 12) {
+        hours = isPm ? 12 : 0;
+      } else {
+        hours = hour + (isPm ? 12 : 0);
+      }
+    } else if (settings) {
+      var t = hour * 3600 + minutes * 60 + seconds;
+      if (t >= _ONE_DAY + (settings.show2400 ? 1 : 0)) {
+        if (settings.wrapHours === false) {
+          return null;
+        }
+
+        hours = hour % 24;
+      }
+    }
+
+    var timeInt = hours * 3600 + minutes * 60 + seconds;
+
+    // if no am/pm provided, intelligently guess based on the scrollDefault
+    if (
+      hour < 12 &&
+      !ampm &&
+      settings &&
+      settings._twelveHourTime &&
+      settings.scrollDefault
+    ) {
+      var delta = timeInt - settings.scrollDefault();
+      if (delta < 0 && delta >= _ONE_DAY / -2) {
+        timeInt = (timeInt + _ONE_DAY / 2) % _ONE_DAY;
+      }
+    }
+
+    return timeInt;
+  }
+
+  function _pad2(n) {
+    return ("0" + n).slice(-2);
+  }
+
+  function _moduloSeconds(seconds, settings) {
+    if (seconds == _ONE_DAY && settings.show2400) {
+      return seconds;
+    }
+
+    return seconds % _ONE_DAY;
+  }
+
+  // Plugin entry
+  $.fn.timepicker = function(method) {
+    if (!this.length) return this;
+    if (methods[method]) {
+      // check if this element is a timepicker
+      if (!this.hasClass("ui-timepicker-input")) {
+        return this;
+      }
+      return methods[method].apply(
+        this,
+        Array.prototype.slice.call(arguments, 1)
+      );
+    } else if (typeof method === "object" || !method) {
+      return methods.init.apply(this, arguments);
+    } else {
+      $.error("Method " + method + " does not exist on jQuery.timepicker");
+    }
+  };
+});

+ 1 - 0
app/Resources/public/assets/jt.timepicker/jquery.timepicker.min.css

@@ -0,0 +1 @@
+.ui-timepicker-wrapper{overflow-y:auto;max-height:150px;width:6.5em;background:#fff;border:1px solid #ddd;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);outline:0;z-index:10052;margin:0}.ui-timepicker-wrapper.ui-timepicker-with-duration{width:13em}.ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-30,.ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-60{width:11em}.ui-timepicker-list{margin:0;padding:0;list-style:none}.ui-timepicker-duration{margin-left:5px;color:#888}.ui-timepicker-list:hover .ui-timepicker-duration{color:#888}.ui-timepicker-list li{padding:3px 0 3px 5px;cursor:pointer;white-space:nowrap;color:#000;list-style:none;margin:0}.ui-timepicker-list:hover .ui-timepicker-selected{background:#fff;color:#000}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list .ui-timepicker-selected:hover{background:#1980EC;color:#fff}li.ui-timepicker-selected .ui-timepicker-duration,.ui-timepicker-list li:hover .ui-timepicker-duration{color:#ccc}.ui-timepicker-list li.ui-timepicker-disabled,.ui-timepicker-list li.ui-timepicker-disabled:hover,.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled{color:#888;cursor:default}.ui-timepicker-list li.ui-timepicker-disabled:hover,.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled{background:#f2f2f2}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 6 - 0
app/Resources/public/assets/jt.timepicker/jquery.timepicker.min.js


+ 27 - 0
app/Resources/public/assets/jt.timepicker/jt.timepicker.jquery.json

@@ -0,0 +1,27 @@
+{
+	"name": "jt.timepicker",
+	"version": "1.6.0",
+	"title": "jquery-timepicker",
+	"description": "A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.",
+	"author": {
+		"name": "Jon Thornton",
+		"email": "thornton.jon@gmail.com",
+		"url": "https://github.com/jonthornton"
+	},
+	"licenses": [
+		{
+			"type": "MIT",
+			"url": "MIT-LICENSE.txt"
+		}
+	],
+	"dependencies": {
+		"jquery": ">=1.7"
+	},
+	"keywords": [ "timepicker", "time", "picker", "ui", "calendar", "input", "form" ],
+	"homepage": "http://jonthornton.github.com/jquery-timepicker/",
+	"bugs": {
+		"url": "https://github.com/jonthornton/jquery-timepicker/issues"
+	},
+	"docs": "https://github.com/jonthornton/jquery-timepicker",
+	"download": "https://github.com/jonthornton/jquery-timepicker"
+}

+ 512 - 0
app/Resources/public/assets/jt.timepicker/lib/bootstrap-datepicker.css

@@ -0,0 +1,512 @@
+/*!
+ * Datepicker for Bootstrap
+ *
+ * Copyright 2012 Stefan Petre
+ * Improvements by Andrew Rowls
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+.datepicker {
+  padding: 4px;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  direction: ltr;
+  /*.dow {
+		border-top: 1px solid #ddd !important;
+	}*/
+}
+.datepicker-inline {
+  width: 220px;
+}
+.datepicker.datepicker-rtl {
+  direction: rtl;
+}
+.datepicker.datepicker-rtl table tr td span {
+  float: right;
+}
+.datepicker-dropdown {
+  top: 0;
+  left: 0;
+}
+.datepicker-dropdown:before {
+  content: '';
+  display: inline-block;
+  border-left: 7px solid transparent;
+  border-right: 7px solid transparent;
+  border-bottom: 7px solid #ccc;
+  border-top: 0;
+  border-bottom-color: rgba(0, 0, 0, 0.2);
+  position: absolute;
+}
+.datepicker-dropdown:after {
+  content: '';
+  display: inline-block;
+  border-left: 6px solid transparent;
+  border-right: 6px solid transparent;
+  border-bottom: 6px solid #ffffff;
+  border-top: 0;
+  position: absolute;
+}
+.datepicker-dropdown.datepicker-orient-left:before {
+  left: 6px;
+}
+.datepicker-dropdown.datepicker-orient-left:after {
+  left: 7px;
+}
+.datepicker-dropdown.datepicker-orient-right:before {
+  right: 6px;
+}
+.datepicker-dropdown.datepicker-orient-right:after {
+  right: 7px;
+}
+.datepicker-dropdown.datepicker-orient-top:before {
+  top: -7px;
+}
+.datepicker-dropdown.datepicker-orient-top:after {
+  top: -6px;
+}
+.datepicker-dropdown.datepicker-orient-bottom:before {
+  bottom: -7px;
+  border-bottom: 0;
+  border-top: 7px solid #999;
+}
+.datepicker-dropdown.datepicker-orient-bottom:after {
+  bottom: -6px;
+  border-bottom: 0;
+  border-top: 6px solid #ffffff;
+}
+.datepicker > div {
+  display: none;
+}
+.datepicker.days div.datepicker-days {
+  display: block;
+}
+.datepicker.months div.datepicker-months {
+  display: block;
+}
+.datepicker.years div.datepicker-years {
+  display: block;
+}
+.datepicker table {
+  margin: 0;
+  -webkit-touch-callout: none;
+  -webkit-user-select: none;
+  -khtml-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+.datepicker td,
+.datepicker th {
+  text-align: center;
+  width: 20px;
+  height: 20px;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  border: none;
+}
+.table-striped .datepicker table tr td,
+.table-striped .datepicker table tr th {
+  background-color: transparent;
+}
+.datepicker table tr td.day:hover,
+.datepicker table tr td.day.focused {
+  background: #eeeeee;
+  cursor: pointer;
+}
+.datepicker table tr td.old,
+.datepicker table tr td.new {
+  color: #999999;
+}
+.datepicker table tr td.disabled,
+.datepicker table tr td.disabled:hover {
+  background: none;
+  color: #999999;
+  cursor: default;
+}
+.datepicker table tr td.today,
+.datepicker table tr td.today:hover,
+.datepicker table tr td.today.disabled,
+.datepicker table tr td.today.disabled:hover {
+  background-color: #fde19a;
+  background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
+  background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
+  background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
+  background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
+  background-image: linear-gradient(top, #fdd49a, #fdf59a);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
+  border-color: #fdf59a #fdf59a #fbed50;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #000;
+}
+.datepicker table tr td.today:hover,
+.datepicker table tr td.today:hover:hover,
+.datepicker table tr td.today.disabled:hover,
+.datepicker table tr td.today.disabled:hover:hover,
+.datepicker table tr td.today:active,
+.datepicker table tr td.today:hover:active,
+.datepicker table tr td.today.disabled:active,
+.datepicker table tr td.today.disabled:hover:active,
+.datepicker table tr td.today.active,
+.datepicker table tr td.today:hover.active,
+.datepicker table tr td.today.disabled.active,
+.datepicker table tr td.today.disabled:hover.active,
+.datepicker table tr td.today.disabled,
+.datepicker table tr td.today:hover.disabled,
+.datepicker table tr td.today.disabled.disabled,
+.datepicker table tr td.today.disabled:hover.disabled,
+.datepicker table tr td.today[disabled],
+.datepicker table tr td.today:hover[disabled],
+.datepicker table tr td.today.disabled[disabled],
+.datepicker table tr td.today.disabled:hover[disabled] {
+  background-color: #fdf59a;
+}
+.datepicker table tr td.today:active,
+.datepicker table tr td.today:hover:active,
+.datepicker table tr td.today.disabled:active,
+.datepicker table tr td.today.disabled:hover:active,
+.datepicker table tr td.today.active,
+.datepicker table tr td.today:hover.active,
+.datepicker table tr td.today.disabled.active,
+.datepicker table tr td.today.disabled:hover.active {
+  background-color: #fbf069 \9;
+}
+.datepicker table tr td.today:hover:hover {
+  color: #000;
+}
+.datepicker table tr td.today.active:hover {
+  color: #fff;
+}
+.datepicker table tr td.range,
+.datepicker table tr td.range:hover,
+.datepicker table tr td.range.disabled,
+.datepicker table tr td.range.disabled:hover {
+  background: #eeeeee;
+  -webkit-border-radius: 0;
+  -moz-border-radius: 0;
+  border-radius: 0;
+}
+.datepicker table tr td.range.today,
+.datepicker table tr td.range.today:hover,
+.datepicker table tr td.range.today.disabled,
+.datepicker table tr td.range.today.disabled:hover {
+  background-color: #f3d17a;
+  background-image: -moz-linear-gradient(top, #f3c17a, #f3e97a);
+  background-image: -ms-linear-gradient(top, #f3c17a, #f3e97a);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3c17a), to(#f3e97a));
+  background-image: -webkit-linear-gradient(top, #f3c17a, #f3e97a);
+  background-image: -o-linear-gradient(top, #f3c17a, #f3e97a);
+  background-image: linear-gradient(top, #f3c17a, #f3e97a);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0);
+  border-color: #f3e97a #f3e97a #edde34;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  -webkit-border-radius: 0;
+  -moz-border-radius: 0;
+  border-radius: 0;
+}
+.datepicker table tr td.range.today:hover,
+.datepicker table tr td.range.today:hover:hover,
+.datepicker table tr td.range.today.disabled:hover,
+.datepicker table tr td.range.today.disabled:hover:hover,
+.datepicker table tr td.range.today:active,
+.datepicker table tr td.range.today:hover:active,
+.datepicker table tr td.range.today.disabled:active,
+.datepicker table tr td.range.today.disabled:hover:active,
+.datepicker table tr td.range.today.active,
+.datepicker table tr td.range.today:hover.active,
+.datepicker table tr td.range.today.disabled.active,
+.datepicker table tr td.range.today.disabled:hover.active,
+.datepicker table tr td.range.today.disabled,
+.datepicker table tr td.range.today:hover.disabled,
+.datepicker table tr td.range.today.disabled.disabled,
+.datepicker table tr td.range.today.disabled:hover.disabled,
+.datepicker table tr td.range.today[disabled],
+.datepicker table tr td.range.today:hover[disabled],
+.datepicker table tr td.range.today.disabled[disabled],
+.datepicker table tr td.range.today.disabled:hover[disabled] {
+  background-color: #f3e97a;
+}
+.datepicker table tr td.range.today:active,
+.datepicker table tr td.range.today:hover:active,
+.datepicker table tr td.range.today.disabled:active,
+.datepicker table tr td.range.today.disabled:hover:active,
+.datepicker table tr td.range.today.active,
+.datepicker table tr td.range.today:hover.active,
+.datepicker table tr td.range.today.disabled.active,
+.datepicker table tr td.range.today.disabled:hover.active {
+  background-color: #efe24b \9;
+}
+.datepicker table tr td.selected,
+.datepicker table tr td.selected:hover,
+.datepicker table tr td.selected.disabled,
+.datepicker table tr td.selected.disabled:hover {
+  background-color: #9e9e9e;
+  background-image: -moz-linear-gradient(top, #b3b3b3, #808080);
+  background-image: -ms-linear-gradient(top, #b3b3b3, #808080);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b3b3b3), to(#808080));
+  background-image: -webkit-linear-gradient(top, #b3b3b3, #808080);
+  background-image: -o-linear-gradient(top, #b3b3b3, #808080);
+  background-image: linear-gradient(top, #b3b3b3, #808080);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0);
+  border-color: #808080 #808080 #595959;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #fff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.datepicker table tr td.selected:hover,
+.datepicker table tr td.selected:hover:hover,
+.datepicker table tr td.selected.disabled:hover,
+.datepicker table tr td.selected.disabled:hover:hover,
+.datepicker table tr td.selected:active,
+.datepicker table tr td.selected:hover:active,
+.datepicker table tr td.selected.disabled:active,
+.datepicker table tr td.selected.disabled:hover:active,
+.datepicker table tr td.selected.active,
+.datepicker table tr td.selected:hover.active,
+.datepicker table tr td.selected.disabled.active,
+.datepicker table tr td.selected.disabled:hover.active,
+.datepicker table tr td.selected.disabled,
+.datepicker table tr td.selected:hover.disabled,
+.datepicker table tr td.selected.disabled.disabled,
+.datepicker table tr td.selected.disabled:hover.disabled,
+.datepicker table tr td.selected[disabled],
+.datepicker table tr td.selected:hover[disabled],
+.datepicker table tr td.selected.disabled[disabled],
+.datepicker table tr td.selected.disabled:hover[disabled] {
+  background-color: #808080;
+}
+.datepicker table tr td.selected:active,
+.datepicker table tr td.selected:hover:active,
+.datepicker table tr td.selected.disabled:active,
+.datepicker table tr td.selected.disabled:hover:active,
+.datepicker table tr td.selected.active,
+.datepicker table tr td.selected:hover.active,
+.datepicker table tr td.selected.disabled.active,
+.datepicker table tr td.selected.disabled:hover.active {
+  background-color: #666666 \9;
+}
+.datepicker table tr td.active,
+.datepicker table tr td.active:hover,
+.datepicker table tr td.active.disabled,
+.datepicker table tr td.active.disabled:hover {
+  background-color: #006dcc;
+  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
+  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
+  background-image: linear-gradient(top, #0088cc, #0044cc);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
+  border-color: #0044cc #0044cc #002a80;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #fff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.datepicker table tr td.active:hover,
+.datepicker table tr td.active:hover:hover,
+.datepicker table tr td.active.disabled:hover,
+.datepicker table tr td.active.disabled:hover:hover,
+.datepicker table tr td.active:active,
+.datepicker table tr td.active:hover:active,
+.datepicker table tr td.active.disabled:active,
+.datepicker table tr td.active.disabled:hover:active,
+.datepicker table tr td.active.active,
+.datepicker table tr td.active:hover.active,
+.datepicker table tr td.active.disabled.active,
+.datepicker table tr td.active.disabled:hover.active,
+.datepicker table tr td.active.disabled,
+.datepicker table tr td.active:hover.disabled,
+.datepicker table tr td.active.disabled.disabled,
+.datepicker table tr td.active.disabled:hover.disabled,
+.datepicker table tr td.active[disabled],
+.datepicker table tr td.active:hover[disabled],
+.datepicker table tr td.active.disabled[disabled],
+.datepicker table tr td.active.disabled:hover[disabled] {
+  background-color: #0044cc;
+}
+.datepicker table tr td.active:active,
+.datepicker table tr td.active:hover:active,
+.datepicker table tr td.active.disabled:active,
+.datepicker table tr td.active.disabled:hover:active,
+.datepicker table tr td.active.active,
+.datepicker table tr td.active:hover.active,
+.datepicker table tr td.active.disabled.active,
+.datepicker table tr td.active.disabled:hover.active {
+  background-color: #003399 \9;
+}
+.datepicker table tr td span {
+  display: block;
+  width: 23%;
+  height: 54px;
+  line-height: 54px;
+  float: left;
+  margin: 1%;
+  cursor: pointer;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+}
+.datepicker table tr td span:hover {
+  background: #eeeeee;
+}
+.datepicker table tr td span.disabled,
+.datepicker table tr td span.disabled:hover {
+  background: none;
+  color: #999999;
+  cursor: default;
+}
+.datepicker table tr td span.active,
+.datepicker table tr td span.active:hover,
+.datepicker table tr td span.active.disabled,
+.datepicker table tr td span.active.disabled:hover {
+  background-color: #006dcc;
+  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
+  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
+  background-image: linear-gradient(top, #0088cc, #0044cc);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
+  border-color: #0044cc #0044cc #002a80;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #fff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.datepicker table tr td span.active:hover,
+.datepicker table tr td span.active:hover:hover,
+.datepicker table tr td span.active.disabled:hover,
+.datepicker table tr td span.active.disabled:hover:hover,
+.datepicker table tr td span.active:active,
+.datepicker table tr td span.active:hover:active,
+.datepicker table tr td span.active.disabled:active,
+.datepicker table tr td span.active.disabled:hover:active,
+.datepicker table tr td span.active.active,
+.datepicker table tr td span.active:hover.active,
+.datepicker table tr td span.active.disabled.active,
+.datepicker table tr td span.active.disabled:hover.active,
+.datepicker table tr td span.active.disabled,
+.datepicker table tr td span.active:hover.disabled,
+.datepicker table tr td span.active.disabled.disabled,
+.datepicker table tr td span.active.disabled:hover.disabled,
+.datepicker table tr td span.active[disabled],
+.datepicker table tr td span.active:hover[disabled],
+.datepicker table tr td span.active.disabled[disabled],
+.datepicker table tr td span.active.disabled:hover[disabled] {
+  background-color: #0044cc;
+}
+.datepicker table tr td span.active:active,
+.datepicker table tr td span.active:hover:active,
+.datepicker table tr td span.active.disabled:active,
+.datepicker table tr td span.active.disabled:hover:active,
+.datepicker table tr td span.active.active,
+.datepicker table tr td span.active:hover.active,
+.datepicker table tr td span.active.disabled.active,
+.datepicker table tr td span.active.disabled:hover.active {
+  background-color: #003399 \9;
+}
+.datepicker table tr td span.old,
+.datepicker table tr td span.new {
+  color: #999999;
+}
+.datepicker th.datepicker-switch {
+  width: 145px;
+}
+.datepicker thead tr:first-child th,
+.datepicker tfoot tr th {
+  cursor: pointer;
+}
+.datepicker thead tr:first-child th:hover,
+.datepicker tfoot tr th:hover {
+  background: #eeeeee;
+}
+.datepicker .cw {
+  font-size: 10px;
+  width: 12px;
+  padding: 0 2px 0 5px;
+  vertical-align: middle;
+}
+.datepicker thead tr:first-child th.cw {
+  cursor: default;
+  background-color: transparent;
+}
+.input-append.date .add-on i,
+.input-prepend.date .add-on i {
+  cursor: pointer;
+  width: 16px;
+  height: 16px;
+}
+.input-daterange input {
+  text-align: center;
+}
+.input-daterange input:first-child {
+  -webkit-border-radius: 3px 0 0 3px;
+  -moz-border-radius: 3px 0 0 3px;
+  border-radius: 3px 0 0 3px;
+}
+.input-daterange input:last-child {
+  -webkit-border-radius: 0 3px 3px 0;
+  -moz-border-radius: 0 3px 3px 0;
+  border-radius: 0 3px 3px 0;
+}
+.input-daterange .add-on {
+  display: inline-block;
+  width: auto;
+  min-width: 16px;
+  height: 20px;
+  padding: 4px 5px;
+  font-weight: normal;
+  line-height: 20px;
+  text-align: center;
+  text-shadow: 0 1px 0 #ffffff;
+  vertical-align: middle;
+  background-color: #eeeeee;
+  border: 1px solid #ccc;
+  margin-left: -5px;
+  margin-right: -5px;
+}
+.datepicker.dropdown-menu {
+  position: absolute;
+  top: 100%;
+  left: 0;
+  z-index: 1000;
+  float: left;
+  display: none;
+  min-width: 160px;
+  list-style: none;
+  background-color: #ffffff;
+  border: 1px solid #ccc;
+  border: 1px solid rgba(0, 0, 0, 0.2);
+  -webkit-border-radius: 5px;
+  -moz-border-radius: 5px;
+  border-radius: 5px;
+  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+  -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+  -webkit-background-clip: padding-box;
+  -moz-background-clip: padding;
+  background-clip: padding-box;
+  *border-right-width: 2px;
+  *border-bottom-width: 2px;
+  color: #333333;
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 13px;
+  line-height: 20px;
+}
+.datepicker.dropdown-menu th,
+.datepicker.dropdown-menu td {
+  padding: 4px 5px;
+}

+ 1671 - 0
app/Resources/public/assets/jt.timepicker/lib/bootstrap-datepicker.js

@@ -0,0 +1,1671 @@
+/* =========================================================
+ * bootstrap-datepicker.js
+ * Repo: https://github.com/eternicode/bootstrap-datepicker/
+ * Demo: http://eternicode.github.io/bootstrap-datepicker/
+ * Docs: http://bootstrap-datepicker.readthedocs.org/
+ * Forked from http://www.eyecon.ro/bootstrap-datepicker
+ * =========================================================
+ * Started by Stefan Petre; improvements by Andrew Rowls + contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================= */
+
+(function($, undefined){
+
+	var $window = $(window);
+
+	function UTCDate(){
+		return new Date(Date.UTC.apply(Date, arguments));
+	}
+	function UTCToday(){
+		var today = new Date();
+		return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
+	}
+	function alias(method){
+		return function(){
+			return this[method].apply(this, arguments);
+		};
+	}
+
+	var DateArray = (function(){
+		var extras = {
+			get: function(i){
+				return this.slice(i)[0];
+			},
+			contains: function(d){
+				// Array.indexOf is not cross-browser;
+				// $.inArray doesn't work with Dates
+				var val = d && d.valueOf();
+				for (var i=0, l=this.length; i < l; i++)
+					if (this[i].valueOf() === val)
+						return i;
+				return -1;
+			},
+			remove: function(i){
+				this.splice(i,1);
+			},
+			replace: function(new_array){
+				if (!new_array)
+					return;
+				if (!$.isArray(new_array))
+					new_array = [new_array];
+				this.clear();
+				this.push.apply(this, new_array);
+			},
+			clear: function(){
+				this.splice(0);
+			},
+			copy: function(){
+				var a = new DateArray();
+				a.replace(this);
+				return a;
+			}
+		};
+
+		return function(){
+			var a = [];
+			a.push.apply(a, arguments);
+			$.extend(a, extras);
+			return a;
+		};
+	})();
+
+
+	// Picker object
+
+	var Datepicker = function(element, options){
+		this.dates = new DateArray();
+		this.viewDate = UTCToday();
+		this.focusDate = null;
+
+		this._process_options(options);
+
+		this.element = $(element);
+		this.isInline = false;
+		this.isInput = this.element.is('input');
+		this.component = this.element.is('.date') ? this.element.find('.add-on, .input-group-addon, .btn') : false;
+		this.hasInput = this.component && this.element.find('input').length;
+		if (this.component && this.component.length === 0)
+			this.component = false;
+
+		this.picker = $(DPGlobal.template);
+		this._buildEvents();
+		this._attachEvents();
+
+		if (this.isInline){
+			this.picker.addClass('datepicker-inline').appendTo(this.element);
+		}
+		else {
+			this.picker.addClass('datepicker-dropdown dropdown-menu');
+		}
+
+		if (this.o.rtl){
+			this.picker.addClass('datepicker-rtl');
+		}
+
+		this.viewMode = this.o.startView;
+
+		if (this.o.calendarWeeks)
+			this.picker.find('tfoot th.today')
+						.attr('colspan', function(i, val){
+							return parseInt(val) + 1;
+						});
+
+		this._allow_update = false;
+
+		this.setStartDate(this._o.startDate);
+		this.setEndDate(this._o.endDate);
+		this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);
+
+		this.fillDow();
+		this.fillMonths();
+
+		this._allow_update = true;
+
+		this.update();
+		this.showMode();
+
+		if (this.isInline){
+			this.show();
+		}
+	};
+
+	Datepicker.prototype = {
+		constructor: Datepicker,
+
+		_process_options: function(opts){
+			// Store raw options for reference
+			this._o = $.extend({}, this._o, opts);
+			// Processed options
+			var o = this.o = $.extend({}, this._o);
+
+			// Check if "de-DE" style date is available, if not language should
+			// fallback to 2 letter code eg "de"
+			var lang = o.language;
+			if (!dates[lang]){
+				lang = lang.split('-')[0];
+				if (!dates[lang])
+					lang = defaults.language;
+			}
+			o.language = lang;
+
+			switch (o.startView){
+				case 2:
+				case 'decade':
+					o.startView = 2;
+					break;
+				case 1:
+				case 'year':
+					o.startView = 1;
+					break;
+				default:
+					o.startView = 0;
+			}
+
+			switch (o.minViewMode){
+				case 1:
+				case 'months':
+					o.minViewMode = 1;
+					break;
+				case 2:
+				case 'years':
+					o.minViewMode = 2;
+					break;
+				default:
+					o.minViewMode = 0;
+			}
+
+			o.startView = Math.max(o.startView, o.minViewMode);
+
+			// true, false, or Number > 0
+			if (o.multidate !== true){
+				o.multidate = Number(o.multidate) || false;
+				if (o.multidate !== false)
+					o.multidate = Math.max(0, o.multidate);
+				else
+					o.multidate = 1;
+			}
+			o.multidateSeparator = String(o.multidateSeparator);
+
+			o.weekStart %= 7;
+			o.weekEnd = ((o.weekStart + 6) % 7);
+
+			var format = DPGlobal.parseFormat(o.format);
+			if (o.startDate !== -Infinity){
+				if (!!o.startDate){
+					if (o.startDate instanceof Date)
+						o.startDate = this._local_to_utc(this._zero_time(o.startDate));
+					else
+						o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);
+				}
+				else {
+					o.startDate = -Infinity;
+				}
+			}
+			if (o.endDate !== Infinity){
+				if (!!o.endDate){
+					if (o.endDate instanceof Date)
+						o.endDate = this._local_to_utc(this._zero_time(o.endDate));
+					else
+						o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);
+				}
+				else {
+					o.endDate = Infinity;
+				}
+			}
+
+			o.daysOfWeekDisabled = o.daysOfWeekDisabled||[];
+			if (!$.isArray(o.daysOfWeekDisabled))
+				o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/);
+			o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function(d){
+				return parseInt(d, 10);
+			});
+
+			var plc = String(o.orientation).toLowerCase().split(/\s+/g),
+				_plc = o.orientation.toLowerCase();
+			plc = $.grep(plc, function(word){
+				return (/^auto|left|right|top|bottom$/).test(word);
+			});
+			o.orientation = {x: 'auto', y: 'auto'};
+			if (!_plc || _plc === 'auto')
+				; // no action
+			else if (plc.length === 1){
+				switch (plc[0]){
+					case 'top':
+					case 'bottom':
+						o.orientation.y = plc[0];
+						break;
+					case 'left':
+					case 'right':
+						o.orientation.x = plc[0];
+						break;
+				}
+			}
+			else {
+				_plc = $.grep(plc, function(word){
+					return (/^left|right$/).test(word);
+				});
+				o.orientation.x = _plc[0] || 'auto';
+
+				_plc = $.grep(plc, function(word){
+					return (/^top|bottom$/).test(word);
+				});
+				o.orientation.y = _plc[0] || 'auto';
+			}
+		},
+		_events: [],
+		_secondaryEvents: [],
+		_applyEvents: function(evs){
+			for (var i=0, el, ch, ev; i < evs.length; i++){
+				el = evs[i][0];
+				if (evs[i].length === 2){
+					ch = undefined;
+					ev = evs[i][1];
+				}
+				else if (evs[i].length === 3){
+					ch = evs[i][1];
+					ev = evs[i][2];
+				}
+				el.on(ev, ch);
+			}
+		},
+		_unapplyEvents: function(evs){
+			for (var i=0, el, ev, ch; i < evs.length; i++){
+				el = evs[i][0];
+				if (evs[i].length === 2){
+					ch = undefined;
+					ev = evs[i][1];
+				}
+				else if (evs[i].length === 3){
+					ch = evs[i][1];
+					ev = evs[i][2];
+				}
+				el.off(ev, ch);
+			}
+		},
+		_buildEvents: function(){
+			if (this.isInput){ // single input
+				this._events = [
+					[this.element, {
+						focus: $.proxy(this.show, this),
+						keyup: $.proxy(function(e){
+							if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
+								this.update();
+						}, this),
+						keydown: $.proxy(this.keydown, this)
+					}]
+				];
+			}
+			else if (this.component && this.hasInput){ // component: input + button
+				this._events = [
+					// For components that are not readonly, allow keyboard nav
+					[this.element.find('input'), {
+						focus: $.proxy(this.show, this),
+						keyup: $.proxy(function(e){
+							if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
+								this.update();
+						}, this),
+						keydown: $.proxy(this.keydown, this)
+					}],
+					[this.component, {
+						click: $.proxy(this.show, this)
+					}]
+				];
+			}
+			else if (this.element.is('div')){  // inline datepicker
+				this.isInline = true;
+			}
+			else {
+				this._events = [
+					[this.element, {
+						click: $.proxy(this.show, this)
+					}]
+				];
+			}
+			this._events.push(
+				// Component: listen for blur on element descendants
+				[this.element, '*', {
+					blur: $.proxy(function(e){
+						this._focused_from = e.target;
+					}, this)
+				}],
+				// Input: listen for blur on element
+				[this.element, {
+					blur: $.proxy(function(e){
+						this._focused_from = e.target;
+					}, this)
+				}]
+			);
+
+			this._secondaryEvents = [
+				[this.picker, {
+					click: $.proxy(this.click, this)
+				}],
+				[$(window), {
+					resize: $.proxy(this.place, this)
+				}],
+				[$(document), {
+					'mousedown touchstart': $.proxy(function(e){
+						// Clicked outside the datepicker, hide it
+						if (!(
+							this.element.is(e.target) ||
+							this.element.find(e.target).length ||
+							this.picker.is(e.target) ||
+							this.picker.find(e.target).length
+						)){
+							this.hide();
+						}
+					}, this)
+				}]
+			];
+		},
+		_attachEvents: function(){
+			this._detachEvents();
+			this._applyEvents(this._events);
+		},
+		_detachEvents: function(){
+			this._unapplyEvents(this._events);
+		},
+		_attachSecondaryEvents: function(){
+			this._detachSecondaryEvents();
+			this._applyEvents(this._secondaryEvents);
+		},
+		_detachSecondaryEvents: function(){
+			this._unapplyEvents(this._secondaryEvents);
+		},
+		_trigger: function(event, altdate){
+			var date = altdate || this.dates.get(-1),
+				local_date = this._utc_to_local(date);
+
+			this.element.trigger({
+				type: event,
+				date: local_date,
+				dates: $.map(this.dates, this._utc_to_local),
+				format: $.proxy(function(ix, format){
+					if (arguments.length === 0){
+						ix = this.dates.length - 1;
+						format = this.o.format;
+					}
+					else if (typeof ix === 'string'){
+						format = ix;
+						ix = this.dates.length - 1;
+					}
+					format = format || this.o.format;
+					var date = this.dates.get(ix);
+					return DPGlobal.formatDate(date, format, this.o.language);
+				}, this)
+			});
+		},
+
+		show: function(){
+			if (!this.isInline)
+				this.picker.appendTo('body');
+			this.picker.show();
+			this.place();
+			this._attachSecondaryEvents();
+			this._trigger('show');
+		},
+
+		hide: function(){
+			if (this.isInline)
+				return;
+			if (!this.picker.is(':visible'))
+				return;
+			this.focusDate = null;
+			this.picker.hide().detach();
+			this._detachSecondaryEvents();
+			this.viewMode = this.o.startView;
+			this.showMode();
+
+			if (
+				this.o.forceParse &&
+				(
+					this.isInput && this.element.val() ||
+					this.hasInput && this.element.find('input').val()
+				)
+			)
+				this.setValue();
+			this._trigger('hide');
+		},
+
+		remove: function(){
+			this.hide();
+			this._detachEvents();
+			this._detachSecondaryEvents();
+			this.picker.remove();
+			delete this.element.data().datepicker;
+			if (!this.isInput){
+				delete this.element.data().date;
+			}
+		},
+
+		_utc_to_local: function(utc){
+			return utc && new Date(utc.getTime() + (utc.getTimezoneOffset()*60000));
+		},
+		_local_to_utc: function(local){
+			return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));
+		},
+		_zero_time: function(local){
+			return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());
+		},
+		_zero_utc_time: function(utc){
+			return utc && new Date(Date.UTC(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()));
+		},
+
+		getDates: function(){
+			return $.map(this.dates, this._utc_to_local);
+		},
+
+		getUTCDates: function(){
+			return $.map(this.dates, function(d){
+				return new Date(d);
+			});
+		},
+
+		getDate: function(){
+			return this._utc_to_local(this.getUTCDate());
+		},
+
+		getUTCDate: function(){
+			return new Date(this.dates.get(-1));
+		},
+
+		setDates: function(){
+			var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
+			this.update.apply(this, args);
+			this._trigger('changeDate');
+			this.setValue();
+		},
+
+		setUTCDates: function(){
+			var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
+			this.update.apply(this, $.map(args, this._utc_to_local));
+			this._trigger('changeDate');
+			this.setValue();
+		},
+
+		setDate: alias('setDates'),
+		setUTCDate: alias('setUTCDates'),
+
+		setValue: function(){
+			var formatted = this.getFormattedDate();
+			if (!this.isInput){
+				if (this.component){
+					this.element.find('input').val(formatted).change();
+				}
+			}
+			else {
+				this.element.val(formatted).change();
+			}
+		},
+
+		getFormattedDate: function(format){
+			if (format === undefined)
+				format = this.o.format;
+
+			var lang = this.o.language;
+			return $.map(this.dates, function(d){
+				return DPGlobal.formatDate(d, format, lang);
+			}).join(this.o.multidateSeparator);
+		},
+
+		setStartDate: function(startDate){
+			this._process_options({startDate: startDate});
+			this.update();
+			this.updateNavArrows();
+		},
+
+		setEndDate: function(endDate){
+			this._process_options({endDate: endDate});
+			this.update();
+			this.updateNavArrows();
+		},
+
+		setDaysOfWeekDisabled: function(daysOfWeekDisabled){
+			this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
+			this.update();
+			this.updateNavArrows();
+		},
+
+		place: function(){
+			if (this.isInline)
+				return;
+			var calendarWidth = this.picker.outerWidth(),
+				calendarHeight = this.picker.outerHeight(),
+				visualPadding = 10,
+				windowWidth = $window.width(),
+				windowHeight = $window.height(),
+				scrollTop = $window.scrollTop();
+
+			var zIndex = parseInt(this.element.parents().filter(function(){
+					return $(this).css('z-index') !== 'auto';
+				}).first().css('z-index'))+10;
+			var offset = this.component ? this.component.parent().offset() : this.element.offset();
+			var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
+			var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
+			var left = offset.left,
+				top = offset.top;
+
+			this.picker.removeClass(
+				'datepicker-orient-top datepicker-orient-bottom '+
+				'datepicker-orient-right datepicker-orient-left'
+			);
+
+			if (this.o.orientation.x !== 'auto'){
+				this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
+				if (this.o.orientation.x === 'right')
+					left -= calendarWidth - width;
+			}
+			// auto x orientation is best-placement: if it crosses a window
+			// edge, fudge it sideways
+			else {
+				// Default to left
+				this.picker.addClass('datepicker-orient-left');
+				if (offset.left < 0)
+					left -= offset.left - visualPadding;
+				else if (offset.left + calendarWidth > windowWidth)
+					left = windowWidth - calendarWidth - visualPadding;
+			}
+
+			// auto y orientation is best-situation: top or bottom, no fudging,
+			// decision based on which shows more of the calendar
+			var yorient = this.o.orientation.y,
+				top_overflow, bottom_overflow;
+			if (yorient === 'auto'){
+				top_overflow = -scrollTop + offset.top - calendarHeight;
+				bottom_overflow = scrollTop + windowHeight - (offset.top + height + calendarHeight);
+				if (Math.max(top_overflow, bottom_overflow) === bottom_overflow)
+					yorient = 'top';
+				else
+					yorient = 'bottom';
+			}
+			this.picker.addClass('datepicker-orient-' + yorient);
+			if (yorient === 'top')
+				top += height;
+			else
+				top -= calendarHeight + parseInt(this.picker.css('padding-top'));
+
+			this.picker.css({
+				top: top,
+				left: left,
+				zIndex: zIndex
+			});
+		},
+
+		_allow_update: true,
+		update: function(){
+			if (!this._allow_update)
+				return;
+
+			var oldDates = this.dates.copy(),
+				dates = [],
+				fromArgs = false;
+			if (arguments.length){
+				$.each(arguments, $.proxy(function(i, date){
+					if (date instanceof Date)
+						date = this._local_to_utc(date);
+					dates.push(date);
+				}, this));
+				fromArgs = true;
+			}
+			else {
+				dates = this.isInput
+						? this.element.val()
+						: this.element.data('date') || this.element.find('input').val();
+				if (dates && this.o.multidate)
+					dates = dates.split(this.o.multidateSeparator);
+				else
+					dates = [dates];
+				delete this.element.data().date;
+			}
+
+			dates = $.map(dates, $.proxy(function(date){
+				return DPGlobal.parseDate(date, this.o.format, this.o.language);
+			}, this));
+			dates = $.grep(dates, $.proxy(function(date){
+				return (
+					date < this.o.startDate ||
+					date > this.o.endDate ||
+					!date
+				);
+			}, this), true);
+			this.dates.replace(dates);
+
+			if (this.dates.length)
+				this.viewDate = new Date(this.dates.get(-1));
+			else if (this.viewDate < this.o.startDate)
+				this.viewDate = new Date(this.o.startDate);
+			else if (this.viewDate > this.o.endDate)
+				this.viewDate = new Date(this.o.endDate);
+
+			if (fromArgs){
+				// setting date by clicking
+				this.setValue();
+			}
+			else if (dates.length){
+				// setting date by typing
+				if (String(oldDates) !== String(this.dates))
+					this._trigger('changeDate');
+			}
+			if (!this.dates.length && oldDates.length)
+				this._trigger('clearDate');
+
+			this.fill();
+		},
+
+		fillDow: function(){
+			var dowCnt = this.o.weekStart,
+				html = '<tr>';
+			if (this.o.calendarWeeks){
+				var cell = '<th class="cw">&nbsp;</th>';
+				html += cell;
+				this.picker.find('.datepicker-days thead tr:first-child').prepend(cell);
+			}
+			while (dowCnt < this.o.weekStart + 7){
+				html += '<th class="dow">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>';
+			}
+			html += '</tr>';
+			this.picker.find('.datepicker-days thead').append(html);
+		},
+
+		fillMonths: function(){
+			var html = '',
+			i = 0;
+			while (i < 12){
+				html += '<span class="month">'+dates[this.o.language].monthsShort[i++]+'</span>';
+			}
+			this.picker.find('.datepicker-months td').html(html);
+		},
+
+		setRange: function(range){
+			if (!range || !range.length)
+				delete this.range;
+			else
+				this.range = $.map(range, function(d){
+					return d.valueOf();
+				});
+			this.fill();
+		},
+
+		getClassNames: function(date){
+			var cls = [],
+				year = this.viewDate.getUTCFullYear(),
+				month = this.viewDate.getUTCMonth(),
+				today = new Date();
+			if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){
+				cls.push('old');
+			}
+			else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){
+				cls.push('new');
+			}
+			if (this.focusDate && date.valueOf() === this.focusDate.valueOf())
+				cls.push('focused');
+			// Compare internal UTC date with local today, not UTC today
+			if (this.o.todayHighlight &&
+				date.getUTCFullYear() === today.getFullYear() &&
+				date.getUTCMonth() === today.getMonth() &&
+				date.getUTCDate() === today.getDate()){
+				cls.push('today');
+			}
+			if (this.dates.contains(date) !== -1)
+				cls.push('active');
+			if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate ||
+				$.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1){
+				cls.push('disabled');
+			}
+			if (this.range){
+				if (date > this.range[0] && date < this.range[this.range.length-1]){
+					cls.push('range');
+				}
+				if ($.inArray(date.valueOf(), this.range) !== -1){
+					cls.push('selected');
+				}
+			}
+			return cls;
+		},
+
+		fill: function(){
+			var d = new Date(this.viewDate),
+				year = d.getUTCFullYear(),
+				month = d.getUTCMonth(),
+				startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
+				startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
+				endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
+				endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
+				todaytxt = dates[this.o.language].today || dates['en'].today || '',
+				cleartxt = dates[this.o.language].clear || dates['en'].clear || '',
+				tooltip;
+			this.picker.find('.datepicker-days thead th.datepicker-switch')
+						.text(dates[this.o.language].months[month]+' '+year);
+			this.picker.find('tfoot th.today')
+						.text(todaytxt)
+						.toggle(this.o.todayBtn !== false);
+			this.picker.find('tfoot th.clear')
+						.text(cleartxt)
+						.toggle(this.o.clearBtn !== false);
+			this.updateNavArrows();
+			this.fillMonths();
+			var prevMonth = UTCDate(year, month-1, 28),
+				day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
+			prevMonth.setUTCDate(day);
+			prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);
+			var nextMonth = new Date(prevMonth);
+			nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
+			nextMonth = nextMonth.valueOf();
+			var html = [];
+			var clsName;
+			while (prevMonth.valueOf() < nextMonth){
+				if (prevMonth.getUTCDay() === this.o.weekStart){
+					html.push('<tr>');
+					if (this.o.calendarWeeks){
+						// ISO 8601: First week contains first thursday.
+						// ISO also states week starts on Monday, but we can be more abstract here.
+						var
+							// Start of current week: based on weekstart/current date
+							ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5),
+							// Thursday of this week
+							th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
+							// First Thursday of year, year from thursday
+							yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7*864e5),
+							// Calendar week: ms between thursdays, div ms per day, div 7 days
+							calWeek =  (th - yth) / 864e5 / 7 + 1;
+						html.push('<td class="cw">'+ calWeek +'</td>');
+
+					}
+				}
+				clsName = this.getClassNames(prevMonth);
+				clsName.push('day');
+
+				if (this.o.beforeShowDay !== $.noop){
+					var before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
+					if (before === undefined)
+						before = {};
+					else if (typeof(before) === 'boolean')
+						before = {enabled: before};
+					else if (typeof(before) === 'string')
+						before = {classes: before};
+					if (before.enabled === false)
+						clsName.push('disabled');
+					if (before.classes)
+						clsName = clsName.concat(before.classes.split(/\s+/));
+					if (before.tooltip)
+						tooltip = before.tooltip;
+				}
+
+				clsName = $.unique(clsName);
+				html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>');
+				if (prevMonth.getUTCDay() === this.o.weekEnd){
+					html.push('</tr>');
+				}
+				prevMonth.setUTCDate(prevMonth.getUTCDate()+1);
+			}
+			this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
+
+			var months = this.picker.find('.datepicker-months')
+						.find('th:eq(1)')
+							.text(year)
+							.end()
+						.find('span').removeClass('active');
+
+			$.each(this.dates, function(i, d){
+				if (d.getUTCFullYear() === year)
+					months.eq(d.getUTCMonth()).addClass('active');
+			});
+
+			if (year < startYear || year > endYear){
+				months.addClass('disabled');
+			}
+			if (year === startYear){
+				months.slice(0, startMonth).addClass('disabled');
+			}
+			if (year === endYear){
+				months.slice(endMonth+1).addClass('disabled');
+			}
+
+			html = '';
+			year = parseInt(year/10, 10) * 10;
+			var yearCont = this.picker.find('.datepicker-years')
+								.find('th:eq(1)')
+									.text(year + '-' + (year + 9))
+									.end()
+								.find('td');
+			year -= 1;
+			var years = $.map(this.dates, function(d){
+					return d.getUTCFullYear();
+				}),
+				classes;
+			for (var i = -1; i < 11; i++){
+				classes = ['year'];
+				if (i === -1)
+					classes.push('old');
+				else if (i === 10)
+					classes.push('new');
+				if ($.inArray(year, years) !== -1)
+					classes.push('active');
+				if (year < startYear || year > endYear)
+					classes.push('disabled');
+				html += '<span class="' + classes.join(' ') + '">'+year+'</span>';
+				year += 1;
+			}
+			yearCont.html(html);
+		},
+
+		updateNavArrows: function(){
+			if (!this._allow_update)
+				return;
+
+			var d = new Date(this.viewDate),
+				year = d.getUTCFullYear(),
+				month = d.getUTCMonth();
+			switch (this.viewMode){
+				case 0:
+					if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()){
+						this.picker.find('.prev').css({visibility: 'hidden'});
+					}
+					else {
+						this.picker.find('.prev').css({visibility: 'visible'});
+					}
+					if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()){
+						this.picker.find('.next').css({visibility: 'hidden'});
+					}
+					else {
+						this.picker.find('.next').css({visibility: 'visible'});
+					}
+					break;
+				case 1:
+				case 2:
+					if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear()){
+						this.picker.find('.prev').css({visibility: 'hidden'});
+					}
+					else {
+						this.picker.find('.prev').css({visibility: 'visible'});
+					}
+					if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear()){
+						this.picker.find('.next').css({visibility: 'hidden'});
+					}
+					else {
+						this.picker.find('.next').css({visibility: 'visible'});
+					}
+					break;
+			}
+		},
+
+		click: function(e){
+			e.preventDefault();
+			var target = $(e.target).closest('span, td, th'),
+				year, month, day;
+			if (target.length === 1){
+				switch (target[0].nodeName.toLowerCase()){
+					case 'th':
+						switch (target[0].className){
+							case 'datepicker-switch':
+								this.showMode(1);
+								break;
+							case 'prev':
+							case 'next':
+								var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1);
+								switch (this.viewMode){
+									case 0:
+										this.viewDate = this.moveMonth(this.viewDate, dir);
+										this._trigger('changeMonth', this.viewDate);
+										break;
+									case 1:
+									case 2:
+										this.viewDate = this.moveYear(this.viewDate, dir);
+										if (this.viewMode === 1)
+											this._trigger('changeYear', this.viewDate);
+										break;
+								}
+								this.fill();
+								break;
+							case 'today':
+								var date = new Date();
+								date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
+
+								this.showMode(-2);
+								var which = this.o.todayBtn === 'linked' ? null : 'view';
+								this._setDate(date, which);
+								break;
+							case 'clear':
+								var element;
+								if (this.isInput)
+									element = this.element;
+								else if (this.component)
+									element = this.element.find('input');
+								if (element)
+									element.val("").change();
+								this.update();
+								this._trigger('changeDate');
+								if (this.o.autoclose)
+									this.hide();
+								break;
+						}
+						break;
+					case 'span':
+						if (!target.is('.disabled')){
+							this.viewDate.setUTCDate(1);
+							if (target.is('.month')){
+								day = 1;
+								month = target.parent().find('span').index(target);
+								year = this.viewDate.getUTCFullYear();
+								this.viewDate.setUTCMonth(month);
+								this._trigger('changeMonth', this.viewDate);
+								if (this.o.minViewMode === 1){
+									this._setDate(UTCDate(year, month, day));
+								}
+							}
+							else {
+								day = 1;
+								month = 0;
+								year = parseInt(target.text(), 10)||0;
+								this.viewDate.setUTCFullYear(year);
+								this._trigger('changeYear', this.viewDate);
+								if (this.o.minViewMode === 2){
+									this._setDate(UTCDate(year, month, day));
+								}
+							}
+							this.showMode(-1);
+							this.fill();
+						}
+						break;
+					case 'td':
+						if (target.is('.day') && !target.is('.disabled')){
+							day = parseInt(target.text(), 10)||1;
+							year = this.viewDate.getUTCFullYear();
+							month = this.viewDate.getUTCMonth();
+							if (target.is('.old')){
+								if (month === 0){
+									month = 11;
+									year -= 1;
+								}
+								else {
+									month -= 1;
+								}
+							}
+							else if (target.is('.new')){
+								if (month === 11){
+									month = 0;
+									year += 1;
+								}
+								else {
+									month += 1;
+								}
+							}
+							this._setDate(UTCDate(year, month, day));
+						}
+						break;
+				}
+			}
+			if (this.picker.is(':visible') && this._focused_from){
+				$(this._focused_from).focus();
+			}
+			delete this._focused_from;
+		},
+
+		_toggle_multidate: function(date){
+			var ix = this.dates.contains(date);
+			if (!date){
+				this.dates.clear();
+			}
+			else if (ix !== -1){
+				this.dates.remove(ix);
+			}
+			else {
+				this.dates.push(date);
+			}
+			if (typeof this.o.multidate === 'number')
+				while (this.dates.length > this.o.multidate)
+					this.dates.remove(0);
+		},
+
+		_setDate: function(date, which){
+			if (!which || which === 'date')
+				this._toggle_multidate(date && new Date(date));
+			if (!which || which  === 'view')
+				this.viewDate = date && new Date(date);
+
+			this.fill();
+			this.setValue();
+			this._trigger('changeDate');
+			var element;
+			if (this.isInput){
+				element = this.element;
+			}
+			else if (this.component){
+				element = this.element.find('input');
+			}
+			if (element){
+				element.change();
+			}
+			if (this.o.autoclose && (!which || which === 'date')){
+				this.hide();
+			}
+		},
+
+		moveMonth: function(date, dir){
+			if (!date)
+				return undefined;
+			if (!dir)
+				return date;
+			var new_date = new Date(date.valueOf()),
+				day = new_date.getUTCDate(),
+				month = new_date.getUTCMonth(),
+				mag = Math.abs(dir),
+				new_month, test;
+			dir = dir > 0 ? 1 : -1;
+			if (mag === 1){
+				test = dir === -1
+					// If going back one month, make sure month is not current month
+					// (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
+					? function(){
+						return new_date.getUTCMonth() === month;
+					}
+					// If going forward one month, make sure month is as expected
+					// (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
+					: function(){
+						return new_date.getUTCMonth() !== new_month;
+					};
+				new_month = month + dir;
+				new_date.setUTCMonth(new_month);
+				// Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
+				if (new_month < 0 || new_month > 11)
+					new_month = (new_month + 12) % 12;
+			}
+			else {
+				// For magnitudes >1, move one month at a time...
+				for (var i=0; i < mag; i++)
+					// ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
+					new_date = this.moveMonth(new_date, dir);
+				// ...then reset the day, keeping it in the new month
+				new_month = new_date.getUTCMonth();
+				new_date.setUTCDate(day);
+				test = function(){
+					return new_month !== new_date.getUTCMonth();
+				};
+			}
+			// Common date-resetting loop -- if date is beyond end of month, make it
+			// end of month
+			while (test()){
+				new_date.setUTCDate(--day);
+				new_date.setUTCMonth(new_month);
+			}
+			return new_date;
+		},
+
+		moveYear: function(date, dir){
+			return this.moveMonth(date, dir*12);
+		},
+
+		dateWithinRange: function(date){
+			return date >= this.o.startDate && date <= this.o.endDate;
+		},
+
+		keydown: function(e){
+			if (this.picker.is(':not(:visible)')){
+				if (e.keyCode === 27) // allow escape to hide and re-show picker
+					this.show();
+				return;
+			}
+			var dateChanged = false,
+				dir, newDate, newViewDate,
+				focusDate = this.focusDate || this.viewDate;
+			switch (e.keyCode){
+				case 27: // escape
+					if (this.focusDate){
+						this.focusDate = null;
+						this.viewDate = this.dates.get(-1) || this.viewDate;
+						this.fill();
+					}
+					else
+						this.hide();
+					e.preventDefault();
+					break;
+				case 37: // left
+				case 39: // right
+					if (!this.o.keyboardNavigation)
+						break;
+					dir = e.keyCode === 37 ? -1 : 1;
+					if (e.ctrlKey){
+						newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
+						newViewDate = this.moveYear(focusDate, dir);
+						this._trigger('changeYear', this.viewDate);
+					}
+					else if (e.shiftKey){
+						newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
+						newViewDate = this.moveMonth(focusDate, dir);
+						this._trigger('changeMonth', this.viewDate);
+					}
+					else {
+						newDate = new Date(this.dates.get(-1) || UTCToday());
+						newDate.setUTCDate(newDate.getUTCDate() + dir);
+						newViewDate = new Date(focusDate);
+						newViewDate.setUTCDate(focusDate.getUTCDate() + dir);
+					}
+					if (this.dateWithinRange(newDate)){
+						this.focusDate = this.viewDate = newViewDate;
+						this.setValue();
+						this.fill();
+						e.preventDefault();
+					}
+					break;
+				case 38: // up
+				case 40: // down
+					if (!this.o.keyboardNavigation)
+						break;
+					dir = e.keyCode === 38 ? -1 : 1;
+					if (e.ctrlKey){
+						newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
+						newViewDate = this.moveYear(focusDate, dir);
+						this._trigger('changeYear', this.viewDate);
+					}
+					else if (e.shiftKey){
+						newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
+						newViewDate = this.moveMonth(focusDate, dir);
+						this._trigger('changeMonth', this.viewDate);
+					}
+					else {
+						newDate = new Date(this.dates.get(-1) || UTCToday());
+						newDate.setUTCDate(newDate.getUTCDate() + dir * 7);
+						newViewDate = new Date(focusDate);
+						newViewDate.setUTCDate(focusDate.getUTCDate() + dir * 7);
+					}
+					if (this.dateWithinRange(newDate)){
+						this.focusDate = this.viewDate = newViewDate;
+						this.setValue();
+						this.fill();
+						e.preventDefault();
+					}
+					break;
+				case 32: // spacebar
+					// Spacebar is used in manually typing dates in some formats.
+					// As such, its behavior should not be hijacked.
+					break;
+				case 13: // enter
+					focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;
+					this._toggle_multidate(focusDate);
+					dateChanged = true;
+					this.focusDate = null;
+					this.viewDate = this.dates.get(-1) || this.viewDate;
+					this.setValue();
+					this.fill();
+					if (this.picker.is(':visible')){
+						e.preventDefault();
+						if (this.o.autoclose)
+							this.hide();
+					}
+					break;
+				case 9: // tab
+					this.focusDate = null;
+					this.viewDate = this.dates.get(-1) || this.viewDate;
+					this.fill();
+					this.hide();
+					break;
+			}
+			if (dateChanged){
+				if (this.dates.length)
+					this._trigger('changeDate');
+				else
+					this._trigger('clearDate');
+				var element;
+				if (this.isInput){
+					element = this.element;
+				}
+				else if (this.component){
+					element = this.element.find('input');
+				}
+				if (element){
+					element.change();
+				}
+			}
+		},
+
+		showMode: function(dir){
+			if (dir){
+				this.viewMode = Math.max(this.o.minViewMode, Math.min(2, this.viewMode + dir));
+			}
+			this.picker
+				.find('>div')
+				.hide()
+				.filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName)
+					.css('display', 'block');
+			this.updateNavArrows();
+		}
+	};
+
+	var DateRangePicker = function(element, options){
+		this.element = $(element);
+		this.inputs = $.map(options.inputs, function(i){
+			return i.jquery ? i[0] : i;
+		});
+		delete options.inputs;
+
+		$(this.inputs)
+			.datepicker(options)
+			.bind('changeDate', $.proxy(this.dateUpdated, this));
+
+		this.pickers = $.map(this.inputs, function(i){
+			return $(i).data('datepicker');
+		});
+		this.updateDates();
+	};
+	DateRangePicker.prototype = {
+		updateDates: function(){
+			this.dates = $.map(this.pickers, function(i){
+				return i.getUTCDate();
+			});
+			this.updateRanges();
+		},
+		updateRanges: function(){
+			var range = $.map(this.dates, function(d){
+				return d.valueOf();
+			});
+			$.each(this.pickers, function(i, p){
+				p.setRange(range);
+			});
+		},
+		dateUpdated: function(e){
+			// `this.updating` is a workaround for preventing infinite recursion
+			// between `changeDate` triggering and `setUTCDate` calling.  Until
+			// there is a better mechanism.
+			if (this.updating)
+				return;
+			this.updating = true;
+
+			var dp = $(e.target).data('datepicker'),
+				new_date = dp.getUTCDate(),
+				i = $.inArray(e.target, this.inputs),
+				l = this.inputs.length;
+			if (i === -1)
+				return;
+
+			$.each(this.pickers, function(i, p){
+				if (!p.getUTCDate())
+					p.setUTCDate(new_date);
+			});
+
+			if (new_date < this.dates[i]){
+				// Date being moved earlier/left
+				while (i >= 0 && new_date < this.dates[i]){
+					this.pickers[i--].setUTCDate(new_date);
+				}
+			}
+			else if (new_date > this.dates[i]){
+				// Date being moved later/right
+				while (i < l && new_date > this.dates[i]){
+					this.pickers[i++].setUTCDate(new_date);
+				}
+			}
+			this.updateDates();
+
+			delete this.updating;
+		},
+		remove: function(){
+			$.map(this.pickers, function(p){ p.remove(); });
+			delete this.element.data().datepicker;
+		}
+	};
+
+	function opts_from_el(el, prefix){
+		// Derive options from element data-attrs
+		var data = $(el).data(),
+			out = {}, inkey,
+			replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');
+		prefix = new RegExp('^' + prefix.toLowerCase());
+		function re_lower(_,a){
+			return a.toLowerCase();
+		}
+		for (var key in data)
+			if (prefix.test(key)){
+				inkey = key.replace(replace, re_lower);
+				out[inkey] = data[key];
+			}
+		return out;
+	}
+
+	function opts_from_locale(lang){
+		// Derive options from locale plugins
+		var out = {};
+		// Check if "de-DE" style date is available, if not language should
+		// fallback to 2 letter code eg "de"
+		if (!dates[lang]){
+			lang = lang.split('-')[0];
+			if (!dates[lang])
+				return;
+		}
+		var d = dates[lang];
+		$.each(locale_opts, function(i,k){
+			if (k in d)
+				out[k] = d[k];
+		});
+		return out;
+	}
+
+	var old = $.fn.datepicker;
+	$.fn.datepicker = function(option){
+		var args = Array.apply(null, arguments);
+		args.shift();
+		var internal_return;
+		this.each(function(){
+			var $this = $(this),
+				data = $this.data('datepicker'),
+				options = typeof option === 'object' && option;
+			if (!data){
+				var elopts = opts_from_el(this, 'date'),
+					// Preliminary otions
+					xopts = $.extend({}, defaults, elopts, options),
+					locopts = opts_from_locale(xopts.language),
+					// Options priority: js args, data-attrs, locales, defaults
+					opts = $.extend({}, defaults, locopts, elopts, options);
+				if ($this.is('.input-daterange') || opts.inputs){
+					var ropts = {
+						inputs: opts.inputs || $this.find('input').toArray()
+					};
+					$this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts))));
+				}
+				else {
+					$this.data('datepicker', (data = new Datepicker(this, opts)));
+				}
+			}
+			if (typeof option === 'string' && typeof data[option] === 'function'){
+				internal_return = data[option].apply(data, args);
+				if (internal_return !== undefined)
+					return false;
+			}
+		});
+		if (internal_return !== undefined)
+			return internal_return;
+		else
+			return this;
+	};
+
+	var defaults = $.fn.datepicker.defaults = {
+		autoclose: false,
+		beforeShowDay: $.noop,
+		calendarWeeks: false,
+		clearBtn: false,
+		daysOfWeekDisabled: [],
+		endDate: Infinity,
+		forceParse: true,
+		format: 'mm/dd/yyyy',
+		keyboardNavigation: true,
+		language: 'en',
+		minViewMode: 0,
+		multidate: false,
+		multidateSeparator: ',',
+		orientation: "auto",
+		rtl: false,
+		startDate: -Infinity,
+		startView: 0,
+		todayBtn: false,
+		todayHighlight: false,
+		weekStart: 0
+	};
+	var locale_opts = $.fn.datepicker.locale_opts = [
+		'format',
+		'rtl',
+		'weekStart'
+	];
+	$.fn.datepicker.Constructor = Datepicker;
+	var dates = $.fn.datepicker.dates = {
+		en: {
+			days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
+			daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
+			daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
+			months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
+			monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
+			today: "Today",
+			clear: "Clear"
+		}
+	};
+
+	var DPGlobal = {
+		modes: [
+			{
+				clsName: 'days',
+				navFnc: 'Month',
+				navStep: 1
+			},
+			{
+				clsName: 'months',
+				navFnc: 'FullYear',
+				navStep: 1
+			},
+			{
+				clsName: 'years',
+				navFnc: 'FullYear',
+				navStep: 10
+		}],
+		isLeapYear: function(year){
+			return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
+		},
+		getDaysInMonth: function(year, month){
+			return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
+		},
+		validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
+		nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
+		parseFormat: function(format){
+			// IE treats \0 as a string end in inputs (truncating the value),
+			// so it's a bad format delimiter, anyway
+			var separators = format.replace(this.validParts, '\0').split('\0'),
+				parts = format.match(this.validParts);
+			if (!separators || !separators.length || !parts || parts.length === 0){
+				throw new Error("Invalid date format.");
+			}
+			return {separators: separators, parts: parts};
+		},
+		parseDate: function(date, format, language){
+			if (!date)
+				return undefined;
+			if (date instanceof Date)
+				return date;
+			if (typeof format === 'string')
+				format = DPGlobal.parseFormat(format);
+			var part_re = /([\-+]\d+)([dmwy])/,
+				parts = date.match(/([\-+]\d+)([dmwy])/g),
+				part, dir, i;
+			if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){
+				date = new Date();
+				for (i=0; i < parts.length; i++){
+					part = part_re.exec(parts[i]);
+					dir = parseInt(part[1]);
+					switch (part[2]){
+						case 'd':
+							date.setUTCDate(date.getUTCDate() + dir);
+							break;
+						case 'm':
+							date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir);
+							break;
+						case 'w':
+							date.setUTCDate(date.getUTCDate() + dir * 7);
+							break;
+						case 'y':
+							date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir);
+							break;
+					}
+				}
+				return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);
+			}
+			parts = date && date.match(this.nonpunctuation) || [];
+			date = new Date();
+			var parsed = {},
+				setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
+				setters_map = {
+					yyyy: function(d,v){
+						return d.setUTCFullYear(v);
+					},
+					yy: function(d,v){
+						return d.setUTCFullYear(2000+v);
+					},
+					m: function(d,v){
+						if (isNaN(d))
+							return d;
+						v -= 1;
+						while (v < 0) v += 12;
+						v %= 12;
+						d.setUTCMonth(v);
+						while (d.getUTCMonth() !== v)
+							d.setUTCDate(d.getUTCDate()-1);
+						return d;
+					},
+					d: function(d,v){
+						return d.setUTCDate(v);
+					}
+				},
+				val, filtered;
+			setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
+			setters_map['dd'] = setters_map['d'];
+			date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
+			var fparts = format.parts.slice();
+			// Remove noop parts
+			if (parts.length !== fparts.length){
+				fparts = $(fparts).filter(function(i,p){
+					return $.inArray(p, setters_order) !== -1;
+				}).toArray();
+			}
+			// Process remainder
+			function match_part(){
+				var m = this.slice(0, parts[i].length),
+					p = parts[i].slice(0, m.length);
+				return m === p;
+			}
+			if (parts.length === fparts.length){
+				var cnt;
+				for (i=0, cnt = fparts.length; i < cnt; i++){
+					val = parseInt(parts[i], 10);
+					part = fparts[i];
+					if (isNaN(val)){
+						switch (part){
+							case 'MM':
+								filtered = $(dates[language].months).filter(match_part);
+								val = $.inArray(filtered[0], dates[language].months) + 1;
+								break;
+							case 'M':
+								filtered = $(dates[language].monthsShort).filter(match_part);
+								val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
+								break;
+						}
+					}
+					parsed[part] = val;
+				}
+				var _date, s;
+				for (i=0; i < setters_order.length; i++){
+					s = setters_order[i];
+					if (s in parsed && !isNaN(parsed[s])){
+						_date = new Date(date);
+						setters_map[s](_date, parsed[s]);
+						if (!isNaN(_date))
+							date = _date;
+					}
+				}
+			}
+			return date;
+		},
+		formatDate: function(date, format, language){
+			if (!date)
+				return '';
+			if (typeof format === 'string')
+				format = DPGlobal.parseFormat(format);
+			var val = {
+				d: date.getUTCDate(),
+				D: dates[language].daysShort[date.getUTCDay()],
+				DD: dates[language].days[date.getUTCDay()],
+				m: date.getUTCMonth() + 1,
+				M: dates[language].monthsShort[date.getUTCMonth()],
+				MM: dates[language].months[date.getUTCMonth()],
+				yy: date.getUTCFullYear().toString().substring(2),
+				yyyy: date.getUTCFullYear()
+			};
+			val.dd = (val.d < 10 ? '0' : '') + val.d;
+			val.mm = (val.m < 10 ? '0' : '') + val.m;
+			date = [];
+			var seps = $.extend([], format.separators);
+			for (var i=0, cnt = format.parts.length; i <= cnt; i++){
+				if (seps.length)
+					date.push(seps.shift());
+				date.push(val[format.parts[i]]);
+			}
+			return date.join('');
+		},
+		headTemplate: '<thead>'+
+							'<tr>'+
+								'<th class="prev">&laquo;</th>'+
+								'<th colspan="5" class="datepicker-switch"></th>'+
+								'<th class="next">&raquo;</th>'+
+							'</tr>'+
+						'</thead>',
+		contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
+		footTemplate: '<tfoot>'+
+							'<tr>'+
+								'<th colspan="7" class="today"></th>'+
+							'</tr>'+
+							'<tr>'+
+								'<th colspan="7" class="clear"></th>'+
+							'</tr>'+
+						'</tfoot>'
+	};
+	DPGlobal.template = '<div class="datepicker">'+
+							'<div class="datepicker-days">'+
+								'<table class=" table-condensed">'+
+									DPGlobal.headTemplate+
+									'<tbody></tbody>'+
+									DPGlobal.footTemplate+
+								'</table>'+
+							'</div>'+
+							'<div class="datepicker-months">'+
+								'<table class="table-condensed">'+
+									DPGlobal.headTemplate+
+									DPGlobal.contTemplate+
+									DPGlobal.footTemplate+
+								'</table>'+
+							'</div>'+
+							'<div class="datepicker-years">'+
+								'<table class="table-condensed">'+
+									DPGlobal.headTemplate+
+									DPGlobal.contTemplate+
+									DPGlobal.footTemplate+
+								'</table>'+
+							'</div>'+
+						'</div>';
+
+	$.fn.datepicker.DPGlobal = DPGlobal;
+
+
+	/* DATEPICKER NO CONFLICT
+	* =================== */
+
+	$.fn.datepicker.noConflict = function(){
+		$.fn.datepicker = old;
+		return this;
+	};
+
+
+	/* DATEPICKER DATA-API
+	* ================== */
+
+	$(document).on(
+		'focus.datepicker.data-api click.datepicker.data-api',
+		'[data-provide="datepicker"]',
+		function(e){
+			var $this = $(this);
+			if ($this.data('datepicker'))
+				return;
+			e.preventDefault();
+			// component click requires us to explicitly show it
+			$this.datepicker('show');
+		}
+	);
+	$(function(){
+		$('[data-provide="datepicker-inline"]').datepicker();
+	});
+
+}(window.jQuery));

BIN
app/Resources/public/assets/jt.timepicker/lib/glyphicons-halflings.png


BIN
app/Resources/public/assets/jt.timepicker/lib/screenshot.png


+ 195 - 0
app/Resources/public/assets/jt.timepicker/lib/site.css

@@ -0,0 +1,195 @@
+body {
+    background: #f0f0f0;
+    color: #444;
+    font-family: helvetica, arial, sans-serif;
+    font-size: 15px;
+    line-height: 1.3;
+    margin: 0;
+    padding: 0;
+}
+
+header,
+section,
+footer {
+    padding: 20px;
+}
+
+header,
+footer {
+    background: #d4d4d4;
+    color: #666;
+    position: relative;
+}
+
+header h1 {
+    margin: 0;
+    padding: 0;
+}
+
+header h1 a {
+    font-family: Lucida Sans Unicode, Lucida Grande, sans-serif;
+    font-size: 60px;
+    font-weight: 200;
+    text-decoration: none;
+}
+
+header p {
+    font-size: 23px;
+}
+
+#header-links {
+    margin: 0;
+    padding: 0;
+    list-style: none;
+    position: absolute;
+    right: 20px;
+    top: 30px;
+    text-align: right;
+}
+
+#header-links a {
+    color: #888;
+}
+
+#header-links a:hover {
+    color: #06c;
+}
+
+h2 {
+    color: #444;
+    font-size: 35px;
+    font-weight: normal;
+    margin: 0;
+    line-height: 1.1
+}
+
+p {
+    margin: 20px 0 0 0;
+}
+
+p:first-child {
+    margin-top: 0;
+}
+
+input {
+    font-size: 13px;
+    -webkit-border-radius: 3px;
+    -moz-border-radius: 5px;
+    border-radius: 5px;
+    padding: 3px;
+    background: #fff;
+    border: 1px solid #aac;
+}
+
+input.time {
+    width: 80px;
+}
+
+input.date {
+    width: 90px;
+}
+
+a {
+    color: #06c;
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+image {
+    border: 0;
+}
+
+.body-text {
+    width: 700px;
+}
+
+#examples article {
+    padding-top: 100px;
+    clear: both;
+}
+
+#examples article:first-child {
+    padding-top: 0;
+}
+
+#examples .demo {
+    width: 450px;
+    float: left;
+}
+
+#examples .code {
+    font-size: 12px;
+    margin: 0 0 0 470px;
+}
+
+footer {
+    font-size: 12px;
+}
+
+/**
+ * Blackboard theme
+ *
+ * Adapted from Domenico Carbotta's TextMate theme of the same name
+ *
+ * @author Domenico Carbotta
+ * @author Craig Campbell
+ * @version 1.0.2
+ */
+pre {
+    background: #0B1022;
+    word-wrap: break-word;
+    margin: 0px;
+    padding: 0px;
+    padding: 10px;
+    color: #fff;
+    font-size: 14px;
+    margin-bottom: 20px;
+}
+
+pre, code {
+    font-family: 'Monaco', courier, monospace;
+}
+
+pre .comment {
+    color: #727272;
+}
+
+pre .constant {
+    color: #D8FA3C;
+}
+
+pre .storage {
+    color: #FBDE2D;
+}
+
+pre .string, pre .comment.docstring {
+    color: #61CE3C;
+}
+
+pre .string.regexp, pre .support.tag.script, pre .support.tag.style {
+    color: #fff;
+}
+
+pre .keyword, pre .selector {
+    color: #FBDE2D;
+}
+
+pre .inherited-class {
+    font-style: italic;
+}
+
+pre .entity {
+    color: #FF6400;
+}
+
+pre .support, *[data-language="c"] .function.call {
+    color: #8DA6CE;
+}
+
+pre .variable.global, pre .variable.class, pre .variable.instance {
+    color: #FF6400;
+}
+

+ 10 - 0
app/Resources/public/assets/jt.timepicker/lib/site.js

@@ -0,0 +1,10 @@
+/* Rainbow v1.1.9 rainbowco.de | included languages: generic, javascript */
+window.Rainbow=function(){function q(a){var b,c=a.getAttribute&&a.getAttribute("data-language")||0;if(!c){a=a.attributes;for(b=0;b<a.length;++b)if("data-language"===a[b].nodeName)return a[b].nodeValue}return c}function B(a){var b=q(a)||q(a.parentNode);if(!b){var c=/\blang(?:uage)?-(\w+)/;(a=a.className.match(c)||a.parentNode.className.match(c))&&(b=a[1])}return b}function C(a,b){for(var c in e[d]){c=parseInt(c,10);if(a==c&&b==e[d][c]?0:a<=c&&b>=e[d][c])delete e[d][c],delete j[d][c];if(a>=c&&a<e[d][c]||
+b>c&&b<e[d][c])return!0}return!1}function r(a,b){return'<span class="'+a.replace(/\./g," ")+(l?" "+l:"")+'">'+b+"</span>"}function s(a,b,c,h){var f=a.exec(c);if(f){++t;!b.name&&"string"==typeof b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var k=f[0],i=f.index,u=f[0].length+i,g=function(){function f(){s(a,b,c,h)}t%100>0?f():setTimeout(f,0)};if(C(i,u))g();else{var m=v(b.matches),l=function(a,c,h){if(a>=c.length)h(k);else{var d=f[c[a]];if(d){var e=b.matches[c[a]],i=e.language,g=e.name&&e.matches?
+e.matches:e,j=function(b,d,e){var i;i=0;var g;for(g=1;g<c[a];++g)f[g]&&(i=i+f[g].length);d=e?r(e,d):d;k=k.substr(0,i)+k.substr(i).replace(b,d);l(++a,c,h)};i?n(d,i,function(a){j(d,a)}):typeof e==="string"?j(d,d,e):w(d,g.length?g:[g],function(a){j(d,a,e.matches?e.name:0)})}else l(++a,c,h)}};l(0,m,function(a){b.name&&(a=r(b.name,a));if(!j[d]){j[d]={};e[d]={}}j[d][i]={replace:f[0],"with":a};e[d][i]=u;g()})}}else h()}function v(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b.sort(function(a,
+b){return b-a})}function w(a,b,c){function h(b,k){k<b.length?s(b[k].pattern,b[k],a,function(){h(b,++k)}):D(a,function(a){delete j[d];delete e[d];--d;c(a)})}++d;h(b,0)}function D(a,b){function c(a,b,h,e){if(h<b.length){++x;var g=b[h],l=j[d][g],a=a.substr(0,g)+a.substr(g).replace(l.replace,l["with"]),g=function(){c(a,b,++h,e)};0<x%250?g():setTimeout(g,0)}else e(a)}var h=v(j[d]);c(a,h,0,b)}function n(a,b,c){var d=m[b]||[],f=m[y]||[],b=z[b]?d:d.concat(f);w(a.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&(?![\w\#]+;)/g,
+"&amp;"),b,c)}function o(a,b,c){if(b<a.length){var d=a[b],f=B(d);return!(-1<(" "+d.className+" ").indexOf(" rainbow "))&&f?(f=f.toLowerCase(),d.className+=d.className?" rainbow":"rainbow",n(d.innerHTML,f,function(k){d.innerHTML=k;j={};e={};p&&p(d,f);setTimeout(function(){o(a,++b,c)},0)})):o(a,++b,c)}c&&c()}function A(a,b){var a=a&&"function"==typeof a.getElementsByTagName?a:document,c=a.getElementsByTagName("pre"),d=a.getElementsByTagName("code"),f,e=[];for(f=0;f<d.length;++f)e.push(d[f]);for(f=0;f<
+c.length;++f)c[f].getElementsByTagName("code").length||e.push(c[f]);o(e,0,b)}var j={},e={},m={},z={},d=0,y=0,t=0,x=0,l,p;return{extend:function(a,b,c){1==arguments.length&&(b=a,a=y);z[a]=c;m[a]=b.concat(m[a]||[])},b:function(a){p=a},a:function(a){l=a},color:function(a,b,c){if("string"==typeof a)return n(a,b,c);if("function"==typeof a)return A(0,a);A(a,b)}}}();window.addEventListener?window.addEventListener("load",Rainbow.color,!1):window.attachEvent("onload",Rainbow.color);Rainbow.onHighlight=Rainbow.b;
+Rainbow.addClass=Rainbow.a;Rainbow.extend([{matches:{1:{name:"keyword.operator",pattern:/\=/g},2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\('|"){1}/g}}},pattern:/(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm},{name:"constant.numeric",pattern:/\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi},{matches:{1:"keyword"},pattern:/\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi},
+{name:"constant.language",pattern:/true|false|null/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g},{matches:{1:"function.call"},pattern:/(\w+?)(?=\()/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(function)\s(.*?)(?=\()/g}]);Rainbow.extend("javascript",[{name:"selector",pattern:/(\s|^)\$(?=\.|\()/g},{name:"support",pattern:/\b(window|document)\b/g},{matches:{1:"support.property"},pattern:/\.(length|node(Name|Value))\b/g},{matches:{1:"support.function"},pattern:/(setTimeout|setInterval)(?=\()/g},{matches:{1:"support.method"},pattern:/\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g},{matches:{1:"support.tag.script",2:[{name:"string",pattern:/('|")(.*?)(\1)/g},{name:"entity.tag.script",
+pattern:/(\w+)/g}],3:"support.tag.script"},pattern:/(&lt;\/?)(script.*?)(&gt;)/g},{name:"string.regexp",matches:{1:"string.regexp.open",2:{name:"constant.regexp.escape",pattern:/\\(.){1}/g},3:"string.regexp.close",4:"string.regexp.modifier"},pattern:/(\/)(?!\*)(.+)(\/)([igm]{0,3})/g},{matches:{1:"storage",3:"entity.function"},pattern:/(var)?(\s|^)(.*)(?=\s?=\s?function\()/g},{name:"entity.function",pattern:/(\w+)(?=:\s{0,}function)/g}]);

+ 45 - 0
app/Resources/public/assets/jt.timepicker/package.json

@@ -0,0 +1,45 @@
+{
+  "name": "timepicker",
+  "version": "1.11.14",
+  "title": "jquery-timepicker",
+  "author": {
+    "name": "Jon Thornton",
+    "url": "https://github.com/jonthornton"
+  },
+  "scripts": {
+    "format": "prettier-eslint --write \"jquery.timepicker.js\"",
+    "lint": "eslint",
+    "test": "jest"
+  },
+  "license": "MIT",
+  "dependencies": {
+    "jquery": ">=1.7"
+  },
+  "devDependencies": {
+    "grunt": "~0.4.1",
+    "grunt-cli": "~0.1.9",
+    "grunt-contrib-cssmin": "~0.4.1",
+    "grunt-contrib-jshint": "^0.11.3",
+    "grunt-contrib-uglify": "~0.11.0",
+    "jest": "^21.1.0",
+    "prettier-eslint": "^8.1.1",
+    "prettier-eslint-cli": "^4.3.2"
+  },
+  "main": "jquery.timepicker.min.js",
+  "description": "A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.",
+  "keywords": [
+    "timepicker",
+    "time",
+    "picker",
+    "ui",
+    "google calendar"
+  ],
+  "homepage": "http://jonthornton.github.com/jquery-timepicker/",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/jonthornton/jquery-timepicker.git"
+  },
+  "bugs": {
+    "url": "https://github.com/jonthornton/jquery-timepicker/issues"
+  }
+}

+ 27 - 0
app/Resources/public/assets/requirejs/.bower.json

@@ -0,0 +1,27 @@
+{
+  "name": "requirejs",
+  "version": "2.1.22",
+  "ignore": [],
+  "homepage": "http://requirejs.org",
+  "authors": [
+    "jrburke.com"
+  ],
+  "description": "A file and module loader for JavaScript",
+  "main": "require.js",
+  "keywords": [
+    "AMD"
+  ],
+  "license": [
+    "BSD-3-Clause",
+    "MIT"
+  ],
+  "_release": "2.1.22",
+  "_resolution": {
+    "type": "version",
+    "tag": "2.1.22",
+    "commit": "9cd0b99417eac61e890d11c5119f2e45e752c999"
+  },
+  "_source": "https://github.com/jrburke/requirejs-bower.git",
+  "_target": "~2.1.10",
+  "_originalSource": "requirejs"
+}

+ 4 - 0
app/Resources/public/assets/requirejs/README.md

@@ -0,0 +1,4 @@
+# requirejs-bower
+
+Bower packaging for [RequireJS](http://requirejs.org).
+

+ 18 - 0
app/Resources/public/assets/requirejs/bower.json

@@ -0,0 +1,18 @@
+{
+  "name": "requirejs",
+  "version": "2.1.22",
+  "ignore": [],
+  "homepage": "http://requirejs.org",
+  "authors": [
+    "jrburke.com"
+  ],
+  "description": "A file and module loader for JavaScript",
+  "main": "require.js",
+  "keywords": [
+    "AMD"
+  ],
+  "license": [
+    "BSD-3-Clause",
+    "MIT"
+  ]
+}

+ 2129 - 0
app/Resources/public/assets/requirejs/require.js

@@ -0,0 +1,2129 @@
+/** vim: et:ts=4:sw=4:sts=4
+ * @license RequireJS 2.1.22 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+//Not using strict: uneven strict support in browsers, #392, and causes
+//problems with requirejs.exec()/transpiler plugins that may not be strict.
+/*jslint regexp: true, nomen: true, sloppy: true */
+/*global window, navigator, document, importScripts, setTimeout, opera */
+
+var requirejs, require, define;
+(function (global) {
+    var req, s, head, baseElement, dataMain, src,
+        interactiveScript, currentlyAddingScript, mainScript, subPath,
+        version = '2.1.22',
+        commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
+        cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
+        jsSuffixRegExp = /\.js$/,
+        currDirRegExp = /^\.\//,
+        op = Object.prototype,
+        ostring = op.toString,
+        hasOwn = op.hasOwnProperty,
+        ap = Array.prototype,
+        isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
+        isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
+        //PS3 indicates loaded and complete, but need to wait for complete
+        //specifically. Sequence is 'loading', 'loaded', execution,
+        // then 'complete'. The UA check is unfortunate, but not sure how
+        //to feature test w/o causing perf issues.
+        readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
+                      /^complete$/ : /^(complete|loaded)$/,
+        defContextName = '_',
+        //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
+        isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
+        contexts = {},
+        cfg = {},
+        globalDefQueue = [],
+        useInteractive = false;
+
+    function isFunction(it) {
+        return ostring.call(it) === '[object Function]';
+    }
+
+    function isArray(it) {
+        return ostring.call(it) === '[object Array]';
+    }
+
+    /**
+     * Helper function for iterating over an array. If the func returns
+     * a true value, it will break out of the loop.
+     */
+    function each(ary, func) {
+        if (ary) {
+            var i;
+            for (i = 0; i < ary.length; i += 1) {
+                if (ary[i] && func(ary[i], i, ary)) {
+                    break;
+                }
+            }
+        }
+    }
+
+    /**
+     * Helper function for iterating over an array backwards. If the func
+     * returns a true value, it will break out of the loop.
+     */
+    function eachReverse(ary, func) {
+        if (ary) {
+            var i;
+            for (i = ary.length - 1; i > -1; i -= 1) {
+                if (ary[i] && func(ary[i], i, ary)) {
+                    break;
+                }
+            }
+        }
+    }
+
+    function hasProp(obj, prop) {
+        return hasOwn.call(obj, prop);
+    }
+
+    function getOwn(obj, prop) {
+        return hasProp(obj, prop) && obj[prop];
+    }
+
+    /**
+     * Cycles over properties in an object and calls a function for each
+     * property value. If the function returns a truthy value, then the
+     * iteration is stopped.
+     */
+    function eachProp(obj, func) {
+        var prop;
+        for (prop in obj) {
+            if (hasProp(obj, prop)) {
+                if (func(obj[prop], prop)) {
+                    break;
+                }
+            }
+        }
+    }
+
+    /**
+     * Simple function to mix in properties from source into target,
+     * but only if target does not already have a property of the same name.
+     */
+    function mixin(target, source, force, deepStringMixin) {
+        if (source) {
+            eachProp(source, function (value, prop) {
+                if (force || !hasProp(target, prop)) {
+                    if (deepStringMixin && typeof value === 'object' && value &&
+                        !isArray(value) && !isFunction(value) &&
+                        !(value instanceof RegExp)) {
+
+                        if (!target[prop]) {
+                            target[prop] = {};
+                        }
+                        mixin(target[prop], value, force, deepStringMixin);
+                    } else {
+                        target[prop] = value;
+                    }
+                }
+            });
+        }
+        return target;
+    }
+
+    //Similar to Function.prototype.bind, but the 'this' object is specified
+    //first, since it is easier to read/figure out what 'this' will be.
+    function bind(obj, fn) {
+        return function () {
+            return fn.apply(obj, arguments);
+        };
+    }
+
+    function scripts() {
+        return document.getElementsByTagName('script');
+    }
+
+    function defaultOnError(err) {
+        throw err;
+    }
+
+    //Allow getting a global that is expressed in
+    //dot notation, like 'a.b.c'.
+    function getGlobal(value) {
+        if (!value) {
+            return value;
+        }
+        var g = global;
+        each(value.split('.'), function (part) {
+            g = g[part];
+        });
+        return g;
+    }
+
+    /**
+     * Constructs an error with a pointer to an URL with more information.
+     * @param {String} id the error ID that maps to an ID on a web page.
+     * @param {String} message human readable error.
+     * @param {Error} [err] the original error, if there is one.
+     *
+     * @returns {Error}
+     */
+    function makeError(id, msg, err, requireModules) {
+        var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
+        e.requireType = id;
+        e.requireModules = requireModules;
+        if (err) {
+            e.originalError = err;
+        }
+        return e;
+    }
+
+    if (typeof define !== 'undefined') {
+        //If a define is already in play via another AMD loader,
+        //do not overwrite.
+        return;
+    }
+
+    if (typeof requirejs !== 'undefined') {
+        if (isFunction(requirejs)) {
+            //Do not overwrite an existing requirejs instance.
+            return;
+        }
+        cfg = requirejs;
+        requirejs = undefined;
+    }
+
+    //Allow for a require config object
+    if (typeof require !== 'undefined' && !isFunction(require)) {
+        //assume it is a config object.
+        cfg = require;
+        require = undefined;
+    }
+
+    function newContext(contextName) {
+        var inCheckLoaded, Module, context, handlers,
+            checkLoadedTimeoutId,
+            config = {
+                //Defaults. Do not set a default for map
+                //config to speed up normalize(), which
+                //will run faster if there is no default.
+                waitSeconds: 7,
+                baseUrl: './',
+                paths: {},
+                bundles: {},
+                pkgs: {},
+                shim: {},
+                config: {}
+            },
+            registry = {},
+            //registry of just enabled modules, to speed
+            //cycle breaking code when lots of modules
+            //are registered, but not activated.
+            enabledRegistry = {},
+            undefEvents = {},
+            defQueue = [],
+            defined = {},
+            urlFetched = {},
+            bundlesMap = {},
+            requireCounter = 1,
+            unnormalizedCounter = 1;
+
+        /**
+         * Trims the . and .. from an array of path segments.
+         * It will keep a leading path segment if a .. will become
+         * the first path segment, to help with module name lookups,
+         * which act like paths, but can be remapped. But the end result,
+         * all paths that use this function should look normalized.
+         * NOTE: this method MODIFIES the input array.
+         * @param {Array} ary the array of path segments.
+         */
+        function trimDots(ary) {
+            var i, part;
+            for (i = 0; i < ary.length; i++) {
+                part = ary[i];
+                if (part === '.') {
+                    ary.splice(i, 1);
+                    i -= 1;
+                } else if (part === '..') {
+                    // If at the start, or previous value is still ..,
+                    // keep them so that when converted to a path it may
+                    // still work when converted to a path, even though
+                    // as an ID it is less than ideal. In larger point
+                    // releases, may be better to just kick out an error.
+                    if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') {
+                        continue;
+                    } else if (i > 0) {
+                        ary.splice(i - 1, 2);
+                        i -= 2;
+                    }
+                }
+            }
+        }
+
+        /**
+         * Given a relative module name, like ./something, normalize it to
+         * a real name that can be mapped to a path.
+         * @param {String} name the relative name
+         * @param {String} baseName a real name that the name arg is relative
+         * to.
+         * @param {Boolean} applyMap apply the map config to the value. Should
+         * only be done if this normalization is for a dependency ID.
+         * @returns {String} normalized name
+         */
+        function normalize(name, baseName, applyMap) {
+            var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
+                foundMap, foundI, foundStarMap, starI, normalizedBaseParts,
+                baseParts = (baseName && baseName.split('/')),
+                map = config.map,
+                starMap = map && map['*'];
+
+            //Adjust any relative paths.
+            if (name) {
+                name = name.split('/');
+                lastIndex = name.length - 1;
+
+                // If wanting node ID compatibility, strip .js from end
+                // of IDs. Have to do this here, and not in nameToUrl
+                // because node allows either .js or non .js to map
+                // to same file.
+                if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+                    name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
+                }
+
+                // Starts with a '.' so need the baseName
+                if (name[0].charAt(0) === '.' && baseParts) {
+                    //Convert baseName to array, and lop off the last part,
+                    //so that . matches that 'directory' and not name of the baseName's
+                    //module. For instance, baseName of 'one/two/three', maps to
+                    //'one/two/three.js', but we want the directory, 'one/two' for
+                    //this normalization.
+                    normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+                    name = normalizedBaseParts.concat(name);
+                }
+
+                trimDots(name);
+                name = name.join('/');
+            }
+
+            //Apply map config if available.
+            if (applyMap && map && (baseParts || starMap)) {
+                nameParts = name.split('/');
+
+                outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
+                    nameSegment = nameParts.slice(0, i).join('/');
+
+                    if (baseParts) {
+                        //Find the longest baseName segment match in the config.
+                        //So, do joins on the biggest to smallest lengths of baseParts.
+                        for (j = baseParts.length; j > 0; j -= 1) {
+                            mapValue = getOwn(map, baseParts.slice(0, j).join('/'));
+
+                            //baseName segment has config, find if it has one for
+                            //this name.
+                            if (mapValue) {
+                                mapValue = getOwn(mapValue, nameSegment);
+                                if (mapValue) {
+                                    //Match, update name to the new value.
+                                    foundMap = mapValue;
+                                    foundI = i;
+                                    break outerLoop;
+                                }
+                            }
+                        }
+                    }
+
+                    //Check for a star map match, but just hold on to it,
+                    //if there is a shorter segment match later in a matching
+                    //config, then favor over this star map.
+                    if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
+                        foundStarMap = getOwn(starMap, nameSegment);
+                        starI = i;
+                    }
+                }
+
+                if (!foundMap && foundStarMap) {
+                    foundMap = foundStarMap;
+                    foundI = starI;
+                }
+
+                if (foundMap) {
+                    nameParts.splice(0, foundI, foundMap);
+                    name = nameParts.join('/');
+                }
+            }
+
+            // If the name points to a package's name, use
+            // the package main instead.
+            pkgMain = getOwn(config.pkgs, name);
+
+            return pkgMain ? pkgMain : name;
+        }
+
+        function removeScript(name) {
+            if (isBrowser) {
+                each(scripts(), function (scriptNode) {
+                    if (scriptNode.getAttribute('data-requiremodule') === name &&
+                            scriptNode.getAttribute('data-requirecontext') === context.contextName) {
+                        scriptNode.parentNode.removeChild(scriptNode);
+                        return true;
+                    }
+                });
+            }
+        }
+
+        function hasPathFallback(id) {
+            var pathConfig = getOwn(config.paths, id);
+            if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
+                //Pop off the first array value, since it failed, and
+                //retry
+                pathConfig.shift();
+                context.require.undef(id);
+
+                //Custom require that does not do map translation, since
+                //ID is "absolute", already mapped/resolved.
+                context.makeRequire(null, {
+                    skipMap: true
+                })([id]);
+
+                return true;
+            }
+        }
+
+        //Turns a plugin!resource to [plugin, resource]
+        //with the plugin being undefined if the name
+        //did not have a plugin prefix.
+        function splitPrefix(name) {
+            var prefix,
+                index = name ? name.indexOf('!') : -1;
+            if (index > -1) {
+                prefix = name.substring(0, index);
+                name = name.substring(index + 1, name.length);
+            }
+            return [prefix, name];
+        }
+
+        /**
+         * Creates a module mapping that includes plugin prefix, module
+         * name, and path. If parentModuleMap is provided it will
+         * also normalize the name via require.normalize()
+         *
+         * @param {String} name the module name
+         * @param {String} [parentModuleMap] parent module map
+         * for the module name, used to resolve relative names.
+         * @param {Boolean} isNormalized: is the ID already normalized.
+         * This is true if this call is done for a define() module ID.
+         * @param {Boolean} applyMap: apply the map config to the ID.
+         * Should only be true if this map is for a dependency.
+         *
+         * @returns {Object}
+         */
+        function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
+            var url, pluginModule, suffix, nameParts,
+                prefix = null,
+                parentName = parentModuleMap ? parentModuleMap.name : null,
+                originalName = name,
+                isDefine = true,
+                normalizedName = '';
+
+            //If no name, then it means it is a require call, generate an
+            //internal name.
+            if (!name) {
+                isDefine = false;
+                name = '_@r' + (requireCounter += 1);
+            }
+
+            nameParts = splitPrefix(name);
+            prefix = nameParts[0];
+            name = nameParts[1];
+
+            if (prefix) {
+                prefix = normalize(prefix, parentName, applyMap);
+                pluginModule = getOwn(defined, prefix);
+            }
+
+            //Account for relative paths if there is a base name.
+            if (name) {
+                if (prefix) {
+                    if (pluginModule && pluginModule.normalize) {
+                        //Plugin is loaded, use its normalize method.
+                        normalizedName = pluginModule.normalize(name, function (name) {
+                            return normalize(name, parentName, applyMap);
+                        });
+                    } else {
+                        // If nested plugin references, then do not try to
+                        // normalize, as it will not normalize correctly. This
+                        // places a restriction on resourceIds, and the longer
+                        // term solution is not to normalize until plugins are
+                        // loaded and all normalizations to allow for async
+                        // loading of a loader plugin. But for now, fixes the
+                        // common uses. Details in #1131
+                        normalizedName = name.indexOf('!') === -1 ?
+                                         normalize(name, parentName, applyMap) :
+                                         name;
+                    }
+                } else {
+                    //A regular module.
+                    normalizedName = normalize(name, parentName, applyMap);
+
+                    //Normalized name may be a plugin ID due to map config
+                    //application in normalize. The map config values must
+                    //already be normalized, so do not need to redo that part.
+                    nameParts = splitPrefix(normalizedName);
+                    prefix = nameParts[0];
+                    normalizedName = nameParts[1];
+                    isNormalized = true;
+
+                    url = context.nameToUrl(normalizedName);
+                }
+            }
+
+            //If the id is a plugin id that cannot be determined if it needs
+            //normalization, stamp it with a unique ID so two matching relative
+            //ids that may conflict can be separate.
+            suffix = prefix && !pluginModule && !isNormalized ?
+                     '_unnormalized' + (unnormalizedCounter += 1) :
+                     '';
+
+            return {
+                prefix: prefix,
+                name: normalizedName,
+                parentMap: parentModuleMap,
+                unnormalized: !!suffix,
+                url: url,
+                originalName: originalName,
+                isDefine: isDefine,
+                id: (prefix ?
+                        prefix + '!' + normalizedName :
+                        normalizedName) + suffix
+            };
+        }
+
+        function getModule(depMap) {
+            var id = depMap.id,
+                mod = getOwn(registry, id);
+
+            if (!mod) {
+                mod = registry[id] = new context.Module(depMap);
+            }
+
+            return mod;
+        }
+
+        function on(depMap, name, fn) {
+            var id = depMap.id,
+                mod = getOwn(registry, id);
+
+            if (hasProp(defined, id) &&
+                    (!mod || mod.defineEmitComplete)) {
+                if (name === 'defined') {
+                    fn(defined[id]);
+                }
+            } else {
+                mod = getModule(depMap);
+                if (mod.error && name === 'error') {
+                    fn(mod.error);
+                } else {
+                    mod.on(name, fn);
+                }
+            }
+        }
+
+        function onError(err, errback) {
+            var ids = err.requireModules,
+                notified = false;
+
+            if (errback) {
+                errback(err);
+            } else {
+                each(ids, function (id) {
+                    var mod = getOwn(registry, id);
+                    if (mod) {
+                        //Set error on module, so it skips timeout checks.
+                        mod.error = err;
+                        if (mod.events.error) {
+                            notified = true;
+                            mod.emit('error', err);
+                        }
+                    }
+                });
+
+                if (!notified) {
+                    req.onError(err);
+                }
+            }
+        }
+
+        /**
+         * Internal method to transfer globalQueue items to this context's
+         * defQueue.
+         */
+        function takeGlobalQueue() {
+            //Push all the globalDefQueue items into the context's defQueue
+            if (globalDefQueue.length) {
+                each(globalDefQueue, function(queueItem) {
+                    var id = queueItem[0];
+                    if (typeof id === 'string') {
+                        context.defQueueMap[id] = true;
+                    }
+                    defQueue.push(queueItem);
+                });
+                globalDefQueue = [];
+            }
+        }
+
+        handlers = {
+            'require': function (mod) {
+                if (mod.require) {
+                    return mod.require;
+                } else {
+                    return (mod.require = context.makeRequire(mod.map));
+                }
+            },
+            'exports': function (mod) {
+                mod.usingExports = true;
+                if (mod.map.isDefine) {
+                    if (mod.exports) {
+                        return (defined[mod.map.id] = mod.exports);
+                    } else {
+                        return (mod.exports = defined[mod.map.id] = {});
+                    }
+                }
+            },
+            'module': function (mod) {
+                if (mod.module) {
+                    return mod.module;
+                } else {
+                    return (mod.module = {
+                        id: mod.map.id,
+                        uri: mod.map.url,
+                        config: function () {
+                            return getOwn(config.config, mod.map.id) || {};
+                        },
+                        exports: mod.exports || (mod.exports = {})
+                    });
+                }
+            }
+        };
+
+        function cleanRegistry(id) {
+            //Clean up machinery used for waiting modules.
+            delete registry[id];
+            delete enabledRegistry[id];
+        }
+
+        function breakCycle(mod, traced, processed) {
+            var id = mod.map.id;
+
+            if (mod.error) {
+                mod.emit('error', mod.error);
+            } else {
+                traced[id] = true;
+                each(mod.depMaps, function (depMap, i) {
+                    var depId = depMap.id,
+                        dep = getOwn(registry, depId);
+
+                    //Only force things that have not completed
+                    //being defined, so still in the registry,
+                    //and only if it has not been matched up
+                    //in the module already.
+                    if (dep && !mod.depMatched[i] && !processed[depId]) {
+                        if (getOwn(traced, depId)) {
+                            mod.defineDep(i, defined[depId]);
+                            mod.check(); //pass false?
+                        } else {
+                            breakCycle(dep, traced, processed);
+                        }
+                    }
+                });
+                processed[id] = true;
+            }
+        }
+
+        function checkLoaded() {
+            var err, usingPathFallback,
+                waitInterval = config.waitSeconds * 1000,
+                //It is possible to disable the wait interval by using waitSeconds of 0.
+                expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
+                noLoads = [],
+                reqCalls = [],
+                stillLoading = false,
+                needCycleCheck = true;
+
+            //Do not bother if this call was a result of a cycle break.
+            if (inCheckLoaded) {
+                return;
+            }
+
+            inCheckLoaded = true;
+
+            //Figure out the state of all the modules.
+            eachProp(enabledRegistry, function (mod) {
+                var map = mod.map,
+                    modId = map.id;
+
+                //Skip things that are not enabled or in error state.
+                if (!mod.enabled) {
+                    return;
+                }
+
+                if (!map.isDefine) {
+                    reqCalls.push(mod);
+                }
+
+                if (!mod.error) {
+                    //If the module should be executed, and it has not
+                    //been inited and time is up, remember it.
+                    if (!mod.inited && expired) {
+                        if (hasPathFallback(modId)) {
+                            usingPathFallback = true;
+                            stillLoading = true;
+                        } else {
+                            noLoads.push(modId);
+                            removeScript(modId);
+                        }
+                    } else if (!mod.inited && mod.fetched && map.isDefine) {
+                        stillLoading = true;
+                        if (!map.prefix) {
+                            //No reason to keep looking for unfinished
+                            //loading. If the only stillLoading is a
+                            //plugin resource though, keep going,
+                            //because it may be that a plugin resource
+                            //is waiting on a non-plugin cycle.
+                            return (needCycleCheck = false);
+                        }
+                    }
+                }
+            });
+
+            if (expired && noLoads.length) {
+                //If wait time expired, throw error of unloaded modules.
+                err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
+                err.contextName = context.contextName;
+                return onError(err);
+            }
+
+            //Not expired, check for a cycle.
+            if (needCycleCheck) {
+                each(reqCalls, function (mod) {
+                    breakCycle(mod, {}, {});
+                });
+            }
+
+            //If still waiting on loads, and the waiting load is something
+            //other than a plugin resource, or there are still outstanding
+            //scripts, then just try back later.
+            if ((!expired || usingPathFallback) && stillLoading) {
+                //Something is still waiting to load. Wait for it, but only
+                //if a timeout is not already in effect.
+                if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
+                    checkLoadedTimeoutId = setTimeout(function () {
+                        checkLoadedTimeoutId = 0;
+                        checkLoaded();
+                    }, 50);
+                }
+            }
+
+            inCheckLoaded = false;
+        }
+
+        Module = function (map) {
+            this.events = getOwn(undefEvents, map.id) || {};
+            this.map = map;
+            this.shim = getOwn(config.shim, map.id);
+            this.depExports = [];
+            this.depMaps = [];
+            this.depMatched = [];
+            this.pluginMaps = {};
+            this.depCount = 0;
+
+            /* this.exports this.factory
+               this.depMaps = [],
+               this.enabled, this.fetched
+            */
+        };
+
+        Module.prototype = {
+            init: function (depMaps, factory, errback, options) {
+                options = options || {};
+
+                //Do not do more inits if already done. Can happen if there
+                //are multiple define calls for the same module. That is not
+                //a normal, common case, but it is also not unexpected.
+                if (this.inited) {
+                    return;
+                }
+
+                this.factory = factory;
+
+                if (errback) {
+                    //Register for errors on this module.
+                    this.on('error', errback);
+                } else if (this.events.error) {
+                    //If no errback already, but there are error listeners
+                    //on this module, set up an errback to pass to the deps.
+                    errback = bind(this, function (err) {
+                        this.emit('error', err);
+                    });
+                }
+
+                //Do a copy of the dependency array, so that
+                //source inputs are not modified. For example
+                //"shim" deps are passed in here directly, and
+                //doing a direct modification of the depMaps array
+                //would affect that config.
+                this.depMaps = depMaps && depMaps.slice(0);
+
+                this.errback = errback;
+
+                //Indicate this module has be initialized
+                this.inited = true;
+
+                this.ignore = options.ignore;
+
+                //Could have option to init this module in enabled mode,
+                //or could have been previously marked as enabled. However,
+                //the dependencies are not known until init is called. So
+                //if enabled previously, now trigger dependencies as enabled.
+                if (options.enabled || this.enabled) {
+                    //Enable this module and dependencies.
+                    //Will call this.check()
+                    this.enable();
+                } else {
+                    this.check();
+                }
+            },
+
+            defineDep: function (i, depExports) {
+                //Because of cycles, defined callback for a given
+                //export can be called more than once.
+                if (!this.depMatched[i]) {
+                    this.depMatched[i] = true;
+                    this.depCount -= 1;
+                    this.depExports[i] = depExports;
+                }
+            },
+
+            fetch: function () {
+                if (this.fetched) {
+                    return;
+                }
+                this.fetched = true;
+
+                context.startTime = (new Date()).getTime();
+
+                var map = this.map;
+
+                //If the manager is for a plugin managed resource,
+                //ask the plugin to load it now.
+                if (this.shim) {
+                    context.makeRequire(this.map, {
+                        enableBuildCallback: true
+                    })(this.shim.deps || [], bind(this, function () {
+                        return map.prefix ? this.callPlugin() : this.load();
+                    }));
+                } else {
+                    //Regular dependency.
+                    return map.prefix ? this.callPlugin() : this.load();
+                }
+            },
+
+            load: function () {
+                var url = this.map.url;
+
+                //Regular dependency.
+                if (!urlFetched[url]) {
+                    urlFetched[url] = true;
+                    context.load(this.map.id, url);
+                }
+            },
+
+            /**
+             * Checks if the module is ready to define itself, and if so,
+             * define it.
+             */
+            check: function () {
+                if (!this.enabled || this.enabling) {
+                    return;
+                }
+
+                var err, cjsModule,
+                    id = this.map.id,
+                    depExports = this.depExports,
+                    exports = this.exports,
+                    factory = this.factory;
+
+                if (!this.inited) {
+                    // Only fetch if not already in the defQueue.
+                    if (!hasProp(context.defQueueMap, id)) {
+                        this.fetch();
+                    }
+                } else if (this.error) {
+                    this.emit('error', this.error);
+                } else if (!this.defining) {
+                    //The factory could trigger another require call
+                    //that would result in checking this module to
+                    //define itself again. If already in the process
+                    //of doing that, skip this work.
+                    this.defining = true;
+
+                    if (this.depCount < 1 && !this.defined) {
+                        if (isFunction(factory)) {
+                            try {
+                                exports = context.execCb(id, factory, depExports, exports);
+                            } catch (e) {
+                                err = e;
+                            }
+
+                            // Favor return value over exports. If node/cjs in play,
+                            // then will not have a return value anyway. Favor
+                            // module.exports assignment over exports object.
+                            if (this.map.isDefine && exports === undefined) {
+                                cjsModule = this.module;
+                                if (cjsModule) {
+                                    exports = cjsModule.exports;
+                                } else if (this.usingExports) {
+                                    //exports already set the defined value.
+                                    exports = this.exports;
+                                }
+                            }
+
+                            if (err) {
+                                // If there is an error listener, favor passing
+                                // to that instead of throwing an error. However,
+                                // only do it for define()'d  modules. require
+                                // errbacks should not be called for failures in
+                                // their callbacks (#699). However if a global
+                                // onError is set, use that.
+                                if ((this.events.error && this.map.isDefine) ||
+                                    req.onError !== defaultOnError) {
+                                    err.requireMap = this.map;
+                                    err.requireModules = this.map.isDefine ? [this.map.id] : null;
+                                    err.requireType = this.map.isDefine ? 'define' : 'require';
+                                    return onError((this.error = err));
+                                } else if (typeof console !== 'undefined' &&
+                                           console.error) {
+                                    // Log the error for debugging. If promises could be
+                                    // used, this would be different, but making do.
+                                    console.error(err);
+                                } else {
+                                    // Do not want to completely lose the error. While this
+                                    // will mess up processing and lead to similar results
+                                    // as bug 1440, it at least surfaces the error.
+                                    req.onError(err);
+                                }
+                            }
+                        } else {
+                            //Just a literal value
+                            exports = factory;
+                        }
+
+                        this.exports = exports;
+
+                        if (this.map.isDefine && !this.ignore) {
+                            defined[id] = exports;
+
+                            if (req.onResourceLoad) {
+                                var resLoadMaps = [];
+                                each(this.depMaps, function (depMap) {
+                                    resLoadMaps.push(depMap.normalizedMap || depMap);
+                                });
+                                req.onResourceLoad(context, this.map, resLoadMaps);
+                            }
+                        }
+
+                        //Clean up
+                        cleanRegistry(id);
+
+                        this.defined = true;
+                    }
+
+                    //Finished the define stage. Allow calling check again
+                    //to allow define notifications below in the case of a
+                    //cycle.
+                    this.defining = false;
+
+                    if (this.defined && !this.defineEmitted) {
+                        this.defineEmitted = true;
+                        this.emit('defined', this.exports);
+                        this.defineEmitComplete = true;
+                    }
+
+                }
+            },
+
+            callPlugin: function () {
+                var map = this.map,
+                    id = map.id,
+                    //Map already normalized the prefix.
+                    pluginMap = makeModuleMap(map.prefix);
+
+                //Mark this as a dependency for this plugin, so it
+                //can be traced for cycles.
+                this.depMaps.push(pluginMap);
+
+                on(pluginMap, 'defined', bind(this, function (plugin) {
+                    var load, normalizedMap, normalizedMod,
+                        bundleId = getOwn(bundlesMap, this.map.id),
+                        name = this.map.name,
+                        parentName = this.map.parentMap ? this.map.parentMap.name : null,
+                        localRequire = context.makeRequire(map.parentMap, {
+                            enableBuildCallback: true
+                        });
+
+                    //If current map is not normalized, wait for that
+                    //normalized name to load instead of continuing.
+                    if (this.map.unnormalized) {
+                        //Normalize the ID if the plugin allows it.
+                        if (plugin.normalize) {
+                            name = plugin.normalize(name, function (name) {
+                                return normalize(name, parentName, true);
+                            }) || '';
+                        }
+
+                        //prefix and name should already be normalized, no need
+                        //for applying map config again either.
+                        normalizedMap = makeModuleMap(map.prefix + '!' + name,
+                                                      this.map.parentMap);
+                        on(normalizedMap,
+                            'defined', bind(this, function (value) {
+                                this.map.normalizedMap = normalizedMap;
+                                this.init([], function () { return value; }, null, {
+                                    enabled: true,
+                                    ignore: true
+                                });
+                            }));
+
+                        normalizedMod = getOwn(registry, normalizedMap.id);
+                        if (normalizedMod) {
+                            //Mark this as a dependency for this plugin, so it
+                            //can be traced for cycles.
+                            this.depMaps.push(normalizedMap);
+
+                            if (this.events.error) {
+                                normalizedMod.on('error', bind(this, function (err) {
+                                    this.emit('error', err);
+                                }));
+                            }
+                            normalizedMod.enable();
+                        }
+
+                        return;
+                    }
+
+                    //If a paths config, then just load that file instead to
+                    //resolve the plugin, as it is built into that paths layer.
+                    if (bundleId) {
+                        this.map.url = context.nameToUrl(bundleId);
+                        this.load();
+                        return;
+                    }
+
+                    load = bind(this, function (value) {
+                        this.init([], function () { return value; }, null, {
+                            enabled: true
+                        });
+                    });
+
+                    load.error = bind(this, function (err) {
+                        this.inited = true;
+                        this.error = err;
+                        err.requireModules = [id];
+
+                        //Remove temp unnormalized modules for this module,
+                        //since they will never be resolved otherwise now.
+                        eachProp(registry, function (mod) {
+                            if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
+                                cleanRegistry(mod.map.id);
+                            }
+                        });
+
+                        onError(err);
+                    });
+
+                    //Allow plugins to load other code without having to know the
+                    //context or how to 'complete' the load.
+                    load.fromText = bind(this, function (text, textAlt) {
+                        /*jslint evil: true */
+                        var moduleName = map.name,
+                            moduleMap = makeModuleMap(moduleName),
+                            hasInteractive = useInteractive;
+
+                        //As of 2.1.0, support just passing the text, to reinforce
+                        //fromText only being called once per resource. Still
+                        //support old style of passing moduleName but discard
+                        //that moduleName in favor of the internal ref.
+                        if (textAlt) {
+                            text = textAlt;
+                        }
+
+                        //Turn off interactive script matching for IE for any define
+                        //calls in the text, then turn it back on at the end.
+                        if (hasInteractive) {
+                            useInteractive = false;
+                        }
+
+                        //Prime the system by creating a module instance for
+                        //it.
+                        getModule(moduleMap);
+
+                        //Transfer any config to this other module.
+                        if (hasProp(config.config, id)) {
+                            config.config[moduleName] = config.config[id];
+                        }
+
+                        try {
+                            req.exec(text);
+                        } catch (e) {
+                            return onError(makeError('fromtexteval',
+                                             'fromText eval for ' + id +
+                                            ' failed: ' + e,
+                                             e,
+                                             [id]));
+                        }
+
+                        if (hasInteractive) {
+                            useInteractive = true;
+                        }
+
+                        //Mark this as a dependency for the plugin
+                        //resource
+                        this.depMaps.push(moduleMap);
+
+                        //Support anonymous modules.
+                        context.completeLoad(moduleName);
+
+                        //Bind the value of that module to the value for this
+                        //resource ID.
+                        localRequire([moduleName], load);
+                    });
+
+                    //Use parentName here since the plugin's name is not reliable,
+                    //could be some weird string with no path that actually wants to
+                    //reference the parentName's path.
+                    plugin.load(map.name, localRequire, load, config);
+                }));
+
+                context.enable(pluginMap, this);
+                this.pluginMaps[pluginMap.id] = pluginMap;
+            },
+
+            enable: function () {
+                enabledRegistry[this.map.id] = this;
+                this.enabled = true;
+
+                //Set flag mentioning that the module is enabling,
+                //so that immediate calls to the defined callbacks
+                //for dependencies do not trigger inadvertent load
+                //with the depCount still being zero.
+                this.enabling = true;
+
+                //Enable each dependency
+                each(this.depMaps, bind(this, function (depMap, i) {
+                    var id, mod, handler;
+
+                    if (typeof depMap === 'string') {
+                        //Dependency needs to be converted to a depMap
+                        //and wired up to this module.
+                        depMap = makeModuleMap(depMap,
+                                               (this.map.isDefine ? this.map : this.map.parentMap),
+                                               false,
+                                               !this.skipMap);
+                        this.depMaps[i] = depMap;
+
+                        handler = getOwn(handlers, depMap.id);
+
+                        if (handler) {
+                            this.depExports[i] = handler(this);
+                            return;
+                        }
+
+                        this.depCount += 1;
+
+                        on(depMap, 'defined', bind(this, function (depExports) {
+                            if (this.undefed) {
+                                return;
+                            }
+                            this.defineDep(i, depExports);
+                            this.check();
+                        }));
+
+                        if (this.errback) {
+                            on(depMap, 'error', bind(this, this.errback));
+                        } else if (this.events.error) {
+                            // No direct errback on this module, but something
+                            // else is listening for errors, so be sure to
+                            // propagate the error correctly.
+                            on(depMap, 'error', bind(this, function(err) {
+                                this.emit('error', err);
+                            }));
+                        }
+                    }
+
+                    id = depMap.id;
+                    mod = registry[id];
+
+                    //Skip special modules like 'require', 'exports', 'module'
+                    //Also, don't call enable if it is already enabled,
+                    //important in circular dependency cases.
+                    if (!hasProp(handlers, id) && mod && !mod.enabled) {
+                        context.enable(depMap, this);
+                    }
+                }));
+
+                //Enable each plugin that is used in
+                //a dependency
+                eachProp(this.pluginMaps, bind(this, function (pluginMap) {
+                    var mod = getOwn(registry, pluginMap.id);
+                    if (mod && !mod.enabled) {
+                        context.enable(pluginMap, this);
+                    }
+                }));
+
+                this.enabling = false;
+
+                this.check();
+            },
+
+            on: function (name, cb) {
+                var cbs = this.events[name];
+                if (!cbs) {
+                    cbs = this.events[name] = [];
+                }
+                cbs.push(cb);
+            },
+
+            emit: function (name, evt) {
+                each(this.events[name], function (cb) {
+                    cb(evt);
+                });
+                if (name === 'error') {
+                    //Now that the error handler was triggered, remove
+                    //the listeners, since this broken Module instance
+                    //can stay around for a while in the registry.
+                    delete this.events[name];
+                }
+            }
+        };
+
+        function callGetModule(args) {
+            //Skip modules already defined.
+            if (!hasProp(defined, args[0])) {
+                getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
+            }
+        }
+
+        function removeListener(node, func, name, ieName) {
+            //Favor detachEvent because of IE9
+            //issue, see attachEvent/addEventListener comment elsewhere
+            //in this file.
+            if (node.detachEvent && !isOpera) {
+                //Probably IE. If not it will throw an error, which will be
+                //useful to know.
+                if (ieName) {
+                    node.detachEvent(ieName, func);
+                }
+            } else {
+                node.removeEventListener(name, func, false);
+            }
+        }
+
+        /**
+         * Given an event from a script node, get the requirejs info from it,
+         * and then removes the event listeners on the node.
+         * @param {Event} evt
+         * @returns {Object}
+         */
+        function getScriptData(evt) {
+            //Using currentTarget instead of target for Firefox 2.0's sake. Not
+            //all old browsers will be supported, but this one was easy enough
+            //to support and still makes sense.
+            var node = evt.currentTarget || evt.srcElement;
+
+            //Remove the listeners once here.
+            removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
+            removeListener(node, context.onScriptError, 'error');
+
+            return {
+                node: node,
+                id: node && node.getAttribute('data-requiremodule')
+            };
+        }
+
+        function intakeDefines() {
+            var args;
+
+            //Any defined modules in the global queue, intake them now.
+            takeGlobalQueue();
+
+            //Make sure any remaining defQueue items get properly processed.
+            while (defQueue.length) {
+                args = defQueue.shift();
+                if (args[0] === null) {
+                    return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' +
+                        args[args.length - 1]));
+                } else {
+                    //args are id, deps, factory. Should be normalized by the
+                    //define() function.
+                    callGetModule(args);
+                }
+            }
+            context.defQueueMap = {};
+        }
+
+        context = {
+            config: config,
+            contextName: contextName,
+            registry: registry,
+            defined: defined,
+            urlFetched: urlFetched,
+            defQueue: defQueue,
+            defQueueMap: {},
+            Module: Module,
+            makeModuleMap: makeModuleMap,
+            nextTick: req.nextTick,
+            onError: onError,
+
+            /**
+             * Set a configuration for the context.
+             * @param {Object} cfg config object to integrate.
+             */
+            configure: function (cfg) {
+                //Make sure the baseUrl ends in a slash.
+                if (cfg.baseUrl) {
+                    if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
+                        cfg.baseUrl += '/';
+                    }
+                }
+
+                //Save off the paths since they require special processing,
+                //they are additive.
+                var shim = config.shim,
+                    objs = {
+                        paths: true,
+                        bundles: true,
+                        config: true,
+                        map: true
+                    };
+
+                eachProp(cfg, function (value, prop) {
+                    if (objs[prop]) {
+                        if (!config[prop]) {
+                            config[prop] = {};
+                        }
+                        mixin(config[prop], value, true, true);
+                    } else {
+                        config[prop] = value;
+                    }
+                });
+
+                //Reverse map the bundles
+                if (cfg.bundles) {
+                    eachProp(cfg.bundles, function (value, prop) {
+                        each(value, function (v) {
+                            if (v !== prop) {
+                                bundlesMap[v] = prop;
+                            }
+                        });
+                    });
+                }
+
+                //Merge shim
+                if (cfg.shim) {
+                    eachProp(cfg.shim, function (value, id) {
+                        //Normalize the structure
+                        if (isArray(value)) {
+                            value = {
+                                deps: value
+                            };
+                        }
+                        if ((value.exports || value.init) && !value.exportsFn) {
+                            value.exportsFn = context.makeShimExports(value);
+                        }
+                        shim[id] = value;
+                    });
+                    config.shim = shim;
+                }
+
+                //Adjust packages if necessary.
+                if (cfg.packages) {
+                    each(cfg.packages, function (pkgObj) {
+                        var location, name;
+
+                        pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj;
+
+                        name = pkgObj.name;
+                        location = pkgObj.location;
+                        if (location) {
+                            config.paths[name] = pkgObj.location;
+                        }
+
+                        //Save pointer to main module ID for pkg name.
+                        //Remove leading dot in main, so main paths are normalized,
+                        //and remove any trailing .js, since different package
+                        //envs have different conventions: some use a module name,
+                        //some use a file name.
+                        config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')
+                                     .replace(currDirRegExp, '')
+                                     .replace(jsSuffixRegExp, '');
+                    });
+                }
+
+                //If there are any "waiting to execute" modules in the registry,
+                //update the maps for them, since their info, like URLs to load,
+                //may have changed.
+                eachProp(registry, function (mod, id) {
+                    //If module already has init called, since it is too
+                    //late to modify them, and ignore unnormalized ones
+                    //since they are transient.
+                    if (!mod.inited && !mod.map.unnormalized) {
+                        mod.map = makeModuleMap(id, null, true);
+                    }
+                });
+
+                //If a deps array or a config callback is specified, then call
+                //require with those args. This is useful when require is defined as a
+                //config object before require.js is loaded.
+                if (cfg.deps || cfg.callback) {
+                    context.require(cfg.deps || [], cfg.callback);
+                }
+            },
+
+            makeShimExports: function (value) {
+                function fn() {
+                    var ret;
+                    if (value.init) {
+                        ret = value.init.apply(global, arguments);
+                    }
+                    return ret || (value.exports && getGlobal(value.exports));
+                }
+                return fn;
+            },
+
+            makeRequire: function (relMap, options) {
+                options = options || {};
+
+                function localRequire(deps, callback, errback) {
+                    var id, map, requireMod;
+
+                    if (options.enableBuildCallback && callback && isFunction(callback)) {
+                        callback.__requireJsBuild = true;
+                    }
+
+                    if (typeof deps === 'string') {
+                        if (isFunction(callback)) {
+                            //Invalid call
+                            return onError(makeError('requireargs', 'Invalid require call'), errback);
+                        }
+
+                        //If require|exports|module are requested, get the
+                        //value for them from the special handlers. Caveat:
+                        //this only works while module is being defined.
+                        if (relMap && hasProp(handlers, deps)) {
+                            return handlers[deps](registry[relMap.id]);
+                        }
+
+                        //Synchronous access to one module. If require.get is
+                        //available (as in the Node adapter), prefer that.
+                        if (req.get) {
+                            return req.get(context, deps, relMap, localRequire);
+                        }
+
+                        //Normalize module name, if it contains . or ..
+                        map = makeModuleMap(deps, relMap, false, true);
+                        id = map.id;
+
+                        if (!hasProp(defined, id)) {
+                            return onError(makeError('notloaded', 'Module name "' +
+                                        id +
+                                        '" has not been loaded yet for context: ' +
+                                        contextName +
+                                        (relMap ? '' : '. Use require([])')));
+                        }
+                        return defined[id];
+                    }
+
+                    //Grab defines waiting in the global queue.
+                    intakeDefines();
+
+                    //Mark all the dependencies as needing to be loaded.
+                    context.nextTick(function () {
+                        //Some defines could have been added since the
+                        //require call, collect them.
+                        intakeDefines();
+
+                        requireMod = getModule(makeModuleMap(null, relMap));
+
+                        //Store if map config should be applied to this require
+                        //call for dependencies.
+                        requireMod.skipMap = options.skipMap;
+
+                        requireMod.init(deps, callback, errback, {
+                            enabled: true
+                        });
+
+                        checkLoaded();
+                    });
+
+                    return localRequire;
+                }
+
+                mixin(localRequire, {
+                    isBrowser: isBrowser,
+
+                    /**
+                     * Converts a module name + .extension into an URL path.
+                     * *Requires* the use of a module name. It does not support using
+                     * plain URLs like nameToUrl.
+                     */
+                    toUrl: function (moduleNamePlusExt) {
+                        var ext,
+                            index = moduleNamePlusExt.lastIndexOf('.'),
+                            segment = moduleNamePlusExt.split('/')[0],
+                            isRelative = segment === '.' || segment === '..';
+
+                        //Have a file extension alias, and it is not the
+                        //dots from a relative path.
+                        if (index !== -1 && (!isRelative || index > 1)) {
+                            ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
+                            moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
+                        }
+
+                        return context.nameToUrl(normalize(moduleNamePlusExt,
+                                                relMap && relMap.id, true), ext,  true);
+                    },
+
+                    defined: function (id) {
+                        return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
+                    },
+
+                    specified: function (id) {
+                        id = makeModuleMap(id, relMap, false, true).id;
+                        return hasProp(defined, id) || hasProp(registry, id);
+                    }
+                });
+
+                //Only allow undef on top level require calls
+                if (!relMap) {
+                    localRequire.undef = function (id) {
+                        //Bind any waiting define() calls to this context,
+                        //fix for #408
+                        takeGlobalQueue();
+
+                        var map = makeModuleMap(id, relMap, true),
+                            mod = getOwn(registry, id);
+
+                        mod.undefed = true;
+                        removeScript(id);
+
+                        delete defined[id];
+                        delete urlFetched[map.url];
+                        delete undefEvents[id];
+
+                        //Clean queued defines too. Go backwards
+                        //in array so that the splices do not
+                        //mess up the iteration.
+                        eachReverse(defQueue, function(args, i) {
+                            if (args[0] === id) {
+                                defQueue.splice(i, 1);
+                            }
+                        });
+                        delete context.defQueueMap[id];
+
+                        if (mod) {
+                            //Hold on to listeners in case the
+                            //module will be attempted to be reloaded
+                            //using a different config.
+                            if (mod.events.defined) {
+                                undefEvents[id] = mod.events;
+                            }
+
+                            cleanRegistry(id);
+                        }
+                    };
+                }
+
+                return localRequire;
+            },
+
+            /**
+             * Called to enable a module if it is still in the registry
+             * awaiting enablement. A second arg, parent, the parent module,
+             * is passed in for context, when this method is overridden by
+             * the optimizer. Not shown here to keep code compact.
+             */
+            enable: function (depMap) {
+                var mod = getOwn(registry, depMap.id);
+                if (mod) {
+                    getModule(depMap).enable();
+                }
+            },
+
+            /**
+             * Internal method used by environment adapters to complete a load event.
+             * A load event could be a script load or just a load pass from a synchronous
+             * load call.
+             * @param {String} moduleName the name of the module to potentially complete.
+             */
+            completeLoad: function (moduleName) {
+                var found, args, mod,
+                    shim = getOwn(config.shim, moduleName) || {},
+                    shExports = shim.exports;
+
+                takeGlobalQueue();
+
+                while (defQueue.length) {
+                    args = defQueue.shift();
+                    if (args[0] === null) {
+                        args[0] = moduleName;
+                        //If already found an anonymous module and bound it
+                        //to this name, then this is some other anon module
+                        //waiting for its completeLoad to fire.
+                        if (found) {
+                            break;
+                        }
+                        found = true;
+                    } else if (args[0] === moduleName) {
+                        //Found matching define call for this script!
+                        found = true;
+                    }
+
+                    callGetModule(args);
+                }
+                context.defQueueMap = {};
+
+                //Do this after the cycle of callGetModule in case the result
+                //of those calls/init calls changes the registry.
+                mod = getOwn(registry, moduleName);
+
+                if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
+                    if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
+                        if (hasPathFallback(moduleName)) {
+                            return;
+                        } else {
+                            return onError(makeError('nodefine',
+                                             'No define call for ' + moduleName,
+                                             null,
+                                             [moduleName]));
+                        }
+                    } else {
+                        //A script that does not call define(), so just simulate
+                        //the call for it.
+                        callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);
+                    }
+                }
+
+                checkLoaded();
+            },
+
+            /**
+             * Converts a module name to a file path. Supports cases where
+             * moduleName may actually be just an URL.
+             * Note that it **does not** call normalize on the moduleName,
+             * it is assumed to have already been normalized. This is an
+             * internal API, not a public one. Use toUrl for the public API.
+             */
+            nameToUrl: function (moduleName, ext, skipExt) {
+                var paths, syms, i, parentModule, url,
+                    parentPath, bundleId,
+                    pkgMain = getOwn(config.pkgs, moduleName);
+
+                if (pkgMain) {
+                    moduleName = pkgMain;
+                }
+
+                bundleId = getOwn(bundlesMap, moduleName);
+
+                if (bundleId) {
+                    return context.nameToUrl(bundleId, ext, skipExt);
+                }
+
+                //If a colon is in the URL, it indicates a protocol is used and it is just
+                //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
+                //or ends with .js, then assume the user meant to use an url and not a module id.
+                //The slash is important for protocol-less URLs as well as full paths.
+                if (req.jsExtRegExp.test(moduleName)) {
+                    //Just a plain path, not module name lookup, so just return it.
+                    //Add extension if it is included. This is a bit wonky, only non-.js things pass
+                    //an extension, this method probably needs to be reworked.
+                    url = moduleName + (ext || '');
+                } else {
+                    //A module that needs to be converted to a path.
+                    paths = config.paths;
+
+                    syms = moduleName.split('/');
+                    //For each module name segment, see if there is a path
+                    //registered for it. Start with most specific name
+                    //and work up from it.
+                    for (i = syms.length; i > 0; i -= 1) {
+                        parentModule = syms.slice(0, i).join('/');
+
+                        parentPath = getOwn(paths, parentModule);
+                        if (parentPath) {
+                            //If an array, it means there are a few choices,
+                            //Choose the one that is desired
+                            if (isArray(parentPath)) {
+                                parentPath = parentPath[0];
+                            }
+                            syms.splice(0, i, parentPath);
+                            break;
+                        }
+                    }
+
+                    //Join the path parts together, then figure out if baseUrl is needed.
+                    url = syms.join('/');
+                    url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js'));
+                    url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
+                }
+
+                return config.urlArgs ? url +
+                                        ((url.indexOf('?') === -1 ? '?' : '&') +
+                                         config.urlArgs) : url;
+            },
+
+            //Delegates to req.load. Broken out as a separate function to
+            //allow overriding in the optimizer.
+            load: function (id, url) {
+                req.load(context, id, url);
+            },
+
+            /**
+             * Executes a module callback function. Broken out as a separate function
+             * solely to allow the build system to sequence the files in the built
+             * layer in the right sequence.
+             *
+             * @private
+             */
+            execCb: function (name, callback, args, exports) {
+                return callback.apply(exports, args);
+            },
+
+            /**
+             * callback for script loads, used to check status of loading.
+             *
+             * @param {Event} evt the event from the browser for the script
+             * that was loaded.
+             */
+            onScriptLoad: function (evt) {
+                //Using currentTarget instead of target for Firefox 2.0's sake. Not
+                //all old browsers will be supported, but this one was easy enough
+                //to support and still makes sense.
+                if (evt.type === 'load' ||
+                        (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
+                    //Reset interactive script so a script node is not held onto for
+                    //to long.
+                    interactiveScript = null;
+
+                    //Pull out the name of the module and the context.
+                    var data = getScriptData(evt);
+                    context.completeLoad(data.id);
+                }
+            },
+
+            /**
+             * Callback for script errors.
+             */
+            onScriptError: function (evt) {
+                var data = getScriptData(evt);
+                if (!hasPathFallback(data.id)) {
+                    var parents = [];
+                    eachProp(registry, function(value, key) {
+                        if (key.indexOf('_@r') !== 0) {
+                            each(value.depMaps, function(depMap) {
+                                if (depMap.id === data.id) {
+                                    parents.push(key);
+                                }
+                                return true;
+                            });
+                        }
+                    });
+                    return onError(makeError('scripterror', 'Script error for "' + data.id +
+                                             (parents.length ?
+                                             '", needed by: ' + parents.join(', ') :
+                                             '"'), evt, [data.id]));
+                }
+            }
+        };
+
+        context.require = context.makeRequire();
+        return context;
+    }
+
+    /**
+     * Main entry point.
+     *
+     * If the only argument to require is a string, then the module that
+     * is represented by that string is fetched for the appropriate context.
+     *
+     * If the first argument is an array, then it will be treated as an array
+     * of dependency string names to fetch. An optional function callback can
+     * be specified to execute when all of those dependencies are available.
+     *
+     * Make a local req variable to help Caja compliance (it assumes things
+     * on a require that are not standardized), and to give a short
+     * name for minification/local scope use.
+     */
+    req = requirejs = function (deps, callback, errback, optional) {
+
+        //Find the right context, use default
+        var context, config,
+            contextName = defContextName;
+
+        // Determine if have config object in the call.
+        if (!isArray(deps) && typeof deps !== 'string') {
+            // deps is a config object
+            config = deps;
+            if (isArray(callback)) {
+                // Adjust args if there are dependencies
+                deps = callback;
+                callback = errback;
+                errback = optional;
+            } else {
+                deps = [];
+            }
+        }
+
+        if (config && config.context) {
+            contextName = config.context;
+        }
+
+        context = getOwn(contexts, contextName);
+        if (!context) {
+            context = contexts[contextName] = req.s.newContext(contextName);
+        }
+
+        if (config) {
+            context.configure(config);
+        }
+
+        return context.require(deps, callback, errback);
+    };
+
+    /**
+     * Support require.config() to make it easier to cooperate with other
+     * AMD loaders on globally agreed names.
+     */
+    req.config = function (config) {
+        return req(config);
+    };
+
+    /**
+     * Execute something after the current tick
+     * of the event loop. Override for other envs
+     * that have a better solution than setTimeout.
+     * @param  {Function} fn function to execute later.
+     */
+    req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
+        setTimeout(fn, 4);
+    } : function (fn) { fn(); };
+
+    /**
+     * Export require as a global, but only if it does not already exist.
+     */
+    if (!require) {
+        require = req;
+    }
+
+    req.version = version;
+
+    //Used to filter out dependencies that are already paths.
+    req.jsExtRegExp = /^\/|:|\?|\.js$/;
+    req.isBrowser = isBrowser;
+    s = req.s = {
+        contexts: contexts,
+        newContext: newContext
+    };
+
+    //Create default context.
+    req({});
+
+    //Exports some context-sensitive methods on global require.
+    each([
+        'toUrl',
+        'undef',
+        'defined',
+        'specified'
+    ], function (prop) {
+        //Reference from contexts instead of early binding to default context,
+        //so that during builds, the latest instance of the default context
+        //with its config gets used.
+        req[prop] = function () {
+            var ctx = contexts[defContextName];
+            return ctx.require[prop].apply(ctx, arguments);
+        };
+    });
+
+    if (isBrowser) {
+        head = s.head = document.getElementsByTagName('head')[0];
+        //If BASE tag is in play, using appendChild is a problem for IE6.
+        //When that browser dies, this can be removed. Details in this jQuery bug:
+        //http://dev.jquery.com/ticket/2709
+        baseElement = document.getElementsByTagName('base')[0];
+        if (baseElement) {
+            head = s.head = baseElement.parentNode;
+        }
+    }
+
+    /**
+     * Any errors that require explicitly generates will be passed to this
+     * function. Intercept/override it if you want custom error handling.
+     * @param {Error} err the error object.
+     */
+    req.onError = defaultOnError;
+
+    /**
+     * Creates the node for the load command. Only used in browser envs.
+     */
+    req.createNode = function (config, moduleName, url) {
+        var node = config.xhtml ?
+                document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
+                document.createElement('script');
+        node.type = config.scriptType || 'text/javascript';
+        node.charset = 'utf-8';
+        node.async = true;
+        return node;
+    };
+
+    /**
+     * Does the request to load a module for the browser case.
+     * Make this a separate function to allow other environments
+     * to override it.
+     *
+     * @param {Object} context the require context to find state.
+     * @param {String} moduleName the name of the module.
+     * @param {Object} url the URL to the module.
+     */
+    req.load = function (context, moduleName, url) {
+        var config = (context && context.config) || {},
+            node;
+        if (isBrowser) {
+            //In the browser so use a script tag
+            node = req.createNode(config, moduleName, url);
+            if (config.onNodeCreated) {
+                config.onNodeCreated(node, config, moduleName, url);
+            }
+
+            node.setAttribute('data-requirecontext', context.contextName);
+            node.setAttribute('data-requiremodule', moduleName);
+
+            //Set up load listener. Test attachEvent first because IE9 has
+            //a subtle issue in its addEventListener and script onload firings
+            //that do not match the behavior of all other browsers with
+            //addEventListener support, which fire the onload event for a
+            //script right after the script execution. See:
+            //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
+            //UNFORTUNATELY Opera implements attachEvent but does not follow the script
+            //script execution mode.
+            if (node.attachEvent &&
+                    //Check if node.attachEvent is artificially added by custom script or
+                    //natively supported by browser
+                    //read https://github.com/jrburke/requirejs/issues/187
+                    //if we can NOT find [native code] then it must NOT natively supported.
+                    //in IE8, node.attachEvent does not have toString()
+                    //Note the test for "[native code" with no closing brace, see:
+                    //https://github.com/jrburke/requirejs/issues/273
+                    !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
+                    !isOpera) {
+                //Probably IE. IE (at least 6-8) do not fire
+                //script onload right after executing the script, so
+                //we cannot tie the anonymous define call to a name.
+                //However, IE reports the script as being in 'interactive'
+                //readyState at the time of the define call.
+                useInteractive = true;
+
+                node.attachEvent('onreadystatechange', context.onScriptLoad);
+                //It would be great to add an error handler here to catch
+                //404s in IE9+. However, onreadystatechange will fire before
+                //the error handler, so that does not help. If addEventListener
+                //is used, then IE will fire error before load, but we cannot
+                //use that pathway given the connect.microsoft.com issue
+                //mentioned above about not doing the 'script execute,
+                //then fire the script load event listener before execute
+                //next script' that other browsers do.
+                //Best hope: IE10 fixes the issues,
+                //and then destroys all installs of IE 6-9.
+                //node.attachEvent('onerror', context.onScriptError);
+            } else {
+                node.addEventListener('load', context.onScriptLoad, false);
+                node.addEventListener('error', context.onScriptError, false);
+            }
+            node.src = url;
+
+            //For some cache cases in IE 6-8, the script executes before the end
+            //of the appendChild execution, so to tie an anonymous define
+            //call to the module name (which is stored on the node), hold on
+            //to a reference to this node, but clear after the DOM insertion.
+            currentlyAddingScript = node;
+            if (baseElement) {
+                head.insertBefore(node, baseElement);
+            } else {
+                head.appendChild(node);
+            }
+            currentlyAddingScript = null;
+
+            return node;
+        } else if (isWebWorker) {
+            try {
+                //In a web worker, use importScripts. This is not a very
+                //efficient use of importScripts, importScripts will block until
+                //its script is downloaded and evaluated. However, if web workers
+                //are in play, the expectation is that a build has been done so
+                //that only one script needs to be loaded anyway. This may need
+                //to be reevaluated if other use cases become common.
+                importScripts(url);
+
+                //Account for anonymous modules
+                context.completeLoad(moduleName);
+            } catch (e) {
+                context.onError(makeError('importscripts',
+                                'importScripts failed for ' +
+                                    moduleName + ' at ' + url,
+                                e,
+                                [moduleName]));
+            }
+        }
+    };
+
+    function getInteractiveScript() {
+        if (interactiveScript && interactiveScript.readyState === 'interactive') {
+            return interactiveScript;
+        }
+
+        eachReverse(scripts(), function (script) {
+            if (script.readyState === 'interactive') {
+                return (interactiveScript = script);
+            }
+        });
+        return interactiveScript;
+    }
+
+    //Look for a data-main script attribute, which could also adjust the baseUrl.
+    if (isBrowser && !cfg.skipDataMain) {
+        //Figure out baseUrl. Get it from the script tag with require.js in it.
+        eachReverse(scripts(), function (script) {
+            //Set the 'head' where we can append children by
+            //using the script's parent.
+            if (!head) {
+                head = script.parentNode;
+            }
+
+            //Look for a data-main attribute to set main script for the page
+            //to load. If it is there, the path to data main becomes the
+            //baseUrl, if it is not already set.
+            dataMain = script.getAttribute('data-main');
+            if (dataMain) {
+                //Preserve dataMain in case it is a path (i.e. contains '?')
+                mainScript = dataMain;
+
+                //Set final baseUrl if there is not already an explicit one.
+                if (!cfg.baseUrl) {
+                    //Pull off the directory of data-main for use as the
+                    //baseUrl.
+                    src = mainScript.split('/');
+                    mainScript = src.pop();
+                    subPath = src.length ? src.join('/')  + '/' : './';
+
+                    cfg.baseUrl = subPath;
+                }
+
+                //Strip off any trailing .js since mainScript is now
+                //like a module name.
+                mainScript = mainScript.replace(jsSuffixRegExp, '');
+
+                //If mainScript is still a path, fall back to dataMain
+                if (req.jsExtRegExp.test(mainScript)) {
+                    mainScript = dataMain;
+                }
+
+                //Put the data-main script in the files to load.
+                cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];
+
+                return true;
+            }
+        });
+    }
+
+    /**
+     * The function that handles definitions of modules. Differs from
+     * require() in that a string for the module should be the first argument,
+     * and the function to execute after dependencies are loaded should
+     * return a value to define the module corresponding to the first argument's
+     * name.
+     */
+    define = function (name, deps, callback) {
+        var node, context;
+
+        //Allow for anonymous modules
+        if (typeof name !== 'string') {
+            //Adjust args appropriately
+            callback = deps;
+            deps = name;
+            name = null;
+        }
+
+        //This module may not have dependencies
+        if (!isArray(deps)) {
+            callback = deps;
+            deps = null;
+        }
+
+        //If no name, and callback is a function, then figure out if it a
+        //CommonJS thing with dependencies.
+        if (!deps && isFunction(callback)) {
+            deps = [];
+            //Remove comments from the callback string,
+            //look for require calls, and pull them into the dependencies,
+            //but only if there are function args.
+            if (callback.length) {
+                callback
+                    .toString()
+                    .replace(commentRegExp, '')
+                    .replace(cjsRequireRegExp, function (match, dep) {
+                        deps.push(dep);
+                    });
+
+                //May be a CommonJS thing even without require calls, but still
+                //could use exports, and module. Avoid doing exports and module
+                //work though if it just needs require.
+                //REQUIRES the function to expect the CommonJS variables in the
+                //order listed below.
+                deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);
+            }
+        }
+
+        //If in IE 6-8 and hit an anonymous define() call, do the interactive
+        //work.
+        if (useInteractive) {
+            node = currentlyAddingScript || getInteractiveScript();
+            if (node) {
+                if (!name) {
+                    name = node.getAttribute('data-requiremodule');
+                }
+                context = contexts[node.getAttribute('data-requirecontext')];
+            }
+        }
+
+        //Always save off evaluating the def call until the script onload handler.
+        //This allows multiple modules to be in a file without prematurely
+        //tracing dependencies, and allows for anonymous module support,
+        //where the module name is not known until the script onload event
+        //occurs. If no context, use the global queue, and get it processed
+        //in the onscript load callback.
+        if (context) {
+            context.defQueue.push([name, deps, callback]);
+            context.defQueueMap[name] = true;
+        } else {
+            globalDefQueue.push([name, deps, callback]);
+        }
+    };
+
+    define.amd = {
+        jQuery: true
+    };
+
+    /**
+     * Executes the text. Normally just uses eval, but can be modified
+     * to use a better, environment-specific call. Only used for transpiling
+     * loader plugins, not for plain JS modules.
+     * @param {String} text the text to execute/evaluate.
+     */
+    req.exec = function (text) {
+        /*jslint evil: true */
+        return eval(text);
+    };
+
+    //Set up with config info.
+    req(cfg);
+}(this));

+ 119 - 0
main/inc/lib/formvalidator/Element/DateTimeRangePicker.php

@@ -0,0 +1,119 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+ * Form element to select a date.
+ *
+ * Class DatePicker
+ */
+class DateTimeRangePicker extends DateRangePicker
+{
+    /**
+     * HTML code to display this datepicker.
+     *
+     * @return string
+     */
+    public function toHtml()
+    {
+        if ($this->_flagFrozen) {
+            return $this->getFrozenHtml();
+        }
+
+        $id = $this->getAttribute('id');
+        $value = $this->getValue();
+        $label = $this->getLabel();
+
+        if (!empty($value)) {
+            $value = api_format_date($value, DATE_FORMAT_LONG_NO_DAY);
+        }
+
+        return '
+            <div class="input-group">
+                <span class="input-group-addon cursor-pointer">
+                    <input '.$this->_getAttrString($this->_attributes).'>
+                </span>
+                <p class="form-control disabled" id="'.$id.'_alt_text">'.$value.'</p>
+                <input class="form-control" type="hidden" id="'.$id.'_alt" value="'.$value.'">
+                <span class="input-group-btn">
+                    <button class="btn btn-default" type="button"
+                            title="'.sprintf(get_lang('ResetFieldX'), $this->_label).'">
+                        <span class="fa fa-trash text-danger" aria-hidden="true"></span>
+                        <span class="sr-only">'.sprintf(get_lang('ResetFieldX'), $this->_label).'</span>
+                    </button>
+                </span>                
+            </div>
+            <div class="input-group">
+                <br />
+                <p id="'.$id.'_time_range">
+                    <input type="text" name="'.$id.'_time_range_start" class="time start" autocomplete="off"> 
+                    '.get_lang('To').'
+                    <input type="text" name="'.$id.'_time_range_end" class="time end " autocomplete="off">
+                </p>
+            </div>
+        '.$this->getElementJS();
+    }
+
+    /**
+     * Get the necessary javascript for this datepicker.
+     *
+     * @return string
+     */
+    private function getElementJS()
+    {
+        $js = null;
+        $id = $this->getAttribute('id');
+
+        $js .= "<script>                    
+            $(function() {
+                var txtDate = $('#$id'),
+                    inputGroup = txtDate.parents('.input-group'),
+                    txtDateAlt = $('#{$id}_alt'),
+                    txtDateAltText = $('#{$id}_alt_text');
+                    
+                txtDate
+                    .hide()
+                    .datepicker({
+                        defaultDate: '".$this->getValue()."',
+                        dateFormat: 'yy-mm-dd',
+                        altField: '#{$id}_alt',
+                        altFormat: \"".get_lang('DateFormatLongNoDayJS')."\",
+                        showOn: 'both',
+                        buttonImage: '".Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true)."',
+                        buttonImageOnly: true,
+                        buttonText: '".get_lang('SelectDate')."',
+                        changeMonth: true,
+                        changeYear: true,
+                        yearRange: 'c-60y:c+5y'
+                    })
+                    .on('change', function (e) {
+                        txtDateAltText.text(txtDateAlt.val());
+                    });
+                    
+                txtDateAltText.on('click', function () {
+                    txtDate.datepicker('show');
+                });
+
+                inputGroup
+                    .find('button')
+                    .on('click', function (e) {
+                        e.preventDefault();
+
+                        $('#$id, #{$id}_alt').val('');
+                        $('#{$id}_alt_text').html('');
+                    });
+                
+                $('#".$id."_time_range .time').timepicker({
+                    'showDuration': true,
+                    'timeFormat': 'H:i:s',
+                    'scrollDefault': 'now',
+                    
+                });
+                var timeOnlyExampleEl = document.getElementById('".$id."_time_range');
+                var timeOnlyDatepair = new Datepair(timeOnlyExampleEl);
+                
+            });
+        </script>";
+
+        return $js;
+    }
+}

+ 183 - 0
main/survey/create_meeting.php

@@ -0,0 +1,183 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+require_once __DIR__.'/../inc/global.inc.php';
+
+$this_section = SECTION_COURSES;
+
+if (!api_is_allowed_to_edit()) {
+    api_not_allowed(true);
+}
+$htmlHeadXtra[] = api_get_css_asset('jt.timepicker/jquery.timepicker.css');
+$htmlHeadXtra[] = api_get_asset('jt.timepicker/jquery.timepicker.js');
+$htmlHeadXtra[] = api_get_asset('datepair.js/dist/datepair.js');
+$htmlHeadXtra[] = api_get_asset('datepair.js/dist/jquery.datepair.js');
+
+$interbreadcrumb[] = [
+    'url' => api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq(),
+    'name' => get_lang('SurveyList'),
+];
+
+$courseInfo = api_get_course_info();
+
+$tool_name = get_lang('CreateMeeting');
+
+$form = new FormValidator(
+    'survey',
+    'post',
+    api_get_self().'?action=add&'.api_get_cidreq()
+);
+
+$form->addElement('header', $tool_name);
+$form->addHidden('anonymous', 0);
+$form->addHidden('survey_language', $courseInfo['language']);
+$form->addHidden('survey_subtitle', '');
+$form->addHidden('survey_thanks', '');
+$form->addHidden('visible_results', '0');
+$form->addHidden('survey_type', 3);
+
+// Setting the form elements
+/*if ($_GET['action'] == 'edit' && isset($survey_id) && is_numeric($survey_id)) {
+    $form->addElement('hidden', 'survey_id');
+}*/
+
+$text = $form->addElement(
+    'text',
+    'survey_title',
+    get_lang('Title'),
+    null,
+    ['ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '200']
+);
+
+$form->addDateTimePicker('start_date', get_lang('StartDate'));
+$form->addDateTimePicker('end_date', get_lang('EndDate'));
+
+$form->addRule('start_date', get_lang('InvalidDate'), 'datetime');
+$form->addRule('end_date', get_lang('InvalidDate'), 'datetime');
+$form->addRule(
+    ['start_date', 'end_date'],
+    get_lang('StartDateShouldBeBeforeEndDate'),
+    'date_compare',
+    'lte'
+);
+
+$form->addHtmlEditor('survey_introduction', get_lang('Description'), false);
+$form->setRequired($text);
+
+$hideList = '';
+$maxEvents = 20;
+for ($i = 1; $i <= $maxEvents; $i++) {
+    $name = 'time_'.$i;
+    $form->addDateTimeRangePicker($name, get_lang('Time'));
+    if ($i > 3) {
+        $hideList .= "$('#".$name."_alt').parent().parent().parent().hide();";
+    }
+}
+
+$form->addHtml('<script>
+$(function() {
+    '.$hideList.'
+    var number = 3;    
+    $("#add_button").on("click", function() {
+        number++;
+        $("#time_" + number + "_alt").parent().parent().parent().show();
+    });
+    
+    $("#remove_button").on("click", function() {
+        if (number > 1) {            
+            $("#time_" + number + "_alt").parent().parent().parent().hide();
+            number--;
+        }
+    });
+});
+</script>');
+
+$form->addLabel(
+    '',
+    Display::url(get_lang('Add'), 'javascript:void(0)', ['id' => 'add_button', 'class' => 'btn btn-default'])
+    .' '.
+    Display::url(
+        get_lang('Remove'),
+        'javascript:void(0)',
+        ['id' => 'remove_button', 'class' => 'btn btn-danger']
+    )
+);
+
+$form->addButtonCreate(get_lang('CreateSurvey'), 'submit_survey');
+
+$defaults = [];
+$form->setDefaults($defaults);
+
+// The validation or display
+if ($form->validate()) {
+    // Exporting the values
+    $values = $form->getSubmitValues();
+    $values['survey_code'] = SurveyManager::generateSurveyCode($values['survey_title']);
+    // Storing the survey
+    $surveyData = SurveyManager::store_survey($values);
+
+    $dates = [];
+    for ($i = 1; $i <= $maxEvents; $i++) {
+        $name = 'time_'.$i;
+        if (isset($values[$name]) && !empty($values[$name])) {
+            $date = $values[$name];
+
+            if (empty($date)) {
+                continue;
+            }
+
+            $start = $name.'_time_range_start';
+            $end = $name.'_time_range_end';
+
+            $start = $values[$start];
+            $end = $values[$end];
+
+            $start = api_get_utc_datetime($values[$name].' '.$start, true);
+            $end = api_get_utc_datetime($values[$name].' '.$end, true);
+
+            if (!empty($start) && !empty($start)) {
+                $row = [
+                    'start' => $start,
+                    'end' => $end,
+                ];
+                $dates[] = $row;
+            }
+        }
+    }
+
+    $questionTable = Database::get_course_table(TABLE_SURVEY_QUESTION);
+    $counter = 1;
+    if (!empty($surveyData['id'])) {
+        foreach ($dates as $date) {
+            //SurveyManager::save_question();
+            $params = [
+                'c_id' => api_get_course_int_id(),
+                'survey_id' => $surveyData['id'],
+                'survey_question' => $date['start'].'@@'.$date['end'],
+                'survey_question_comment' => '',
+                'type' => 'doodle',
+                'display' => 'horizontal',
+                'sort' => $counter,
+                'shared_question_id' => '0',
+                'max_value' => 0,
+            ];
+            $questionId = Database::insert($questionTable, $params);
+            if ($questionId) {
+                $sql = "UPDATE $questionTable SET question_id = $questionId
+                        WHERE iid = $questionId";
+                Database::query($sql);
+            }
+            $counter++;
+        }
+    }
+
+    // Redirecting to the survey page (whilst showing the return message)
+    header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq());
+    exit;
+} else {
+    // Displaying the header
+    Display::display_header($tool_name);
+    $form->display();
+}
+
+Display::display_footer();

+ 264 - 0
main/survey/meeting.php

@@ -0,0 +1,264 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+require_once __DIR__.'/../inc/global.inc.php';
+
+api_protect_course_script(true);
+
+$sessionId = api_get_session_id();
+$courseId = api_get_course_int_id();
+$userId = api_get_user_id();
+$courseInfo = api_get_course_info();
+
+$surveyId = isset($_REQUEST['survey_id']) ? (int) $_REQUEST['survey_id'] : 0;
+$invitationcode = isset($_REQUEST['invitationcode']) ? Database::escape_string($_REQUEST['invitationcode']) : 0;
+$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
+
+if (!api_is_allowed_to_edit() || !empty($invitationcode)) {
+    $table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
+    $table_survey = Database::get_course_table(TABLE_SURVEY);
+
+    $sql = "SELECT * FROM $table_survey_invitation
+            WHERE
+                c_id = $courseId AND
+                invitation_code = '".Database::escape_string($invitationcode)."'";
+    $result = Database::query($sql);
+    if (Database::num_rows($result) < 1) {
+        api_not_allowed(true, get_lang('WrongInvitationCode'));
+    }
+
+    $survey_invitation = Database::fetch_array($result, 'ASSOC');
+    $sql = "SELECT * FROM $table_survey
+            WHERE
+                c_id = $courseId AND
+                code = '".Database::escape_string($survey_invitation['survey_code'])."'";
+    $sql .= api_get_session_condition($sessionId);
+    $result = Database::query($sql);
+    $result = Database::fetch_array($result, 'ASSOC');
+    $surveyId = $result['iid'];
+}
+
+// getting all the students of the course
+/*if (empty($sessionId)) {
+    // Registered students in a course outside session.
+    $students = CourseManager:: get_student_list_from_course_code(
+        api_get_course_id(),
+        false,
+        0,
+        null,
+        null,
+        true
+    );
+} else {
+    // Registered students in session.
+    $students = CourseManager:: get_student_list_from_course_code(
+        api_get_course_id(),
+        true,
+        $sessionId
+    );
+}*/
+
+$surveyData = SurveyManager::get_survey($surveyId);
+
+if (empty($surveyData)) {
+    api_not_allowed(true);
+}
+
+$invitations = SurveyUtil::get_invited_users($surveyData['code']);
+$students = isset($invitations['course_users']) ? $invitations['course_users'] : [];
+
+$content = Display::page_header($surveyData['title']);
+
+$interbreadcrumb[] = [
+    'url' => api_get_path(WEB_CODE_PATH).
+        'survey/survey_list.php?cidReq='.$courseInfo['code'].'&id_session='.$sessionId,
+    'name' => get_lang('SurveyList'),
+];
+
+$questions = SurveyManager::get_questions($surveyData['iid']);
+
+$url = api_get_self().'?survey_id='.$surveyId.'&invitationcode='.$invitationcode.'&'.api_get_cidreq();
+$urlEdit = $url.'&action=edit';
+
+if (isset($_POST) && !empty($_POST)) {
+    $options = isset($_POST['options']) ? array_keys($_POST['options']) : [];
+
+    foreach ($questions as $item) {
+        $questionId = $item['question_id'];
+        SurveyUtil::remove_answer(
+            $userId,
+            $surveyId,
+            $questionId,
+            $courseId
+        );
+    }
+
+    $status = 1;
+    foreach ($options as $selectedQuestionId) {
+        SurveyUtil::store_answer(
+            $userId,
+            $surveyId,
+            $selectedQuestionId,
+            1,
+            $status,
+            $surveyData
+        );
+    }
+    Display::addFlash(Display::return_message(get_lang('Saved')));
+    header('Location: '.$url);
+    exit;
+}
+
+$template = new Template();
+
+$table = new HTML_Table(['class' => 'table']);
+
+$row = 0;
+$column = 1;
+$answerList = [];
+foreach ($questions as $item) {
+    $answers = SurveyUtil::get_answers_of_question_by_user($surveyId, $item['question_id']);
+    foreach ($answers as $tempUserId => &$value) {
+        $value = $value[0];
+        $value = explode('*', $value);
+        $value = isset($value[1]) ? $value[1] : 0;
+    }
+    $answerList[$item['question_id']] = $answers;
+    $parts = explode('@@', $item['question']);
+    $startDateTime = api_get_local_time($parts[0]);
+    $endDateTime = api_get_local_time($parts[1]);
+
+    $date = explode(' ', $startDateTime);
+    $endDate = explode(' ', $endDateTime);
+    $mainDate = $date[0];
+    $startTime = $date[1];
+    $endTime = $endDate[1];
+
+    $mainDate = api_format_date($mainDate, DATE_FORMAT_SHORT);
+    $table->setHeaderContents($row, $column, "<h4>$mainDate</h4> $startTime <br >$endTime");
+    $column++;
+}
+
+$row = 1;
+$column = 0;
+// Total counter
+$table->setHeaderContents(
+    $row,
+    0,
+    get_lang('NumberOfUsers').': '.count($students)
+);
+foreach ($questions as $item) {
+    $count = 0;
+    if (isset($answerList[$item['question_id']])) {
+        $count = '<p style="color:cornflowerblue" >
+            <span class="fa fa-check fa-2x"></span>'.count($answerList[$item['question_id']]).'</p>';
+    }
+    $table->setHeaderContents(
+        $row,
+        ++$column,
+        $count
+    );
+}
+
+$row = 2;
+$column = 0;
+foreach ($students as $studentId) {
+    $userInfo = api_get_user_info($studentId);
+    $name = $userInfo['complete_name'];
+    if ($userId == $studentId) {
+        if ($action !== 'edit') {
+            $name .= Display::url(
+                Display::return_icon('edit.png', get_lang('Edit')),
+                $urlEdit
+            );
+        }
+        $rowColumn = 1;
+        foreach ($questions as $item) {
+            $checked = '';
+            $html = '';
+            if (isset($answerList[$item['question_id']][$studentId])) {
+                $checked = Display::return_icon('check-circle.png');
+                if ($action === 'edit') {
+                    $checked = 'checked';
+                }
+            }
+
+            if ($action === 'edit') {
+                $html = '<div class="alert alert-info"><input 
+                    id="'.$item['question_id'].'" 
+                    name="options['.$item['question_id'].']" 
+                    class="question" '.$checked.' 
+                    type="checkbox" 
+                /></div>';
+            } else {
+                $html = $checked;
+            }
+
+            $table->setHeaderContents(
+                $row,
+                $rowColumn,
+                $html
+            );
+            $rowColumn++;
+        }
+    } else {
+        $rowColumn = 1;
+        foreach ($questions as $item) {
+            $checked = '';
+            if (isset($answerList[$item['question_id']][$studentId])) {
+                $checked = Display::return_icon('check-circle.png');
+            }
+            $table->setHeaderContents(
+                $row,
+                $rowColumn,
+                $checked
+            );
+            $rowColumn++;
+        }
+    }
+    $column = 0;
+    $table->setCellContents($row, $column, $name);
+    $class = 'class="row_odd"';
+    if ($row % 2) {
+        $class = 'class="row_even"';
+    }
+    $row++;
+}
+if ($action === 'edit') {
+    $content .= '<form name="meeting" action="'.$urlEdit.'" method="post">';
+}
+
+$content .= $table->toHtml();
+
+if ($action === 'edit') {
+    $content .= '<div class="pull-right">
+        <button name="submit" type="submit" class="btn btn-primary btn-lg">'.get_lang('Save').'</button></div>';
+    $content .= '</form>';
+}
+
+/*$ajaxUrl = api_get_path(WEB_AJAX_PATH).
+    'survey.ajax.php?a=save_question&'.api_get_cidreq().'&survey_id='.$surveyId.'&question_id=';
+
+$content .= '<script>
+$(function() {
+    $(".question").on("change", function() {
+        var questionId = $(this).attr("id");
+        var status = 0;
+        if ($(this).prop("checked")) {
+            status = 1;
+        }
+        $.ajax({
+            url: "'.$ajaxUrl.'" + questionId + "&status=" + status,
+            success: function (data) {
+                $("#ajax_result").html("<div class=\"alert alert-info\">"+ "'.get_lang('Saved').'" + "</div>");
+                $("#ajax_result").show();
+                return;
+            },
+        });
+    });
+
+});
+</script>';*/
+
+$template->assign('content', $content);
+$template->display_one_col_template();

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно