From f7539ed1e58d23c8c20781cc3e87a37a8176e0cd Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 00:20:15 +0200 Subject: [PATCH 01/92] Updated npm packages and build (added uglify Grunt task) --- .prettierignore | 1 + Gruntfile.js | 2 +- build/js/tempusdominus-core.js | 2 +- build/js/tempusdominus-core.min.js | 1 + package-lock.json | 2598 +++++++++++++++++----------- package.json | 12 +- 6 files changed, 1553 insertions(+), 1063 deletions(-) create mode 100644 .prettierignore create mode 100644 build/js/tempusdominus-core.min.js diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..fa29cdf --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +** \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 1fcc550..c65281e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -110,7 +110,7 @@ module.exports = function (grunt) { ]); // Task to be run when building - grunt.registerTask('build', ['babel:dev', 'eslint', 'babel:dist']); + grunt.registerTask('build', ['babel:dev', 'eslint', 'babel:dist', 'uglify']); grunt.registerTask('test', ['build', 'env:paris', 'connect', 'jasmine']); diff --git a/build/js/tempusdominus-core.js b/build/js/tempusdominus-core.js index 6337cf9..dc2927b 100644 --- a/build/js/tempusdominus-core.js +++ b/build/js/tempusdominus-core.js @@ -526,7 +526,7 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) { - if (e.type === DateTimePicker.Event.CHANGE && (e.date && e.date.isSame(e.oldDate)) || !e.date && !e.oldDate) { + if (e.type === DateTimePicker.Event.CHANGE && e.date && e.date.isSame(e.oldDate) || !e.date && !e.oldDate) { return; } this._element.trigger(e); diff --git a/build/js/tempusdominus-core.min.js b/build/js/tempusdominus-core.min.js new file mode 100644 index 0000000..387e1b1 --- /dev/null +++ b/build/js/tempusdominus-core.min.js @@ -0,0 +1 @@ +var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+h[this.currentViewMode].CLASS_NAME).show())},_.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},_.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},_.prototype._isValid=function(t,e){if(!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},_.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},_.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in u[p]="p",u)u.hasOwnProperty(i)&&"p"===u[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&d[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(d[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},_.prototype._keyup=function(t){u[t.which]="r",f[t.which]&&(f[t.which]=!1,t.stopPropagation(),t.preventDefault())},_.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},_.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},_.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},_.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},_.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},_.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},_.prototype.toggle=function(){return this.widget?this.hide():this.show()},_.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},_.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},_.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},_.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},_.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},_.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},_.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},_.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},_.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},_.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e=2.2.7 <3" + } + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -44,33 +129,33 @@ } }, "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "dev": true, "requires": { "es6-promisify": "^5.0.0" } }, "agentkeepalive": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.1.tgz", - "integrity": "sha512-Cte/sTY9/XcygXjJ0q58v//SnEQ7ViWExKyJpLJlLqomDbQyMLh6Is4KuWJ/wmxzhiwkGRple7Gqv1zf6Syz5w==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", + "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", "dev": true, "requires": { "humanize-ms": "^1.2.1" } }, "ajv": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.3.0.tgz", - "integrity": "sha1-RBT/dKUIecII7l/cgm4ywwNUnto=", + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "ajv-keywords": { @@ -113,9 +198,9 @@ } }, "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", "dev": true }, "array-find-index": { @@ -166,6 +251,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, "async": { @@ -175,9 +267,9 @@ "dev": true }, "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", "dev": true }, "asynckit": { @@ -195,9 +287,9 @@ "optional": true }, "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", + "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", "dev": true, "optional": true }, @@ -296,9 +388,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -358,9 +450,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -439,9 +531,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -763,9 +855,9 @@ } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -794,9 +886,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -819,9 +911,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -839,9 +931,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -859,12 +951,20 @@ "dev": true }, "basic-auth": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz", - "integrity": "sha1-AV2z81PgLlY3d1X5YnQuiYHnu7o=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "batch": { @@ -884,9 +984,9 @@ } }, "bluebird": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", - "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, "body": { @@ -911,16 +1011,16 @@ "concat-map": "0.0.1" } }, - "buffer-from": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", - "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "dev": true }, - "builtin-modules": { + "buffer-from": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, "builtins": { @@ -936,31 +1036,32 @@ "dev": true }, "cacache": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.2.0.tgz", - "integrity": "sha512-IFWl6lfK6wSeYCHUXh+N1lY72UDrpyrYQJNIVQf48paDuWbv5RbAtJYf/4gUQFObTCHZwdZ5sI8Iw7nqwP6nlQ==", - "dev": true, - "requires": { - "bluebird": "^3.5.1", - "chownr": "^1.0.1", - "figgy-pudding": "^3.1.0", - "glob": "^7.1.2", - "graceful-fs": "^4.1.11", - "lru-cache": "^4.1.3", + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", "mississippi": "^3.0.0", "mkdirp": "^0.5.1", "move-concurrently": "^1.0.1", "promise-inflight": "^1.0.1", - "rimraf": "^2.6.2", - "ssri": "^6.0.0", - "unique-filename": "^1.1.0", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", "y18n": "^4.0.0" }, "dependencies": { "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -971,13 +1072,19 @@ "path-is-absolute": "^1.0.0" } }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } } } @@ -1034,15 +1141,15 @@ } }, "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "chownr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, "circular-json": { @@ -1062,9 +1169,9 @@ }, "dependencies": { "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1138,9 +1245,9 @@ "dev": true }, "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "optional": true, "requires": { @@ -1148,9 +1255,9 @@ } }, "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "concat-map": { @@ -1223,13 +1330,27 @@ "run-queue": "^1.0.0" }, "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } } } @@ -1247,12 +1368,14 @@ "dev": true }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "lru-cache": "^4.0.1", + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } @@ -1266,17 +1389,10 @@ "array-find-index": "^1.0.1" } }, - "cycle": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", - "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", - "dev": true, - "optional": true - }, "cyclist": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", - "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", "dev": true }, "d": { @@ -1354,7 +1470,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true + "dev": true, + "optional": true }, "depd": { "version": "1.1.1", @@ -1388,33 +1505,33 @@ } }, "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", "dev": true, "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" + "domelementtype": "^2.0.1", + "entities": "^2.0.0" }, "dependencies": { "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", "dev": true }, "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", "dev": true } } }, "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", "dev": true }, "domhandler": { @@ -1438,14 +1555,14 @@ }, "duplexer": { "version": "0.1.1", - "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", "dev": true }, "duplexify": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", - "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "dev": true, "requires": { "end-of-stream": "^1.0.0", @@ -1471,6 +1588,12 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "encodeurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", @@ -1487,9 +1610,9 @@ } }, "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "requires": { "once": "^1.4.0" @@ -1528,9 +1651,9 @@ } }, "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -1572,9 +1695,9 @@ } }, "es6-promise": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", - "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", "dev": true }, "es6-promisify": { @@ -1689,9 +1812,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "shelljs": { @@ -1720,19 +1843,28 @@ } }, "eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", "dev": true, "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, "espree": { @@ -1746,9 +1878,9 @@ } }, "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "esquery": { @@ -1824,26 +1956,26 @@ "optional": true }, "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, "extract-zip": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", - "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", + "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==", "dev": true, "requires": { - "concat-stream": "1.6.2", - "debug": "2.6.9", - "mkdirp": "0.5.1", - "yauzl": "2.4.1" + "concat-stream": "^1.6.2", + "debug": "^2.6.9", + "mkdirp": "^0.5.4", + "yauzl": "^2.10.0" }, "dependencies": { "concat-stream": { @@ -1857,6 +1989,15 @@ "readable-stream": "^2.2.2", "typedarray": "^0.0.6" } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } } } }, @@ -1864,19 +2005,13 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "eyes": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", "dev": true, "optional": true }, "fast-deep-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", - "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "dev": true }, "fast-json-stable-stringify": { @@ -1901,18 +2036,18 @@ } }, "fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", - "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "dev": true, "requires": { "pend": "~1.2.0" } }, "figgy-pudding": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", - "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, "figures": { @@ -1996,14 +2131,52 @@ "write": "^0.2.1" } }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "flush-write-stream": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", - "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", "dev": true, "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.4" + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + }, + "dependencies": { + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "forever-agent": { @@ -2014,27 +2187,15 @@ "optional": true }, "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "optional": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" - }, - "dependencies": { - "combined-stream": { - "version": "1.0.6", - "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "dev": true, - "optional": true, - "requires": { - "delayed-stream": "~1.0.0" - } - } } }, "fresh": { @@ -2053,25 +2214,13 @@ "readable-stream": "^2.0.0" } }, - "fs-extra": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", - "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0" - } - }, "fs-minipass": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", "dev": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.6.0" } }, "fs-write-stream-atomic": { @@ -2108,10 +2257,13 @@ } }, "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", - "dev": true + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dev": true, + "requires": { + "is-property": "^1.0.2" + } }, "generate-object-property": { "version": "1.2.0", @@ -2123,9 +2275,9 @@ } }, "genfun": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/genfun/-/genfun-4.0.1.tgz", - "integrity": "sha1-7RAEHy5KfxsKOEZtF6XD4n3x38E=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", + "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==", "dev": true }, "get-stdin": { @@ -2135,10 +2287,13 @@ "dev": true }, "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } }, "getobject": { "version": "0.1.0", @@ -2170,6 +2325,15 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", @@ -2224,9 +2388,9 @@ "dev": true }, "grunt": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.3.tgz", - "integrity": "sha512-/JzmZNPfKorlCrrmxWqQO4JVodO+DVd5XX4DkocL/1WlLlKVLE9+SdEIempOAxDhWPysLle6afvn/hg7Ck2k9g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.1.0.tgz", + "integrity": "sha512-+NGod0grmviZ7Nzdi9am7vuRS/h76PcWDsV635mEXF0PEQMUV6Kb+OjTdsVxbi0PZmfQOjCMKb3w8CVZcqsn1g==", "dev": true, "requires": { "coffeescript": "~1.10.0", @@ -2240,14 +2404,20 @@ "grunt-legacy-log": "~2.0.0", "grunt-legacy-util": "~1.1.1", "iconv-lite": "~0.4.13", - "js-yaml": "~3.5.2", + "js-yaml": "~3.13.1", "minimatch": "~3.0.2", - "mkdirp": "~0.5.1", + "mkdirp": "~1.0.3", "nopt": "~3.0.6", "path-is-absolute": "~1.0.0", "rimraf": "~2.6.2" }, "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, "grunt-cli": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", @@ -2260,13 +2430,45 @@ "resolve": "~1.1.0" } }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } } } @@ -2308,42 +2510,53 @@ } }, "grunt-contrib-jasmine": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/grunt-contrib-jasmine/-/grunt-contrib-jasmine-2.0.2.tgz", - "integrity": "sha512-zRUbPAbnzEuLjRsJGHSmEoQnSa9CfVYSxoRglu9+nP23B05cEJU2WQCQg6lCTvNQ63MY4d3iW6SnuD7cBd1s8A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-jasmine/-/grunt-contrib-jasmine-2.1.0.tgz", + "integrity": "sha512-nkOIG3Rvv9iedz/CC5hRKHUMJ1aSGOac87h5Xm4fuBUh9RQpbhiQ7xw1lWyhxrLUN3M0ksBKNWBB6KM+rgmI2A==", "dev": true, "requires": { - "chalk": "^1.0.0", - "grunt-eslint": "20.1.0", - "lodash": "~2.4.1", - "pacote": "8.1.3", - "puppeteer": "1.4.0", - "rimraf": "^2.1.4", - "sprintf-js": "~1.0.3" + "chalk": "^2.4.2", + "grunt-eslint": "^22.0.0", + "lodash": "^4.17.15", + "pacote": "^9.5.4", + "puppeteer": "^1.19.0", + "rimraf": "^2.6.3", + "sprintf-js": "^1.1.2" }, "dependencies": { "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, - "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", - "dev": true + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } }, "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "ansi-styles": { @@ -2355,106 +2568,104 @@ "color-convert": "^1.9.0" } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { - "restore-cursor": "^2.0.0" + "restore-cursor": "^3.1.0" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "debug": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz", - "integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" } }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" } }, "eslint": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", "dev": true, "requires": { - "ajv": "^5.3.0", - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", "chalk": "^2.1.0", - "concat-stream": "^1.6.0", - "cross-spawn": "^5.1.0", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^3.7.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.4", - "esquery": "^1.0.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.0.1", - "ignore": "^3.3.3", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^3.0.6", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.9.1", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.2", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", + "optionator": "^0.8.3", "progress": "^2.0.0", - "regexpp": "^1.0.1", - "require-uncached": "^1.0.3", - "semver": "^5.3.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "~2.0.1", - "table": "4.0.2", - "text-table": "~0.2.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" } }, "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" } }, "esprima": { @@ -2463,19 +2674,65 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + }, "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" } }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -2487,85 +2744,116 @@ } }, "globals": { - "version": "11.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", - "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==", - "dev": true + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } }, "grunt-eslint": { - "version": "20.1.0", - "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-20.1.0.tgz", - "integrity": "sha512-VZlDOLrB2KKefDDcx/wR8rEEz7smDwDKVblmooa+itdt/2jWw3ee2AiZB5Ap4s4AoRY0pbHRjZ3HHwY8uKR9Rw==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-22.0.0.tgz", + "integrity": "sha512-I7vIU4x/mb20fmA6TAmLx6Wzn7mfs8ZXeuk7LbP2ujKVFV7KZmJ3qXUyqe2wnD+v/74Rs5uYOZrLL8EoBmlG9Q==", "dev": true, "requires": { "chalk": "^2.1.0", - "eslint": "^4.0.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - } + "eslint": "^6.0.1" } }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", "dev": true, "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.0.4", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" }, "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } } } }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -2573,101 +2861,151 @@ } }, "lodash": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", "dev": true, "requires": { - "mimic-fn": "^1.0.0" + "mimic-fn": "^2.1.0" } }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } }, "progress": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", - "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "requires": { - "onetime": "^2.0.0", + "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "is-promise": "^2.1.0" + "glob": "^7.1.3" } }, - "rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } } }, + "sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "dev": true + }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } } }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", "dev": true }, "supports-color": { @@ -2680,49 +3018,62 @@ } }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "ajv": "^5.2.3", - "ajv-keywords": "^2.1.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" }, "dependencies": { - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true } } + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } } } }, "grunt-contrib-jshint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-2.0.0.tgz", - "integrity": "sha512-4qR411I1bhvVrPkKBzCUcrWkTEtBuWioXi9ABWRXHoplRScg03jiMqLDpzS4pDhVsLOTx5F9l+0cnMc+Gd2MWg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-2.1.0.tgz", + "integrity": "sha512-65S2/C/6RfjY/umTxfwXXn+wVvaYmykHkHSsW6Q6rhkbv3oudTEgqnFFZvWzWCoHUb+3GMZLbP3oSrNyvshmIQ==", "dev": true, "requires": { - "chalk": "^2.4.1", + "chalk": "^2.4.2", "hooker": "^0.2.3", - "jshint": "~2.9.6" + "jshint": "~2.10.2" }, "dependencies": { "ansi-styles": { @@ -2735,9 +3086,9 @@ } }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -2769,25 +3120,33 @@ }, "dependencies": { "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", "dev": true, "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.14" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } } } } }, "grunt-contrib-uglify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-4.0.0.tgz", - "integrity": "sha512-vy3Vop2KDqdiwcGOGAjyKvjHFrRD/YK4KPQWR3Yt6OdYlgFw1z7HCuk66+IJ9s7oJmp9uRQXuuSHyawKRAgiMw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-4.0.1.tgz", + "integrity": "sha512-dwf8/+4uW1+7pH72WButOEnzErPGmtUvc8p08B0eQS/6ON0WdeQu0+WFeafaPTbbY1GqtS25lsHWaDeiTQNWPg==", "dev": true, "requires": { "chalk": "^2.4.1", "maxmin": "^2.1.0", - "uglify-js": "~3.4.8", + "uglify-js": "^3.5.0", "uri-path": "^1.0.0" }, "dependencies": { @@ -2801,9 +3160,9 @@ } }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -2846,21 +3205,13 @@ } }, "grunt-env": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/grunt-env/-/grunt-env-0.4.4.tgz", - "integrity": "sha1-OziEOo1zcXfdyfiTh5+2nOGgvC8=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/grunt-env/-/grunt-env-1.0.1.tgz", + "integrity": "sha512-Hw4iIJ58yYA8kJaP4UUyfw807DUI1FRnow9hhRMnq366bwCnxiBWOgfZsYilcs3Jh1qsGC/i3+G+7/W18hA1TA==", "dev": true, "requires": { - "ini": "~1.3.0", - "lodash": "~2.4.1" - }, - "dependencies": { - "lodash": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", - "dev": true - } + "ini": "^1.3.5", + "lodash": "^4.17.14" } }, "grunt-eslint": { @@ -2874,9 +3225,9 @@ } }, "grunt-known-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.0.tgz", - "integrity": "sha1-pCdO6zL6dl2lp6OxcSYXzjsUQUk=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz", + "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==", "dev": true }, "grunt-legacy-log": { @@ -2911,9 +3262,9 @@ } }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -2922,9 +3273,9 @@ } }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -2945,23 +3296,12 @@ "lodash": "~4.17.10", "underscore.string": "~3.3.4", "which": "~1.3.0" - }, - "dependencies": { - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } } }, "grunt-nuget": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/grunt-nuget/-/grunt-nuget-0.3.0.tgz", - "integrity": "sha1-A6KqGo8Db1HtOGg9OnvjkNctPd8=", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/grunt-nuget/-/grunt-nuget-0.3.1.tgz", + "integrity": "sha512-jYPwNAkDRw7UNL2uytExr31fPZwcOIqz/5xdv+ZtOJLBHTt1v9f9qDCTniRHaNEDF6FwZPWWRG9gKLAVY13KNg==", "dev": true }, "grunt-string-replace": { @@ -2975,13 +3315,19 @@ }, "dependencies": { "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", "dev": true, "requires": { - "lodash": "^4.14.0" + "lodash": "^4.17.14" } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true } } }, @@ -3002,14 +3348,43 @@ "optional": true }, "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "dev": true, "optional": true, "requires": { - "ajv": "^5.3.0", + "ajv": "^6.5.5", "har-schema": "^2.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "optional": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true, + "optional": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "optional": true + } } }, "has-ansi": { @@ -3027,17 +3402,6 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "hasha": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", - "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", - "dev": true, - "optional": true, - "requires": { - "is-stream": "^1.0.1", - "pinkie-promise": "^2.0.0" - } - }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -3055,9 +3419,9 @@ "dev": true }, "hosted-git-info": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, "htmlparser2": { @@ -3081,7 +3445,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -3163,28 +3527,28 @@ "dev": true }, "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", "dev": true, "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" }, "dependencies": { "debug": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz", - "integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { "ms": "^2.1.1" } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } @@ -3199,9 +3563,9 @@ } }, "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" @@ -3220,9 +3584,9 @@ "dev": true }, "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", + "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", "dev": true, "requires": { "minimatch": "^3.0.4" @@ -3235,6 +3599,24 @@ "dev": true, "optional": true }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -3250,6 +3632,12 @@ "repeating": "^2.0.0" } }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -3267,9 +3655,9 @@ "dev": true }, "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, "inquirer": { @@ -3320,14 +3708,11 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true }, "is-finite": { "version": "1.0.2", @@ -3347,14 +3732,30 @@ "number-is-nan": "^1.0.0" } }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true + }, "is-my-json-valid": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", - "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.0.tgz", + "integrity": "sha512-XTHBZSIIxNsIsZXg7XB5l8z/OBFosl1Wao4tXLpeC7eKU4Vm/kdop2azkPqULwnfGQjmeDIyey9g7afMMtdWAA==", "dev": true, "requires": { "generate-function": "^2.0.0", "generate-object-property": "^1.1.0", + "is-my-ip-valid": "^1.0.0", "jsonpointer": "^4.0.0", "xtend": "^4.0.0" } @@ -3383,12 +3784,6 @@ "path-is-inside": "^1.0.1" } }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -3404,13 +3799,6 @@ "tryit": "^1.0.1" } }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true, - "optional": true - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -3440,12 +3828,13 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true + "dev": true, + "optional": true }, "jquery": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz", - "integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=" + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.0.tgz", + "integrity": "sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ==" }, "js-tokens": { "version": "3.0.2", @@ -3454,13 +3843,13 @@ "dev": true }, "js-yaml": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz", - "integrity": "sha1-A3fDgBfKvHMisNH7zSWkkWQfL74=", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { - "argparse": "^1.0.2", - "esprima": "^2.6.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "jsbn": { @@ -3477,22 +3866,27 @@ "dev": true }, "jshint": { - "version": "2.9.6", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.6.tgz", - "integrity": "sha512-KO9SIAKTlJQOM4lE64GQUtGBRpTOuvbrRrSZw3AhUxMNG266nX9hK2cKA4SBhXOj0irJGyNyGSLT62HGOVDEOA==", + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.3.tgz", + "integrity": "sha512-d8AoXcNNYzmm7cdmulQ3dQApbrPYArtVBO6n4xOICe4QsXGNHCAKDcFORzqP52LhK61KX0VhY39yYzCsNq+bxQ==", "dev": true, "requires": { "cli": "~1.0.0", "console-browserify": "1.1.x", "exit": "0.1.x", "htmlparser2": "3.8.x", - "lodash": "~4.17.10", + "lodash": "~4.17.11", "minimatch": "~3.0.2", - "phantom": "~4.0.1", - "phantomjs-prebuilt": "~2.1.7", "shelljs": "0.3.x", - "strip-json-comments": "1.0.x", - "unicode-5.2.0": "^0.7.5" + "strip-json-comments": "1.0.x" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } } }, "json-parse-better-errors": { @@ -3509,9 +3903,9 @@ "optional": true }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify": { @@ -3542,22 +3936,18 @@ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, - "jsonfile": { - "version": "2.4.0", - "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, "jsonify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", "dev": true }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, "jsonpointer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", @@ -3577,27 +3967,10 @@ "verror": "1.10.0" } }, - "kew": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", - "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", - "dev": true, - "optional": true - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, "less": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/less/-/less-3.8.1.tgz", - "integrity": "sha512-8HFGuWmL3FhQR0aH89escFNBQH/nEiYPP2ltDFdQw2chE28Yx2E3lhAIq9Y2saYwLSwa699s4dBVEfCY8Drf7Q==", + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/less/-/less-3.11.1.tgz", + "integrity": "sha512-tlWX341RECuTOvoDIvtFqXsKj072hm3+9ymRBe76/mD6O5ZZecnlAOVDlWAleF2+aohFrxNidXhv2773f6kY7g==", "dev": true, "requires": { "clone": "^2.1.2", @@ -3608,7 +3981,8 @@ "mkdirp": "^0.5.0", "promise": "^7.1.1", "request": "^2.83.0", - "source-map": "~0.6.0" + "source-map": "~0.6.0", + "tslib": "^1.10.0" }, "dependencies": { "source-map": { @@ -3637,15 +4011,23 @@ "dev": true }, "load-grunt-tasks": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-3.5.2.tgz", - "integrity": "sha1-ByhWEYD9IP+KaSdQWFL8WKrqDIg=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-5.1.0.tgz", + "integrity": "sha512-oNj0Jlka1TsfDe+9He0kcA1cRln+TMoTsEByW7ij6kyktNLxBKJtslCFEvFrLC2Dj0S19IWJh3fOCIjLby2Xrg==", "dev": true, "requires": { - "arrify": "^1.0.0", - "multimatch": "^2.0.0", - "pkg-up": "^1.0.0", - "resolve-pkg": "^0.1.0" + "arrify": "^2.0.1", + "multimatch": "^4.0.0", + "pkg-up": "^3.1.0", + "resolve-pkg": "^2.0.0" + }, + "dependencies": { + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + } } }, "load-json-file": { @@ -3661,10 +4043,28 @@ "strip-bom": "^2.0.0" } }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "loose-envify": { @@ -3687,27 +4087,26 @@ } }, "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "yallist": "^3.0.2" } }, "make-fetch-happen": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz", - "integrity": "sha512-7R5ivfy9ilRJ1EMKIOziwrns9fGeAD4bAha8EB7BIiBBLHm2KeTUGCrICFt2rbHfzheTLynv50GnNTK1zDTrcQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz", + "integrity": "sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==", "dev": true, "requires": { "agentkeepalive": "^3.4.1", - "cacache": "^11.0.1", + "cacache": "^12.0.0", "http-cache-semantics": "^3.8.1", "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.1", - "lru-cache": "^4.1.2", + "https-proxy-agent": "^2.2.3", + "lru-cache": "^5.1.1", "mississippi": "^3.0.0", "node-fetch-npm": "^2.0.2", "promise-retry": "^1.1.1", @@ -3773,9 +4172,9 @@ } }, "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimatch": { @@ -3788,15 +4187,15 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "minipass": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.4.tgz", - "integrity": "sha512-mlouk1OHlaUE8Odt1drMtG1bAJA4ZA6B/ehysgV0LUIrDHdKgo1KorZq3pK0b/7Z7LJIQ12MNM6aC+Tn6lUZ5w==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "dev": true, "requires": { "safe-buffer": "^5.1.2", @@ -3804,26 +4203,20 @@ }, "dependencies": { "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "yallist": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", - "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true } } }, "minizlib": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz", - "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", "dev": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.9.0" } }, "mississippi": { @@ -3845,26 +4238,18 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } + "minimist": "^1.2.5" } }, "moment": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", - "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" }, "moment-timezone": { "version": "0.4.1", @@ -3875,16 +4260,24 @@ } }, "morgan": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz", - "integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", "dev": true, "requires": { - "basic-auth": "~2.0.0", + "basic-auth": "~2.0.1", "debug": "2.6.9", - "depd": "~1.1.1", + "depd": "~2.0.0", "on-finished": "~2.3.0", - "on-headers": "~1.0.1" + "on-headers": "~1.0.2" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + } } }, "move-concurrently": { @@ -3901,13 +4294,27 @@ "run-queue": "^1.0.3" }, "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } } } @@ -3919,15 +4326,30 @@ "dev": true }, "multimatch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", - "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", "dev": true, "requires": { - "array-differ": "^1.0.0", - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "minimatch": "^3.0.0" + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + }, + "dependencies": { + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + } } }, "mute-stream": { @@ -3948,10 +4370,16 @@ "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", "dev": true }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "node-fetch-npm": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz", - "integrity": "sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz", + "integrity": "sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg==", "dev": true, "requires": { "encoding": "^0.1.11", @@ -3969,63 +4397,100 @@ } }, "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } } }, "npm-bundled": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "dev": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", "dev": true }, "npm-package-arg": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.0.tgz", - "integrity": "sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", "dev": true, "requires": { - "hosted-git-info": "^2.6.0", + "hosted-git-info": "^2.7.1", "osenv": "^0.1.5", - "semver": "^5.5.0", + "semver": "^5.6.0", "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", - "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", - "dev": true - } } }, "npm-packlist": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.11.tgz", - "integrity": "sha512-CxKlZ24urLkJk+9kCm48RTQ7L4hsmgSVzEk0TLGPzzyuFxD7VNgy5Sl24tOLMzQv773a/NeJ1ce1DKeacqffEA==", + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", + "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", "dev": true, "requires": { "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" } }, "npm-pick-manifest": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-2.1.0.tgz", - "integrity": "sha512-q9zLP8cTr8xKPmMZN3naxp1k/NxVFsjxN6uWuO1tiw9gxg7wZWQ/b5UTfzD0ANw2q1lQxdLKTeCCksq+bPSgbQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz", + "integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==", "dev": true, "requires": { + "figgy-pudding": "^3.5.1", "npm-package-arg": "^6.0.0", "semver": "^5.4.1" } }, + "npm-registry-fetch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.4.tgz", + "integrity": "sha512-6jb34hX/iYNQebqWUHtU8YF6Cjb1H6ouTFPClYsyiW6lpFkljTpdeftm53rRojtja1rKAvKNIIiTS5Sjpw4wsA==", + "dev": true, + "requires": { + "JSONStream": "^1.3.4", + "bluebird": "^3.5.1", + "figgy-pudding": "^3.4.1", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", + "npm-package-arg": "^6.1.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "dev": true + } + } + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -4055,9 +4520,9 @@ } }, "on-headers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", - "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true }, "once": { @@ -4121,43 +4586,72 @@ "os-tmpdir": "^1.0.0" } }, - "pacote": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-8.1.3.tgz", - "integrity": "sha512-1mQvUgCBA9Bq1MtWCxuDzhDNZn0bhiOEUpiHHj/KepINGhb16NS8osaEsKEDTaNBwPZWm0aJJsZe04+6TEOkZQ==", + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { - "bluebird": "^3.5.1", - "cacache": "^11.0.2", - "get-stream": "^3.0.0", - "glob": "^7.1.2", - "lru-cache": "^4.1.3", - "make-fetch-happen": "^4.0.1", + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pacote": { + "version": "9.5.12", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.12.tgz", + "integrity": "sha512-BUIj/4kKbwWg4RtnBncXPJd15piFSVNpTzY0rysSr3VnMowTYgkGKcaHrbReepAkjTr8lH2CVWRi58Spg2CicQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.3", + "cacache": "^12.0.2", + "chownr": "^1.1.2", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.1.0", + "glob": "^7.1.3", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", "minimatch": "^3.0.4", - "minipass": "^2.3.1", + "minipass": "^2.3.5", "mississippi": "^3.0.0", "mkdirp": "^0.5.1", "normalize-package-data": "^2.4.0", + "npm-normalize-package-bin": "^1.0.0", "npm-package-arg": "^6.1.0", - "npm-packlist": "^1.1.10", - "npm-pick-manifest": "^2.1.0", + "npm-packlist": "^1.1.12", + "npm-pick-manifest": "^3.0.0", + "npm-registry-fetch": "^4.0.0", "osenv": "^0.1.5", "promise-inflight": "^1.0.1", "promise-retry": "^1.1.1", - "protoduck": "^5.0.0", + "protoduck": "^5.0.1", "rimraf": "^2.6.2", "safe-buffer": "^5.1.2", - "semver": "^5.5.0", - "ssri": "^6.0.0", - "tar": "^4.4.1", - "unique-filename": "^1.1.0", - "which": "^1.3.0" + "semver": "^5.6.0", + "ssri": "^6.0.1", + "tar": "^4.4.10", + "unique-filename": "^1.1.1", + "which": "^1.3.1" }, "dependencies": { "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -4169,39 +4663,50 @@ } }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "semver": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", - "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true } } }, "parallel-transform": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", "dev": true, "requires": { - "cyclist": "~0.2.2", + "cyclist": "^1.0.1", "inherits": "^2.0.3", "readable-stream": "^2.1.5" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -4238,6 +4743,18 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", @@ -4262,36 +4779,6 @@ "dev": true, "optional": true }, - "phantom": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/phantom/-/phantom-4.0.12.tgz", - "integrity": "sha512-Tz82XhtPmwCk1FFPmecy7yRGZG2btpzY2KI9fcoPT7zT9det0CcMyfBFPp1S8DqzsnQnm8ZYEfdy528mwVtksA==", - "dev": true, - "optional": true, - "requires": { - "phantomjs-prebuilt": "^2.1.16", - "split": "^1.0.1", - "winston": "^2.4.0" - } - }, - "phantomjs-prebuilt": { - "version": "2.1.16", - "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", - "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", - "dev": true, - "optional": true, - "requires": { - "es6-promise": "^4.0.3", - "extract-zip": "^1.6.5", - "fs-extra": "^1.0.0", - "hasha": "^2.2.0", - "kew": "^0.7.0", - "progress": "^1.1.8", - "request": "^2.81.0", - "request-progress": "^2.0.1", - "which": "^1.2.10" - } - }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -4314,12 +4801,23 @@ } }, "pkg-up": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", - "integrity": "sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", + "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", "dev": true, "requires": { - "find-up": "^1.0.0" + "find-up": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + } } }, "pluralize": { @@ -4397,18 +4895,18 @@ } }, "protoduck": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.0.tgz", - "integrity": "sha512-agsGWD8/RZrS4ga6v82Fxb0RHIS2RZnbsSue6A9/MBRhB/jcqOANAMNrqM9900b8duj+Gx+T/JMy5IowDoO/hQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", + "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", "dev": true, "requires": { - "genfun": "^4.0.1" + "genfun": "^5.0.0" } }, "proxy-from-env": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", - "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, "prr": { @@ -4418,16 +4916,10 @@ "dev": true, "optional": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true, "optional": true }, @@ -4465,62 +4957,75 @@ } }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true, - "optional": true + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "puppeteer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.4.0.tgz", - "integrity": "sha512-WDnC1FSHTedvRSS8BZB73tPAx2svUCWFdcxVjrybw8pbKOAB1v5S/pW0EamkqQoL1mXiBc+v8lyYjhhzMHIk1Q==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.20.0.tgz", + "integrity": "sha512-bt48RDBy2eIwZPrkgbcwHtb51mj2nKvHOPMaSH2IsWiv7lOG9k9zhaRzpDZafrk05ajMc3cu+lSQYYOfH2DkVQ==", "dev": true, "requires": { - "debug": "^3.1.0", - "extract-zip": "^1.6.5", - "https-proxy-agent": "^2.1.0", + "debug": "^4.1.0", + "extract-zip": "^1.6.6", + "https-proxy-agent": "^2.2.1", "mime": "^2.0.3", - "progress": "^2.0.0", + "progress": "^2.0.1", "proxy-from-env": "^1.0.0", "rimraf": "^2.6.1", - "ws": "^3.0.0" + "ws": "^6.1.0" }, "dependencies": { "debug": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz", - "integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" } }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "mime": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", - "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", "dev": true }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "progress": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", - "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } } } @@ -4645,9 +5150,9 @@ } }, "regexpp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, "regexpu-core": { @@ -4686,9 +5191,9 @@ } }, "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "dev": true, "optional": true, "requires": { @@ -4699,7 +5204,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -4709,26 +5214,26 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" }, "dependencies": { "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true, "optional": true }, "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "optional": true, "requires": { - "mime-db": "~1.36.0" + "mime-db": "1.44.0" } }, "qs": { @@ -4739,24 +5244,14 @@ "optional": true }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true, "optional": true } } }, - "request-progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", - "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", - "dev": true, - "optional": true, - "requires": { - "throttleit": "^1.0.0" - } - }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", @@ -4780,18 +5275,18 @@ "dev": true }, "resolve-pkg": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/resolve-pkg/-/resolve-pkg-0.1.0.tgz", - "integrity": "sha1-AsyZNBDik2livZcWahsHfalyVTE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg/-/resolve-pkg-2.0.0.tgz", + "integrity": "sha512-+1lzwXehGCXSeryaISr6WujZzowloigEofRB+dj75y9RRa/obVcYgbHJd53tdYw8pvZj8GojXaaENws8Ktw/hQ==", "dev": true, "requires": { - "resolve-from": "^2.0.0" + "resolve-from": "^5.0.0" }, "dependencies": { "resolve-from": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true } } @@ -4842,13 +5337,13 @@ "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", "dev": true }, - "rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", "dev": true, "requires": { - "rx-lite": "*" + "tslib": "^1.9.0" } }, "safe-buffer": { @@ -4870,9 +5365,9 @@ "dev": true }, "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "send": { @@ -4951,9 +5446,9 @@ "dev": true }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "slash": { @@ -4969,29 +5464,40 @@ "dev": true }, "smart-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.1.tgz", - "integrity": "sha512-RFqinRVJVcCAL9Uh1oVqE6FZkqsyLiVOYEZ20TqIOjuX7iFVJ+zsbs4RIghnw/pTs7mZvt8ZHhvm1ZUrR4fykg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", + "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==", "dev": true }, "socks": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.2.1.tgz", - "integrity": "sha512-0GabKw7n9mI46vcNrVfs0o6XzWzjVa3h6GaSo2UPxtWAROXUWavfJWh1M4PR5tnE0dcnQXZIDFP4yrAysLze/w==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz", + "integrity": "sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==", "dev": true, "requires": { - "ip": "^1.1.5", - "smart-buffer": "^4.0.1" + "ip": "1.1.5", + "smart-buffer": "^4.1.0" } }, "socks-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz", - "integrity": "sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", + "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", "dev": true, "requires": { - "agent-base": "~4.2.0", - "socks": "~2.2.0" + "agent-base": "~4.2.1", + "socks": "~2.3.2" + }, + "dependencies": { + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + } } }, "source-map": { @@ -5010,9 +5516,9 @@ } }, "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -5020,9 +5526,9 @@ } }, "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "spdx-expression-parse": { @@ -5036,21 +5542,11 @@ } }, "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dev": true, - "optional": true, - "requires": { - "through": "2" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -5058,9 +5554,9 @@ "dev": true }, "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "optional": true, "requires": { @@ -5084,13 +5580,6 @@ "figgy-pudding": "^3.5.1" } }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true, - "optional": true - }, "statuses": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", @@ -5108,9 +5597,9 @@ } }, "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, "string-template": { @@ -5236,30 +5725,24 @@ } }, "tar": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.6.tgz", - "integrity": "sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==", + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", "dev": true, "requires": { - "chownr": "^1.0.1", + "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.3", - "minizlib": "^1.1.0", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" + "yallist": "^3.0.3" }, "dependencies": { "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "yallist": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", - "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true } } @@ -5270,13 +5753,6 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, - "throttleit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", - "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", - "dev": true, - "optional": true - }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -5284,13 +5760,45 @@ "dev": true }, "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { - "readable-stream": "^2.1.5", + "readable-stream": "~2.3.6", "xtend": "~4.0.1" + }, + "dependencies": { + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "tiny-lr": { @@ -5334,14 +5842,14 @@ "dev": true }, "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "dev": true, "optional": true, "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" + "psl": "^1.1.28", + "punycode": "^2.1.1" } }, "trim-newlines": { @@ -5362,6 +5870,12 @@ "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", "dev": true }, + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -5388,6 +5902,12 @@ "prelude-ls": "~1.1.2" } }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -5395,45 +5915,24 @@ "dev": true }, "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz", + "integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==", "dev": true, "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "commander": "~2.20.3" } }, - "ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", - "dev": true - }, "underscore.string": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz", - "integrity": "sha1-LCo/n4PmR2L9xF5s6sZRQoZCE9s=", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", + "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", "dev": true, "requires": { "sprintf-js": "^1.0.3", "util-deprecate": "^1.0.2" } }, - "unicode-5.2.0": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/unicode-5.2.0/-/unicode-5.2.0-0.7.5.tgz", - "integrity": "sha512-KVGLW1Bri30x00yv4HNM8kBxoqFXr0Sbo55735nvrlsx4PYBZol3UtoWgO492fSwmsetzPEZzy73rbU8OGXJcA==", - "dev": true - }, "unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", @@ -5444,9 +5943,9 @@ } }, "unique-slug": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.1.tgz", - "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", "dev": true, "requires": { "imurmurhash": "^0.1.4" @@ -5458,6 +5957,15 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "uri-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz", @@ -5486,16 +5994,22 @@ "dev": true }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true, "optional": true }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -5548,36 +6062,11 @@ "isexe": "^2.0.0" } }, - "winston": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.4.tgz", - "integrity": "sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q==", - "dev": true, - "optional": true, - "requires": { - "async": "~1.0.0", - "colors": "1.0.x", - "cycle": "1.0.x", - "eyes": "0.1.x", - "isstream": "0.1.x", - "stack-trace": "0.0.x" - }, - "dependencies": { - "async": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/async/-/async-1.0.0.tgz", - "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", - "dev": true, - "optional": true - }, - "colors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", - "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", - "dev": true, - "optional": true - } - } + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true }, "wordwrap": { "version": "1.0.0", @@ -5601,14 +6090,12 @@ } }, "ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "dev": true, "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" + "async-limiter": "~1.0.0" } }, "xtend": { @@ -5624,18 +6111,19 @@ "dev": true }, "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "yauzl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", - "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", "dev": true, "requires": { - "fd-slicer": "~1.0.1" + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" } } } diff --git a/package.json b/package.json index 4244977..6f03b20 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "url": "https://github.com/tempusdominus/core/issues" }, "dependencies": { - "jquery": "^3.0", - "moment": "^2.22.2", + "jquery": "^3.5.0", + "moment": "^2.24.0", "moment-timezone": "^0.4.0" }, "peerDependenciesd": { @@ -23,18 +23,18 @@ "devDependencies": { "babel-plugin-transform-es2015-modules-strip": "^0.1.0", "babel-preset-es2015": "^6.16.0", - "grunt": "^1.0.3", + "grunt": "^1.1.0", "grunt-babel": "6.0.0", "grunt-contrib-concat": "^1.0.1", "grunt-contrib-connect": "^1.0.1", - "grunt-contrib-jasmine": "^2.0.2", + "grunt-contrib-jasmine": "^2.1.0", "grunt-contrib-jshint": "latest", "grunt-contrib-less": "latest", "grunt-contrib-uglify": "latest", "grunt-contrib-watch": "^1.1.0", - "grunt-env": "^0.4.4", + "grunt-env": "^1.0.1", "grunt-eslint": "^19.0.0", - "grunt-nuget": "^0.3.0", + "grunt-nuget": "^0.3.1", "grunt-string-replace": "latest", "load-grunt-tasks": "latest" }, From c62641a6d2e07fa5060b2dd5fdec3aeb3ea1abc4 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 00:42:03 +0200 Subject: [PATCH 02/92] tonix-tuft/tempusdominus - Fork of tempusdominus/core --- ...tempusdominus-core.js => tempusdominus.js} | 0 ...minus-core.min.js => tempusdominus.min.js} | 0 composer.json | 6 +- docs/Installing/index.html | 6 +- docs/mkdocs/search_index.json | 1844 ++++++++--------- package-lock.json | 4 +- package.json | 8 +- ...tempusdominus-core.js => tempusdominus.js} | 0 tasks/bump-version.js | 2 +- 9 files changed, 935 insertions(+), 935 deletions(-) rename build/js/{tempusdominus-core.js => tempusdominus.js} (100%) rename build/js/{tempusdominus-core.min.js => tempusdominus.min.js} (100%) rename src/js/{tempusdominus-core.js => tempusdominus.js} (100%) diff --git a/build/js/tempusdominus-core.js b/build/js/tempusdominus.js similarity index 100% rename from build/js/tempusdominus-core.js rename to build/js/tempusdominus.js diff --git a/build/js/tempusdominus-core.min.js b/build/js/tempusdominus.min.js similarity index 100% rename from build/js/tempusdominus-core.min.js rename to build/js/tempusdominus.min.js diff --git a/composer.json b/composer.json index 20d0f6c..dce1d2a 100644 --- a/composer.json +++ b/composer.json @@ -17,11 +17,11 @@ "extra": { "component": { "scripts": [ - "src/js/tempusdominus-core.js" + "src/js/tempusdominus.js" ], "files": [ - "build/js/tempusdominus-core.js" + "build/js/tempusdominus.js" ] } } -} +} \ No newline at end of file diff --git a/docs/Installing/index.html b/docs/Installing/index.html index 098778d..550290e 100644 --- a/docs/Installing/index.html +++ b/docs/Installing/index.html @@ -182,9 +182,9 @@

CDN

</head> -

bower Bower version

+

bower Bower version

Run the following command:

-
bower install tempusdominus-core#latest --save
+
bower install tempusdominus#latest --save
 

Include necessary scripts and styles:

@@ -192,7 +192,7 @@

bower Bower version

diff --git a/docs/mkdocs/search_index.json b/docs/mkdocs/search_index.json index 2477950..6212c91 100644 --- a/docs/mkdocs/search_index.json +++ b/docs/mkdocs/search_index.json @@ -1,924 +1,924 @@ { - "docs": [ - { - "location": "/", - "text": "Tempus Dominus - Core v5 Docs\n\n\n\n \nNote\n\n All functions are accessed via the \ndata\n attribute e.g. \n$('#datetimepicker').datetimepicker(FUNCTION)\n\n\n\n\n\nUnderstanding \"Core\"\n\n\nThese documents represent the functions and options specif to the Core module. Each UI module should contain these docs and their own code examples and requirements.\n\n\nUnless you are interested in developing your own UI module you should refer to the docs for the UI module you're using.", - "title": "Home" - }, - { - "location": "/#tempus-dominus-core-v5-docs", - "text": "Note \n All functions are accessed via the data attribute e.g. $('#datetimepicker').datetimepicker(FUNCTION)", - "title": "Tempus Dominus - Core v5 Docs" - }, - { - "location": "/#understanding-core", - "text": "These documents represent the functions and options specif to the Core module. Each UI module should contain these docs and their own code examples and requirements. Unless you are interested in developing your own UI module you should refer to the docs for the UI module you're using.", - "title": "Understanding \"Core\"" - }, - { - "location": "/Installing/", - "text": "Minimal Requirements\n\n\n\n\njQuery\n\n\nMoment.js\n\n\nLocales: Moment's locale files are \nhere\n\n\n\n\nInstallation Guides\n\n\n\n\nCDN\n\n\nBower\n\n\nNuget\n\n\nRails\n\n\nAngular\n\n\nMeteor.js\n\n\nManual\n\n\n\n\nCDN\n\n\nhead\n\n \nscript type=\ntext/javascript\n src=\nhttps://cdnjs.com/libraries/[fill-in].js\n/script\n\n\n/head\n\n\n\n\n\nbower\n \n\n\nRun the following command:\n\n\nbower install tempusdominus-core#latest --save\n\n\n\n\nInclude necessary scripts and styles:\n\n\nhead\n\n \n!-- ... --\n\n \nscript type=\ntext/javascript\n src=\n/bower_components/jquery/jquery.min.js\n/script\n\n \nscript type=\ntext/javascript\n src=\n/bower_components/moment/min/moment.min.js\n/script\n\n \nscript type=\ntext/javascript\n src=\n/bower_components/tempusdominus-core/build/js/core.min.js\n/script\n\n\n/head\n\n\n\n\n\nNuget\n\n\nCore\n: \n\n\nPM\n Install-Package Tempus.Dominus.Core\n\n\n\n\nhead\n\n \nscript type=\ntext/javascript\n src=\n/scripts/jquery.min.js\n/script\n\n \nscript type=\ntext/javascript\n src=\n/scripts/moment.min.js\n/script\n\n \nscript type=\ntext/javascript\n src=\n/scripts/tempusdominus/core.js\n/script\n\n\n/head\n\n\n\n\n\nRails\n\n\nNeed new wrapper for this version.\n\n\nAngular Wrapper\n\n\nNeed new wrapper for this version.\n\n\nMeteor.js\n\n\nNeed new wrapper for this version.\n\n\nManual\n\n\nAcquire \njQuery\n\n\nAcquire \nMoment.js\n\n\nscript type=\ntext/javascript\n src=\n/path/to/jquery.js\n/script\n\n\nscript type=\ntext/javascript\n src=\n/path/to/moment.js\n/script\n\n\nscript type=\ntext/javascript\n src=\n/path/to/core.min.js\n/script\n\n\n\n\n\nKnockout\n\n\nNeed new wrapper for this version.", - "title": "Installing" - }, - { - "location": "/Installing/#minimal-requirements", - "text": "jQuery Moment.js Locales: Moment's locale files are here", - "title": "Minimal Requirements" - }, - { - "location": "/Installing/#installation-guides", - "text": "CDN Bower Nuget Rails Angular Meteor.js Manual", - "title": "Installation Guides" - }, - { - "location": "/Installing/#cdn", - "text": "head \n script type= text/javascript src= https://cdnjs.com/libraries/[fill-in].js /script /head", - "title": "CDN" - }, - { - "location": "/Installing/#bower", - "text": "Run the following command: bower install tempusdominus-core#latest --save Include necessary scripts and styles: head \n !-- ... -- \n script type= text/javascript src= /bower_components/jquery/jquery.min.js /script \n script type= text/javascript src= /bower_components/moment/min/moment.min.js /script \n script type= text/javascript src= /bower_components/tempusdominus-core/build/js/core.min.js /script /head", - "title": "bower" - }, - { - "location": "/Installing/#nuget", - "text": "", - "title": "Nuget" - }, - { - "location": "/Installing/#core", - "text": "PM Install-Package Tempus.Dominus.Core head \n script type= text/javascript src= /scripts/jquery.min.js /script \n script type= text/javascript src= /scripts/moment.min.js /script \n script type= text/javascript src= /scripts/tempusdominus/core.js /script /head", - "title": "Core:" - }, - { - "location": "/Installing/#rails", - "text": "Need new wrapper for this version.", - "title": "Rails" - }, - { - "location": "/Installing/#angular-wrapper", - "text": "Need new wrapper for this version.", - "title": "Angular Wrapper" - }, - { - "location": "/Installing/#meteorjs", - "text": "Need new wrapper for this version.", - "title": "Meteor.js" - }, - { - "location": "/Installing/#manual", - "text": "", - "title": "Manual" - }, - { - "location": "/Installing/#acquire-jquery", - "text": "", - "title": "Acquire jQuery" - }, - { - "location": "/Installing/#acquire-momentjs", - "text": "script type= text/javascript src= /path/to/jquery.js /script script type= text/javascript src= /path/to/moment.js /script script type= text/javascript src= /path/to/core.min.js /script", - "title": "Acquire Moment.js" - }, - { - "location": "/Installing/#knockout", - "text": "Need new wrapper for this version.", - "title": "Knockout" - }, - { - "location": "/Functions/", - "text": "Functions\n\n\n\n \nNote\n\n All functions are accessed via the \ndata\n attribute e.g. \n$('#datetimepicker').datetimepicker(FUNCTION)\n\n\n\n\n\ndestroy\n\n\nDestroys the widget and removes all attached event listeners\n\n\n\n\ntoggle\n\n\nShows or hides the widget\n\n\nEmits\n\n\n\n\n\n\nhide.datetimepicker\n - if the widget is hidden after the toggle call\n\n\n\n\n\n\nshow.datetimepicker\n - if the widget is show after the toggle call\n\n\n\n\n\n\nchange.datetimepicker\n - if the widget is opened for the first time and the input element is empty and \noptions.useCurrent != false\n\n\n\n\n\n\n\n\nshow\n\n\nShows the widget\n\n\nEmits\n\n\n\n\n\n\nshow.datetimepicker\n - if the widget was hidden before that call\n\n\n\n\n\n\nchange.datetimepicker\n - if the widget is opened for the first time and the \nuseCurrent\n is set to true or to a granularity value and the input element the component is attached to has an empty value\n\n\n\n\n\n\n\n\nhide\n\n\nHides the widget\n\n\nEmits\n\n\n\n\nhide.datetimepicker\n - if the widget was visible before that call\n\n\n\n\n\n\ndisable\n\n\nDisables the input element, the component is attached to, by adding a \ndisabled=\"true\"\n attribute to it. If the widget was visible before that call it is hidden.\n\n\nEmits\n\n\n\n\nhide.datetimepicker\n - if the widget was visible before that call\n\n\n\n\n\n\nenable\n\n\nEnables the input element, the component is attached to, by removing \ndisabled\n attribute from it.\n\n\n\n\nclear\n\n\nClears the date picker by setting the value to \nnull\n\n\n\n\nviewDate\n\n\nviewDate\n\n\nReturns a \nmoment\n variable with the currently set \noptions.viewDate\n option.\n\n\nviewDate(viewDate)\n\n\nTakes a \nstring, moment or Date\n value.\n\n\nThis will change the \nviewDate\n without changing or setting the selected date.", - "title": "Functions" - }, - { - "location": "/Functions/#functions", - "text": "Note \n All functions are accessed via the data attribute e.g. $('#datetimepicker').datetimepicker(FUNCTION)", - "title": "Functions" - }, - { - "location": "/Functions/#destroy", - "text": "Destroys the widget and removes all attached event listeners", - "title": "destroy" - }, - { - "location": "/Functions/#toggle", - "text": "Shows or hides the widget", - "title": "toggle" - }, - { - "location": "/Functions/#emits", - "text": "hide.datetimepicker - if the widget is hidden after the toggle call show.datetimepicker - if the widget is show after the toggle call change.datetimepicker - if the widget is opened for the first time and the input element is empty and options.useCurrent != false", - "title": "Emits" - }, - { - "location": "/Functions/#show", - "text": "Shows the widget", - "title": "show" - }, - { - "location": "/Functions/#emits_1", - "text": "show.datetimepicker - if the widget was hidden before that call change.datetimepicker - if the widget is opened for the first time and the useCurrent is set to true or to a granularity value and the input element the component is attached to has an empty value", - "title": "Emits" - }, - { - "location": "/Functions/#hide", - "text": "Hides the widget", - "title": "hide" - }, - { - "location": "/Functions/#emits_2", - "text": "hide.datetimepicker - if the widget was visible before that call", - "title": "Emits" - }, - { - "location": "/Functions/#disable", - "text": "Disables the input element, the component is attached to, by adding a disabled=\"true\" attribute to it. If the widget was visible before that call it is hidden.", - "title": "disable" - }, - { - "location": "/Functions/#emits_3", - "text": "hide.datetimepicker - if the widget was visible before that call", - "title": "Emits" - }, - { - "location": "/Functions/#enable", - "text": "Enables the input element, the component is attached to, by removing disabled attribute from it.", - "title": "enable" - }, - { - "location": "/Functions/#clear", - "text": "Clears the date picker by setting the value to null", - "title": "clear" - }, - { - "location": "/Functions/#viewdate", - "text": "", - "title": "viewDate" - }, - { - "location": "/Functions/#viewdate_1", - "text": "Returns a moment variable with the currently set options.viewDate option.", - "title": "viewDate" - }, - { - "location": "/Functions/#viewdateviewdate", - "text": "Takes a string, moment or Date value. This will change the viewDate without changing or setting the selected date.", - "title": "viewDate(viewDate)" - }, - { - "location": "/Options/", - "text": "Options\n\n\n\n \nNote\n\n All options are accessed via the \ndata\n attribute e.g. \n$('#datetimepicker').datetimepicker(OPTION, ARGUMENT)\n\n\n **TODO** should I move some of this to the component?\n\n\n\n\noptions\n\n\nReturns the components current options object. Note that the changing the values of the returned object does not change the components actual configuration. Use \noptions(options)\n to set the components options massively or the other methods for setting config options individually.\n\n\noptions, [options]\n\n\nTakes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component.\n\n\n\n\ndate\n\n\nReturns the component's model current date, a \nmoment\n object or \nnull\n if not set.\n\n\ndate, [newDate]\n\n\nTakes \nstring, Date, moment, null\n parameter and sets the components model current moment to it. Passing a \nnull\n value unsets the components model current moment. Parsing of the \nnewDate\n parameter is made using moment library with the \noptions.format\n and \noptions.useStrict\n components configuration.\n\n\nThrows\n\n\n\n\nTypeError\n - in case the \nnewDate\n cannot be parsed\n\n\n\n\nEmits\n\n\n\n\nchange.datetimepicker\n - In case \nnewDate\n is different from current moment\n\n\n\n\n\n\nformat\n\n\nDefault: false\n\n\n\nSee \nmomentjs' docs\n for valid formats. Format also dictates what components are shown, e.g. \nMM/dd/YYYY\n will not display the time picker.\n\n\nformat\n\n\nReturns the component's \noptions.format\n \nstring\n\n\nformat, [format]\n\n\nTakes a \nmoment.js\n format \nstring\n and sets the components \noptions.format\n. This is used for displaying and also for parsing input strings either from the input element the component is attached to or the \ndate()\n function.\nThe parameter can also be a \nboolean:false\n in which case the format is set to the locale's \nL LT\n.\n\n\nNote:\n this is also used to determine if the time picker sub component will display the hours in 12 or 24 format. (if \na\n or \nh\n exists in the passed \nstring\n then a 12 hour mode is set)\n\n\n\n\ndayViewHeaderFormat\n\n\nDefault: 'MMMM YYYY'\n\n\n\nChanges the heading of the date picker when in \"days\" view.\n\n\n\n\ndayViewHeaderFormat\n\n\nReturns a \nstring\n variable with the currently set \noptions.dayViewHeaderFormat\n option.\n\n\ndayViewHeaderFormat, [string]\n\n\nTakes a \nstring\n value.\n\n\nUsed to customize the header of the day view.\n\n\n\n\nextraFormats\n\n\nDefault: false\n\n\n\nAllows for several input formats to be valid. See \nthis PR\n.\n\n\nextraFormats\n\n\nReturns a \nboolean\n or array with the \noptions.extraFormats\n option configuration\n\n\nextraFormats, [formats]\n\n\nTakes an array of valid input moment format options.\n\n\n\n\nstepping\n\n\nDefault: 1\n\n\n\nNumber of minutes the up/down arrow's will move the minutes value in the time picker\n\n\nstepping\n\n\nReturns a \nnumber\n with the \noptions.stepping\n option configuration\n\n\nstepping, [number]\n\n\nTakes a \nnumber\n. This be the amount the up/down arrows move the minute value with a time picker.\n\n\n\n\nmin/maxDate\n\n\nDefault: false\nAccepts: date, moment, string\n\n\n\nPrevents date/time selections before this date. Will override \ndefaultDate\n and \nuseCurrent\n if either of these settings are the same day since both options are invalid according to the rules you've selected.\n\n\nminDate\n\n\nReturns the currently set moment of the \noptions.minDate\n or \nfalse\n if not set\n\n\nminDate, [minDate]\n\n\nTakes a \nminDate\n \nstring, Date, moment, boolean:false\n parameter and disallows the user to select a moment that is before that moment. If a \nboolean:false\n value is passed the \noptions.minDate\n parameter is cleared and there is no restriction to the minimum moment the user can select. \n\n\nNote:\n If the \nminDate\n parameter is after the currently selected moment the currently selected moment changes to minDate parameter\n\n\nThrows\n\n\n\n\n\n\nTypeError\n - if \nminDate\n parameter cannot be parsed using the \noptions.format\n and \noptions.useStrict\n configuration settings\n\n\n\n\n\n\nTypeError\n - if \nminDate\n parameter is after \noptions.maxDate\n\n\n\n\n\n\nEmits\n\n\n\n\n\n\nchange.datetimepicker\n - if the new \nminDate\n is after currently selected moment (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\ndp.error\n - if the new \nminDate\n is after currently selected moment (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\n\n\nmaxDate\n\n\nReturns the currently set moment of the \noptions.maxDate\n or \nfalse\n if not set\n\n\nmaxDate, [maxDate]\n\n\nTakes a [maxDate] \nstring, Date, moment, boolean:false\n parameter and disallows the user to select a moment that is after that moment. If a \nboolean:false\n value is passed \noptions.maxDate\n is cleared and there is no restriction to the maximum moment the user can select.\n\n\nNote:\n If [maxDate] is before the currently selected moment the currently selected moment changes to [maxDate]\n\n\nThrows\n\n\n\n\n\n\nTypeError\n - if \nmaxDate\n parameter cannot be parsed using the \noptions.format\n and \noptions.useStrict\n configuration settings\n\n\n\n\n\n\nTypeError\n - if \nmaxDate\n parameter is before \noptions.minDate\n\n\n\n\n\n\nEmits\n\n\n\n\n\n\nchange.datetimepicker\n - if the new \nmaxDate\n is after currently selected moment (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\ndp.error\n - if the new \nmaxDate\n is after currently selected moment (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\n\n\nuseCurrent\n\n\nDefault: true\n\n\n\nOn \nshow\n, will set the picker to the current date/time.\n\n\nuseCurrent\n\n\nReturns a \nboolean\n or \nstring\n with the \noptions.useCurrent\n option configuration\n\n\nuseCurrent, boolean or string\n\n\nTakes a \nboolean\n or \nstring\n. If a \nboolean\n true is passed and the components model moment is not set (either through \nsetDate\n or through a valid value on the input element the component is attached to) then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. If a false \nboolean\n is passed then no initialization happens on the input element. You can select the granularity on the initialized moment by passing one of the following strings (\n'year', 'month', 'day', 'hour', 'minute'\n) in the variable.\n\n\nIf for example you pass \n'day'\n to the \nsetUseCurrent\n function and the input field is empty the first time the user opens the datetimepicker widget the input text will be initialized to the current date time with day granularity (e.g. if current time = \n2014-08-10 13:32:33\n the input value will be initialized to \n2014-08-10 00:00:00\n)\n\n\nNote:\n If the \noptions.defaultDate\n is set or the input element the component is attached to has already a value that takes precedence and the functionality of \nuseCurrent\n is not triggered!\n\n\n\n\ncollapse\n\n\nDefault: true\n\n\n\nUsing a Bootstraps collapse to switch between date/time pickers.\n\n\ncollapse\n\n\nReturns a \nboolean\n of the \noptions.sideBySide\n.\n\n\ncollapse, [collapse]\n\n\nTakes a \nboolean\n. If set to \nfalse\n the picker will display similar to \nsideBySide\n except vertical.\n\n\n\n\nlocale\n\n\nDefault: moment.locale()\nAccepts: string, moment.local('locale')\n\n\n\nSee \nmomentjs\n for valid locales.\n\n\nYou must include \nmoment-with-locales.js\n or a local js file.\n\n\nlocale\n\n\nReturns the currently set locale of the \noptions.locale\n\n\nlocale, [newLocale]\n\n\nTakes a \nstring\n of any valid \nmoment locale\n e.g. \nde\n for German.\n\n\nThrows\n\n\n\n\nTypeError\n - if the locale is not loaded via a separate script or \nmoment-with-locales\n\n\n\n\n\n\ndefaultDate\n\n\nDefault: false\nAccepts: date, moment, string\n\n\n\nSets the picker default date/time. Overrides \nuseCurrent\n\n\ndefaultDate\n\n\nReturns a \nmoment\n with the \noptions.defaultDate\n option configuration or \nfalse\n if not set\n\n\ndefaultDate, [defaultDate]\n\n\nTakes a \nstring, Date, moment, boolean:false\n. Will set the picker's initial date. If a \nboolean:false\n value is passed the \noptions.defaultDate\n parameter is cleared. \n\n\n\n\n\n\nTypeError\n - if the provided date pass validation, including \ndisabledDates\n, \nenabledDates\n, \nminDate\n, \nmaxDate\n, and \ndaysOfWeekDisabled\n\n\n\n\n\n\nTypeError\n - if the provided date cannot be parsed by moment.js\n\n\n\n\n\n\n\n\nen/disabledDates\n\n\nDefault: false\nAccepts: array of [date, moment, string]\n\n\n\ndisabledDates\n\n\nReturns an array with the currently set disabled dates on the component.\n\n\ndisabledDates, [dates]\n\n\nTakes an \n[\n \nstring\n or \nDate\n or \nmoment\n \n]\n of values and disallows the user to select those days. Setting this takes precedence over \noptions.minDate\n, \noptions.maxDate\n configuration. Also calling this function removes the configuration of options.enabledDates if such exist.\n\n\nNote:\n These values are matched with \nDay\n granularity.\n\n\n\n\nenabledDates\n\n\nReturns an array with the currently set enabled dates on the component.\n\n\nenabledDates, [dates]\n\n\nTakes an \n[\n \nstring\n or \nDate\n or \nmoment\n \n]\n of values and allows the user to select only from those days. Setting this takes precedence over \noptions.minDate\n, \noptions.maxDate\n configuration. Also calling this function removes the configuration of \noptions.disabledDates\n if such exist.\n\n\nNote:\n These values are matched with \nDay\n granularity.\n\n\n\n\nicons\n\n\nDefault: {\n time: 'glyphicon glyphicon-time',\n date: 'glyphicon glyphicon-calendar',\n up: 'glyphicon glyphicon-chevron-up',\n down: 'glyphicon glyphicon-chevron-down',\n previous: 'glyphicon glyphicon-chevron-left',\n next: 'glyphicon glyphicon-chevron-right',\n today: 'glyphicon glyphicon-screenshot',\n clear: 'glyphicon glyphicon-trash',\n close: 'glyphicon glyphicon-remove'\n }\nAccepts: object with all or some of the parameters above\n\n\n\nChange the default icons for the pickers functions.\n\n\nicons\n\n\nReturns an \nOjbect\n of \noptions.icons\n \n\n\nicons, [icons]\n\n\nTakes an \nOjbect\n of \nstrings\n.\n\n\nThrows\n\n\n\n\nTypeError\n - if icons parameter is not an \nOjbect\n\n\n\n\n\n\nuseStrict\n\n\nDefault: false\n\n\n\nDefines if moment should use strict date parsing when considering a date to be valid.\n\n\nuseStrict\n\n\nReturns a \nboolean\n of the \noptions.useStrict\n\n\nuseStrict, [useStrict]\n\n\nTakes a \nboolean\n. If \nuseStrict\n is \ntrue\n, moment.js parsing rules will be stricter when determining if a date is valid or not.\n\n\n\n\nsideBySide\n\n\nDefault: false\n\n\n\nShows the picker side by side when using the time and date together.\n\n\n\n\nsideBySide\n\n\nReturns a \nboolean\n of the \noptions.sideBySide\n.\n\n\nsideBySide, [sideBySide]\n\n\nTakes a \nboolean\n. If \nsideBySide\n is \ntrue\n and the time picker is used, both components will display side by side instead of collapsing.\n\n\n\n\ndaysOfWeekDisabled\n\n\nDefault: []\nAccepts: array of numbers from 0-6\n\n\n\nDisables the section of days of the week, e.g. weekends.\n\n\ndaysOfWeekDisabled\n\n\nReturns an array with the \noptions.daysOfWeekDisabled\n configuration setting of the component.\n\n\ndaysOfWeekDisabled, [daysOfWeek]\n\n\nTakes an \n[\n \nNumber\n:\n0\n to \n6\n \n]\n and disallow the user to select weekdays that exist in this array. This has lower priority over the \noptions.minDate\n, \noptions.maxDate\n, \noptions.disabledDates\n and \noptions.enabledDates\n configuration settings.\n\n\nEmits\n\n\n\n\n\n\nchange.datetimepicker\n - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\ndp.error\n - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\n\n\ncalendarWeeks\n\n\nDefault: false\n\n\n\nShows the week of the year to the left of first day of the week.\n\n\n\n\ncalendarWeeks\n\n\nReturns a \nboolean\n with the current \noptions.calendarWeeks\n option configuration\n\n\ncalendarWeeks, [boolean]\n\n\nTakes a \nboolean\n variable to set if the week numbers will appear to the left on the days view\n\n\n\n\nviewMode\n\n\nDefault: 'days'\nAccepts: 'decades','years','months','days'\n\n\n\nThe default view to display when the picker is shown.\n\n\nNote\n: To limit the picker to selecting, for instance the year and month, use \nformat: MM/YYYY\n.\n\n\nviewMode\n\n\nReturns a \nstring\n of the \noptions.viewMode\n.\n\n\nviewMode, [newViewMode]\n\n\nTakes a \nstring\n. Valid values are \n'days'\n, \n'months'\n, \n'years'\n and \n'decades'\n\n\nThrows\n\n\n\n\nTypeError\n - if \nnewViewMode\n parameter is not an a \nstring\n or if \nnewViewMode\n is not a valid value.\n\n\n\n\n\n\ntoolbarPlacement\n\n\nDefault: 'default'\nAccepts: 'default', 'top', 'bottom'\n\n\n\nChanges the placement of the icon toolbar.\n\n\n\n\ntoolbarplacement\n\n\nReturns a \nstring\n variable with the currently set \noptions.toolbarplacement\n option.\n\n\ntoolbarplacement, [string]\n\n\nTakes a \nstring\n value. Valid values are \n'default'\n, \n'top'\n and \n'bottom'\n.\n\n\nChanges the placement of the toolbar where the today, clear, component switch icon are located.\n\n\n\n\nbuttons\n\n\nDefault: {\n showToday: false,\n showClear: false,\n showClose: false\n }\nAccepts: object with all or some of the parameters above\n\n\n\nChange the default toolbar buttons for the pickers functions.\n\n\nbuttons\n\n\nReturns an \nOjbect\n of \noptions.buttons\n \n\n\nbuttons, [buttons]\n\n\nTakes an \nOjbect\n of \nboolean\n.\n\n\nThrows\n\n\n\n\nTypeError\n - if buttons parameter is not an \nOjbect\n\n\n\n\n\n\nwidgetPositioning\n\n\nDefault: {\n horizontal: 'auto'\n vertical: 'auto'\n }\nAccepts: object with the all or one of the parameters above\n horizontal: 'auto', 'left', 'right'\n vertical: 'auto', 'top', 'bottom'\n\n\n\nwidgetPositioning\n\n\nReturns the currently set \noptions.widgetPositioning\n object containing two keys \nhorizontal\n and \nvertical\n\n\nwidgetPositioning, [positioningObject]\n\n\nTakes an object parameter that can contain two keys \nvertical\n and \nhorizontal\n each having a value of \n'auto', 'top', 'bottom'\n for \nvertical\n and \n'auto', 'left', 'right'\n for \nhorizontal\n which defines where the dropdown with the widget will appear relative to the input element the component is attached to.\n\n\n'auto'\n is the default value for both \nhorizontal\n and \nvertical\n keys and it tries to automatically place the dropdown in a position that is visible to the user. Usually you should not override those options unless you have a special need in your layout.\n\n\n\n\nwidgetParent\n\n\nDefault: null\nAccepts: string or jQuery object\n\n\n\nOn picker show, places the widget at the identifier (string) or jQuery object \nif\n the element has css \nposition: 'relative'\n\n\nwidgetParent\n\n\nReturns a \n$(element)\n variable with the currently set \noptions.widgetParent\n option.\n\n\nwidgetParent, [widgetParent]\n\n\nTakes a \nstring\n or \n$(element)\n value.\n\n\n\n\nkeepOpen\n\n\nDefault: false\n\n\n\nWill cause the date picker to stay open after selecting a date.\n\n\nkeepOpen\n\n\nReturns a \nboolean\n variable with the currently set \noptions.keepOpen\n option.\n\n\nkeepOpen, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\n\n\ninline\n\n\nDefault: false\n\n\n\nWill display the picker inline without the need of a input field. This will also hide borders and shadows.\n\n\ninline\n\n\nReturns a \nboolean\n variable with the currently set \noptions.inline\n option.\n\n\ninline, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\n\n\nkeepInvalid\n\n\n4.7.14\n\n\nDefault: false\n\n\n\nWill cause the date picker to \nnot\n revert or overwrite invalid dates.\n\n\nkeepInvalid\n\n\nReturns a \nstring\n variable with the currently set \noptions.keepInvalid\n option.\n\n\nkeepInvalid, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\nIf \ntrue\n, invalid dates will not be reverted to a previous selection or changed.\n\n\n\n\nkeyBinds\n\n\nDefault: up: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(7, 'd'));\n } else {\n this.date(this.date().clone().add(1, 'm'));\n }\n },\n down: function (widget) {\n if (!widget) {\n this.show();\n }\n else if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(7, 'd'));\n } else {\n this.date(this.date().clone().subtract(1, 'm'));\n }\n },\n 'control up': function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'y'));\n } else {\n this.date(this.date().clone().add(1, 'h'));\n }\n },\n 'control down': function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'y'));\n } else {\n this.date(this.date().clone().subtract(1, 'h'));\n }\n },\n left: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'd'));\n }\n },\n right: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'd'));\n }\n },\n pageUp: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'M'));\n }\n },\n pageDown: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'M'));\n }\n },\n enter: function () {\n this.hide();\n },\n escape: function () {\n this.hide();\n },\n 'control space': function (widget) {\n if (widget.find('.timepicker').is(':visible')) {\n widget.find('.btn[data-action=\"togglePeriod\"]').click();\n }\n },\n t: function () {\n this.date(moment());\n },\n 'delete': function () {\n this.clear();\n }\n\n\n\nAllows for custom events to fire on keyboard press.\n\n\nkeyBinds\n\n\nReturns a \nstring\n variable with the currently set \noptions.keyBinds\n option.\n\n\nkeyBinds, [object]\n\n\nTakes an \nobject\n value.\n\n\nAllows for several \nkeyBinding\n functions to be specified for ease of access or accessibility. See the options page for defaults.\n\n\n\n\ndebug\n\n\nDefault: false\n\n\n\nWill cause the date picker to stay open after a \nblur\n event.\n\n\n\n\nignoreReadonly\n\n\nDefault: false\n\n\n\nAllow date picker show event to fire even when the associated input element has the \nreadonly=\"readonly\"\n property.\n\n\nignoreReadonly\n\n\nReturns a \nboolean\n variable with the currently set \noptions.ignoreReadonly\n option.\n\n\nignoreReadonly, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\nSet this to \ntrue\n to allow the picker to be used even if the input field is \nreadonly\n. This will \nnot\n bypass the \ndisabled\n property\n\n\n\n\ndisabledTimeIntervals\n\n\nDefault: false\n\n\n\nDisables time selection between the given \nmoments\n.\n\n\ndisabledTimeIntervals\n\n\nReturns an \narray\n variable with the currently set \noptions.disabledTimeIntervals\n option.\n\n\ndisabledTimeIntervals, [array]\n\n\nTakes a \narray\n value.\n\n\nThe array \nmust\n be in the following format \n[moment(),moment()]\n\n\nFor example:\n\n\ndisabledTimeIntervals: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]]\n\n\n\nWill disable times between 12-8am and 6-12pm today\n\n\n\n\nallowInputToggle\n\n\nDefault: false\n\n\n\nIf \ntrue\n, the picker will show on textbox focus and icon click when used in a button group.\n\n\nallowInputToggle\n\n\nReturns a \nboolean\n variable with the currently set \noptions.allowInputToggle\n option.\n\n\nallowInputToggle, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\nIf \ntrue\n, the picker will show on textbox focus and icon click when used in a button group\n\n\n\n\nfocusOnShow\n\n\nDefault: true\n\n\n\nIf \nfalse\n, the textbox will not be given focus when the picker is shown.\n\n\nfocusOnShow\n\n\nReturns a \nboolean\n variable with the currently set \noptions.focusOnShow\n option.\n\n\nfocusOnShow, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\nIf \nfalse\n, the textbox will not be given focus when the picker is shown\n\n\n\n\nen/disabledHours\n\n\nDefault: false\n\n\n\ndisabledHours\n\n\nReturns an \narray\n variable with the currently set \noptions.en/disabledHours\n option.\n\n\ndisabledHours, boolean\n\n\nTakes a \narray\n value.\n\n\nMust be in 24 hour format. Will allow or disallow hour selections (much like \ndisabledTimeIntervals\n) but will affect all days.\n\n\nLike \nen/disabledDates\n, these options are mutually exclusive and will reset one of the options back to false.\n\n\ndisabledHours: [0, 1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24]\nenabledHours: [9, 10, 11, 12, 13, 14, 15, 16]\n\n\n\n\n\nviewDate\n\n\nDefault: false\n\n\n\nThis will change the \nviewDate\n without changing or setting the selected date.\n\n\n\n\nparseInputDate\n\n\nparseInputDate\n\n\nReturns a \nfunction\n with the currently set \noptions.parseInputDate\n\n\nparseInputDate, [function]\n\n\nTakes a \nfunction\n\n\nAllows custom input formatting For example: the user can enter 'yesterday' or '30 days ago.\n\n\nExample:\n\n\nvar parseRelativeDate = function(relativeDate) {\n\n switch (relativeDate) {\n case 'today':\n return moment()\n case 'yesterday':\n return moment().subtract(1, 'day');\n default:\n return moment()\n .subtract(Number(relativeDate.replace(\ndays ago\n, \n).trim()), 'days');\n }\n}\n\nvar parseInputDate = function(inputDate) {\n var relativeDatePattern = /today|yesterday|[0-9]+\\s+(days ago)/,\n resultDate;\n\n if (moment.isMoment(inputDate) || inputDate instanceof Date) {\n resultDate = moment(inputDate);\n } else {\n var relativeDate = inputDate.match(relativeDatePattern),\n parseDate = null;\n\n if (relativeDate !== null) \n parseDate = this.parseRelativeDate(inputDate.match(relativeDatePattern)[0]);\n else \n parseDate = moment();\n\n resultDate = moment(parseDate, \nYYYY-MM-DD\n);\n }\n\n return resultDate;\n}\n\n\n\n\n\n\ntooltips\n\n\ntooltips: {\n today: 'Go to today',\n clear: 'Clear selection',\n close: 'Close the picker',\n selectMonth: 'Select Month',\n prevMonth: 'Previous Month',\n nextMonth: 'Next Month',\n selectYear: 'Select Year',\n prevYear: 'Previous Year',\n nextYear: 'Next Year',\n selectDecade: 'Select Decade',\n prevDecade: 'Previous Decade',\n nextDecade: 'Next Decade',\n prevCentury: 'Previous Century',\n nextCentury: 'Next Century'\n}\n\n\n\n\nThis will change the \ntooltips\n over each icon to a custom string.\n\n\ntooltips\n\n\nReturns an \nOjbect\n of \noptions.tooltips\n \n\n\ntooltips, [tooltips]\n\n\nTakes an \nOjbect\n of \nstrings\n.\n\n\nThrows\n\n\n\n\nTypeError\n - if \ntooltips\n parameter is not an \nOjbect\n\n\n\n\n\n\ntimeZone\n\n\ntimeZone: ''\n\n\n\nAllows the setting of the Time Zone. You must include \nmoment-timezone.js\n and \nmoment-timzone\n data. See moment timezone documentation for usage.\n\n\ntimeZone\n\n\nReturns an \nstring\n of \noptions.timeZone\n \n\n\ntimeZone, [timeZone]\n\n\nTakes an \nstring\n of a valid timezone.\n\n\nThrows\n\n\n\n\nTypeError\n - if \ntooltips\n parameter is not an \nstring", - "title": "Options" - }, - { - "location": "/Options/#options", - "text": "Note \n All options are accessed via the data attribute e.g. $('#datetimepicker').datetimepicker(OPTION, ARGUMENT) \n\n **TODO** should I move some of this to the component?", - "title": "Options" - }, - { - "location": "/Options/#options_1", - "text": "Returns the components current options object. Note that the changing the values of the returned object does not change the components actual configuration. Use options(options) to set the components options massively or the other methods for setting config options individually.", - "title": "options" - }, - { - "location": "/Options/#options-options", - "text": "Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component.", - "title": "options, [options]" - }, - { - "location": "/Options/#date", - "text": "Returns the component's model current date, a moment object or null if not set.", - "title": "date" - }, - { - "location": "/Options/#date-newdate", - "text": "Takes string, Date, moment, null parameter and sets the components model current moment to it. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.", - "title": "date, [newDate]" - }, - { - "location": "/Options/#throws", - "text": "TypeError - in case the newDate cannot be parsed", - "title": "Throws" - }, - { - "location": "/Options/#emits", - "text": "change.datetimepicker - In case newDate is different from current moment", - "title": "Emits" - }, - { - "location": "/Options/#format", - "text": "Default: false See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker.", - "title": "format" - }, - { - "location": "/Options/#format_1", - "text": "Returns the component's options.format string", - "title": "format" - }, - { - "location": "/Options/#format-format", - "text": "Takes a moment.js format string and sets the components options.format . This is used for displaying and also for parsing input strings either from the input element the component is attached to or the date() function.\nThe parameter can also be a boolean:false in which case the format is set to the locale's L LT . Note: this is also used to determine if the time picker sub component will display the hours in 12 or 24 format. (if a or h exists in the passed string then a 12 hour mode is set)", - "title": "format, [format]" - }, - { - "location": "/Options/#dayviewheaderformat", - "text": "Default: 'MMMM YYYY' Changes the heading of the date picker when in \"days\" view.", - "title": "dayViewHeaderFormat" - }, - { - "location": "/Options/#dayviewheaderformat_1", - "text": "Returns a string variable with the currently set options.dayViewHeaderFormat option.", - "title": "dayViewHeaderFormat" - }, - { - "location": "/Options/#dayviewheaderformat-string", - "text": "Takes a string value. Used to customize the header of the day view.", - "title": "dayViewHeaderFormat, [string]" - }, - { - "location": "/Options/#extraformats", - "text": "Default: false Allows for several input formats to be valid. See this PR .", - "title": "extraFormats" - }, - { - "location": "/Options/#extraformats_1", - "text": "Returns a boolean or array with the options.extraFormats option configuration", - "title": "extraFormats" - }, - { - "location": "/Options/#extraformats-formats", - "text": "Takes an array of valid input moment format options.", - "title": "extraFormats, [formats]" - }, - { - "location": "/Options/#stepping", - "text": "Default: 1 Number of minutes the up/down arrow's will move the minutes value in the time picker", - "title": "stepping" - }, - { - "location": "/Options/#stepping_1", - "text": "Returns a number with the options.stepping option configuration", - "title": "stepping" - }, - { - "location": "/Options/#stepping-number", - "text": "Takes a number . This be the amount the up/down arrows move the minute value with a time picker.", - "title": "stepping, [number]" - }, - { - "location": "/Options/#minmaxdate", - "text": "Default: false\nAccepts: date, moment, string Prevents date/time selections before this date. Will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected.", - "title": "min/maxDate" - }, - { - "location": "/Options/#mindate", - "text": "Returns the currently set moment of the options.minDate or false if not set", - "title": "minDate" - }, - { - "location": "/Options/#mindate-mindate", - "text": "Takes a minDate string, Date, moment, boolean:false parameter and disallows the user to select a moment that is before that moment. If a boolean:false value is passed the options.minDate parameter is cleared and there is no restriction to the minimum moment the user can select. Note: If the minDate parameter is after the currently selected moment the currently selected moment changes to minDate parameter", - "title": "minDate, [minDate]" - }, - { - "location": "/Options/#throws_1", - "text": "TypeError - if minDate parameter cannot be parsed using the options.format and options.useStrict configuration settings TypeError - if minDate parameter is after options.maxDate", - "title": "Throws" - }, - { - "location": "/Options/#emits_1", - "text": "change.datetimepicker - if the new minDate is after currently selected moment (waiting for #472 to close in order to finalize this part) dp.error - if the new minDate is after currently selected moment (waiting for #472 to close in order to finalize this part)", - "title": "Emits" - }, - { - "location": "/Options/#maxdate", - "text": "Returns the currently set moment of the options.maxDate or false if not set", - "title": "maxDate" - }, - { - "location": "/Options/#maxdate-maxdate", - "text": "Takes a [maxDate] string, Date, moment, boolean:false parameter and disallows the user to select a moment that is after that moment. If a boolean:false value is passed options.maxDate is cleared and there is no restriction to the maximum moment the user can select. Note: If [maxDate] is before the currently selected moment the currently selected moment changes to [maxDate]", - "title": "maxDate, [maxDate]" - }, - { - "location": "/Options/#throws_2", - "text": "TypeError - if maxDate parameter cannot be parsed using the options.format and options.useStrict configuration settings TypeError - if maxDate parameter is before options.minDate", - "title": "Throws" - }, - { - "location": "/Options/#emits_2", - "text": "change.datetimepicker - if the new maxDate is after currently selected moment (waiting for #472 to close in order to finalize this part) dp.error - if the new maxDate is after currently selected moment (waiting for #472 to close in order to finalize this part)", - "title": "Emits" - }, - { - "location": "/Options/#usecurrent", - "text": "Default: true On show , will set the picker to the current date/time.", - "title": "useCurrent" - }, - { - "location": "/Options/#usecurrent_1", - "text": "Returns a boolean or string with the options.useCurrent option configuration", - "title": "useCurrent" - }, - { - "location": "/Options/#usecurrent-boolean-or-string", - "text": "Takes a boolean or string . If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to) then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. If a false boolean is passed then no initialization happens on the input element. You can select the granularity on the initialized moment by passing one of the following strings ( 'year', 'month', 'day', 'hour', 'minute' ) in the variable. If for example you pass 'day' to the setUseCurrent function and the input field is empty the first time the user opens the datetimepicker widget the input text will be initialized to the current date time with day granularity (e.g. if current time = 2014-08-10 13:32:33 the input value will be initialized to 2014-08-10 00:00:00 ) Note: If the options.defaultDate is set or the input element the component is attached to has already a value that takes precedence and the functionality of useCurrent is not triggered!", - "title": "useCurrent, boolean or string" - }, - { - "location": "/Options/#collapse", - "text": "Default: true Using a Bootstraps collapse to switch between date/time pickers.", - "title": "collapse" - }, - { - "location": "/Options/#collapse_1", - "text": "Returns a boolean of the options.sideBySide .", - "title": "collapse" - }, - { - "location": "/Options/#collapse-collapse", - "text": "Takes a boolean . If set to false the picker will display similar to sideBySide except vertical.", - "title": "collapse, [collapse]" - }, - { - "location": "/Options/#locale", - "text": "Default: moment.locale()\nAccepts: string, moment.local('locale') See momentjs for valid locales. You must include moment-with-locales.js or a local js file.", - "title": "locale" - }, - { - "location": "/Options/#locale_1", - "text": "Returns the currently set locale of the options.locale", - "title": "locale" - }, - { - "location": "/Options/#locale-newlocale", - "text": "Takes a string of any valid moment locale e.g. de for German.", - "title": "locale, [newLocale]" - }, - { - "location": "/Options/#throws_3", - "text": "TypeError - if the locale is not loaded via a separate script or moment-with-locales", - "title": "Throws" - }, - { - "location": "/Options/#defaultdate", - "text": "Default: false\nAccepts: date, moment, string Sets the picker default date/time. Overrides useCurrent", - "title": "defaultDate" - }, - { - "location": "/Options/#defaultdate_1", - "text": "Returns a moment with the options.defaultDate option configuration or false if not set", - "title": "defaultDate" - }, - { - "location": "/Options/#defaultdate-defaultdate", - "text": "Takes a string, Date, moment, boolean:false . Will set the picker's initial date. If a boolean:false value is passed the options.defaultDate parameter is cleared. TypeError - if the provided date pass validation, including disabledDates , enabledDates , minDate , maxDate , and daysOfWeekDisabled TypeError - if the provided date cannot be parsed by moment.js", - "title": "defaultDate, [defaultDate]" - }, - { - "location": "/Options/#endisableddates", - "text": "Default: false\nAccepts: array of [date, moment, string]", - "title": "en/disabledDates" - }, - { - "location": "/Options/#disableddates", - "text": "Returns an array with the currently set disabled dates on the component.", - "title": "disabledDates" - }, - { - "location": "/Options/#disableddates-dates", - "text": "Takes an [ string or Date or moment ] of values and disallows the user to select those days. Setting this takes precedence over options.minDate , options.maxDate configuration. Also calling this function removes the configuration of options.enabledDates if such exist. Note: These values are matched with Day granularity.", - "title": "disabledDates, [dates]" - }, - { - "location": "/Options/#enableddates", - "text": "Returns an array with the currently set enabled dates on the component.", - "title": "enabledDates" - }, - { - "location": "/Options/#enableddates-dates", - "text": "Takes an [ string or Date or moment ] of values and allows the user to select only from those days. Setting this takes precedence over options.minDate , options.maxDate configuration. Also calling this function removes the configuration of options.disabledDates if such exist. Note: These values are matched with Day granularity.", - "title": "enabledDates, [dates]" - }, - { - "location": "/Options/#icons", - "text": "Default: {\n time: 'glyphicon glyphicon-time',\n date: 'glyphicon glyphicon-calendar',\n up: 'glyphicon glyphicon-chevron-up',\n down: 'glyphicon glyphicon-chevron-down',\n previous: 'glyphicon glyphicon-chevron-left',\n next: 'glyphicon glyphicon-chevron-right',\n today: 'glyphicon glyphicon-screenshot',\n clear: 'glyphicon glyphicon-trash',\n close: 'glyphicon glyphicon-remove'\n }\nAccepts: object with all or some of the parameters above Change the default icons for the pickers functions.", - "title": "icons" - }, - { - "location": "/Options/#icons_1", - "text": "Returns an Ojbect of options.icons", - "title": "icons" - }, - { - "location": "/Options/#icons-icons", - "text": "Takes an Ojbect of strings .", - "title": "icons, [icons]" - }, - { - "location": "/Options/#throws_4", - "text": "TypeError - if icons parameter is not an Ojbect", - "title": "Throws" - }, - { - "location": "/Options/#usestrict", - "text": "Default: false Defines if moment should use strict date parsing when considering a date to be valid.", - "title": "useStrict" - }, - { - "location": "/Options/#usestrict_1", - "text": "Returns a boolean of the options.useStrict", - "title": "useStrict" - }, - { - "location": "/Options/#usestrict-usestrict", - "text": "Takes a boolean . If useStrict is true , moment.js parsing rules will be stricter when determining if a date is valid or not.", - "title": "useStrict, [useStrict]" - }, - { - "location": "/Options/#sidebyside", - "text": "Default: false Shows the picker side by side when using the time and date together.", - "title": "sideBySide" - }, - { - "location": "/Options/#sidebyside_1", - "text": "Returns a boolean of the options.sideBySide .", - "title": "sideBySide" - }, - { - "location": "/Options/#sidebyside-sidebyside", - "text": "Takes a boolean . If sideBySide is true and the time picker is used, both components will display side by side instead of collapsing.", - "title": "sideBySide, [sideBySide]" - }, - { - "location": "/Options/#daysofweekdisabled", - "text": "Default: []\nAccepts: array of numbers from 0-6 Disables the section of days of the week, e.g. weekends.", - "title": "daysOfWeekDisabled" - }, - { - "location": "/Options/#daysofweekdisabled_1", - "text": "Returns an array with the options.daysOfWeekDisabled configuration setting of the component.", - "title": "daysOfWeekDisabled" - }, - { - "location": "/Options/#daysofweekdisabled-daysofweek", - "text": "Takes an [ Number : 0 to 6 ] and disallow the user to select weekdays that exist in this array. This has lower priority over the options.minDate , options.maxDate , options.disabledDates and options.enabledDates configuration settings.", - "title": "daysOfWeekDisabled, [daysOfWeek]" - }, - { - "location": "/Options/#emits_3", - "text": "change.datetimepicker - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part) dp.error - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part)", - "title": "Emits" - }, - { - "location": "/Options/#calendarweeks", - "text": "Default: false Shows the week of the year to the left of first day of the week.", - "title": "calendarWeeks" - }, - { - "location": "/Options/#calendarweeks_1", - "text": "Returns a boolean with the current options.calendarWeeks option configuration", - "title": "calendarWeeks" - }, - { - "location": "/Options/#calendarweeks-boolean", - "text": "Takes a boolean variable to set if the week numbers will appear to the left on the days view", - "title": "calendarWeeks, [boolean]" - }, - { - "location": "/Options/#viewmode", - "text": "Default: 'days'\nAccepts: 'decades','years','months','days' The default view to display when the picker is shown. Note : To limit the picker to selecting, for instance the year and month, use format: MM/YYYY .", - "title": "viewMode" - }, - { - "location": "/Options/#viewmode_1", - "text": "Returns a string of the options.viewMode .", - "title": "viewMode" - }, - { - "location": "/Options/#viewmode-newviewmode", - "text": "Takes a string . Valid values are 'days' , 'months' , 'years' and 'decades'", - "title": "viewMode, [newViewMode]" - }, - { - "location": "/Options/#throws_5", - "text": "TypeError - if newViewMode parameter is not an a string or if newViewMode is not a valid value.", - "title": "Throws" - }, - { - "location": "/Options/#toolbarplacement", - "text": "Default: 'default'\nAccepts: 'default', 'top', 'bottom' Changes the placement of the icon toolbar.", - "title": "toolbarPlacement" - }, - { - "location": "/Options/#toolbarplacement_1", - "text": "Returns a string variable with the currently set options.toolbarplacement option.", - "title": "toolbarplacement" - }, - { - "location": "/Options/#toolbarplacement-string", - "text": "Takes a string value. Valid values are 'default' , 'top' and 'bottom' . Changes the placement of the toolbar where the today, clear, component switch icon are located.", - "title": "toolbarplacement, [string]" - }, - { - "location": "/Options/#buttons", - "text": "Default: {\n showToday: false,\n showClear: false,\n showClose: false\n }\nAccepts: object with all or some of the parameters above Change the default toolbar buttons for the pickers functions.", - "title": "buttons" - }, - { - "location": "/Options/#buttons_1", - "text": "Returns an Ojbect of options.buttons", - "title": "buttons" - }, - { - "location": "/Options/#buttons-buttons", - "text": "Takes an Ojbect of boolean .", - "title": "buttons, [buttons]" - }, - { - "location": "/Options/#throws_6", - "text": "TypeError - if buttons parameter is not an Ojbect", - "title": "Throws" - }, - { - "location": "/Options/#widgetpositioning", - "text": "Default: {\n horizontal: 'auto'\n vertical: 'auto'\n }\nAccepts: object with the all or one of the parameters above\n horizontal: 'auto', 'left', 'right'\n vertical: 'auto', 'top', 'bottom'", - "title": "widgetPositioning" - }, - { - "location": "/Options/#widgetpositioning_1", - "text": "Returns the currently set options.widgetPositioning object containing two keys horizontal and vertical", - "title": "widgetPositioning" - }, - { - "location": "/Options/#widgetpositioning-positioningobject", - "text": "Takes an object parameter that can contain two keys vertical and horizontal each having a value of 'auto', 'top', 'bottom' for vertical and 'auto', 'left', 'right' for horizontal which defines where the dropdown with the widget will appear relative to the input element the component is attached to. 'auto' is the default value for both horizontal and vertical keys and it tries to automatically place the dropdown in a position that is visible to the user. Usually you should not override those options unless you have a special need in your layout.", - "title": "widgetPositioning, [positioningObject]" - }, - { - "location": "/Options/#widgetparent", - "text": "Default: null\nAccepts: string or jQuery object On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: 'relative'", - "title": "widgetParent" - }, - { - "location": "/Options/#widgetparent_1", - "text": "Returns a $(element) variable with the currently set options.widgetParent option.", - "title": "widgetParent" - }, - { - "location": "/Options/#widgetparent-widgetparent", - "text": "Takes a string or $(element) value.", - "title": "widgetParent, [widgetParent]" - }, - { - "location": "/Options/#keepopen", - "text": "Default: false Will cause the date picker to stay open after selecting a date.", - "title": "keepOpen" - }, - { - "location": "/Options/#keepopen_1", - "text": "Returns a boolean variable with the currently set options.keepOpen option.", - "title": "keepOpen" - }, - { - "location": "/Options/#keepopen-boolean", - "text": "Takes a boolean value.", - "title": "keepOpen, [boolean]" - }, - { - "location": "/Options/#inline", - "text": "Default: false Will display the picker inline without the need of a input field. This will also hide borders and shadows.", - "title": "inline" - }, - { - "location": "/Options/#inline_1", - "text": "Returns a boolean variable with the currently set options.inline option.", - "title": "inline" - }, - { - "location": "/Options/#inline-boolean", - "text": "Takes a boolean value.", - "title": "inline, [boolean]" - }, - { - "location": "/Options/#keepinvalid", - "text": "4.7.14 Default: false Will cause the date picker to not revert or overwrite invalid dates.", - "title": "keepInvalid" - }, - { - "location": "/Options/#keepinvalid_1", - "text": "Returns a string variable with the currently set options.keepInvalid option.", - "title": "keepInvalid" - }, - { - "location": "/Options/#keepinvalid-boolean", - "text": "Takes a boolean value. If true , invalid dates will not be reverted to a previous selection or changed.", - "title": "keepInvalid, [boolean]" - }, - { - "location": "/Options/#keybinds", - "text": "Default: up: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(7, 'd'));\n } else {\n this.date(this.date().clone().add(1, 'm'));\n }\n },\n down: function (widget) {\n if (!widget) {\n this.show();\n }\n else if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(7, 'd'));\n } else {\n this.date(this.date().clone().subtract(1, 'm'));\n }\n },\n 'control up': function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'y'));\n } else {\n this.date(this.date().clone().add(1, 'h'));\n }\n },\n 'control down': function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'y'));\n } else {\n this.date(this.date().clone().subtract(1, 'h'));\n }\n },\n left: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'd'));\n }\n },\n right: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'd'));\n }\n },\n pageUp: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'M'));\n }\n },\n pageDown: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'M'));\n }\n },\n enter: function () {\n this.hide();\n },\n escape: function () {\n this.hide();\n },\n 'control space': function (widget) {\n if (widget.find('.timepicker').is(':visible')) {\n widget.find('.btn[data-action=\"togglePeriod\"]').click();\n }\n },\n t: function () {\n this.date(moment());\n },\n 'delete': function () {\n this.clear();\n } Allows for custom events to fire on keyboard press.", - "title": "keyBinds" - }, - { - "location": "/Options/#keybinds_1", - "text": "Returns a string variable with the currently set options.keyBinds option.", - "title": "keyBinds" - }, - { - "location": "/Options/#keybinds-object", - "text": "Takes an object value. Allows for several keyBinding functions to be specified for ease of access or accessibility. See the options page for defaults.", - "title": "keyBinds, [object]" - }, - { - "location": "/Options/#debug", - "text": "Default: false Will cause the date picker to stay open after a blur event.", - "title": "debug" - }, - { - "location": "/Options/#ignorereadonly", - "text": "Default: false Allow date picker show event to fire even when the associated input element has the readonly=\"readonly\" property.", - "title": "ignoreReadonly" - }, - { - "location": "/Options/#ignorereadonly_1", - "text": "Returns a boolean variable with the currently set options.ignoreReadonly option.", - "title": "ignoreReadonly" - }, - { - "location": "/Options/#ignorereadonly-boolean", - "text": "Takes a boolean value. Set this to true to allow the picker to be used even if the input field is readonly . This will not bypass the disabled property", - "title": "ignoreReadonly, [boolean]" - }, - { - "location": "/Options/#disabledtimeintervals", - "text": "Default: false Disables time selection between the given moments .", - "title": "disabledTimeIntervals" - }, - { - "location": "/Options/#disabledtimeintervals_1", - "text": "Returns an array variable with the currently set options.disabledTimeIntervals option.", - "title": "disabledTimeIntervals" - }, - { - "location": "/Options/#disabledtimeintervals-array", - "text": "Takes a array value. The array must be in the following format [moment(),moment()] For example: disabledTimeIntervals: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] Will disable times between 12-8am and 6-12pm today", - "title": "disabledTimeIntervals, [array]" - }, - { - "location": "/Options/#allowinputtoggle", - "text": "Default: false If true , the picker will show on textbox focus and icon click when used in a button group.", - "title": "allowInputToggle" - }, - { - "location": "/Options/#allowinputtoggle_1", - "text": "Returns a boolean variable with the currently set options.allowInputToggle option.", - "title": "allowInputToggle" - }, - { - "location": "/Options/#allowinputtoggle-boolean", - "text": "Takes a boolean value. If true , the picker will show on textbox focus and icon click when used in a button group", - "title": "allowInputToggle, [boolean]" - }, - { - "location": "/Options/#focusonshow", - "text": "Default: true If false , the textbox will not be given focus when the picker is shown.", - "title": "focusOnShow" - }, - { - "location": "/Options/#focusonshow_1", - "text": "Returns a boolean variable with the currently set options.focusOnShow option.", - "title": "focusOnShow" - }, - { - "location": "/Options/#focusonshow-boolean", - "text": "Takes a boolean value. If false , the textbox will not be given focus when the picker is shown", - "title": "focusOnShow, [boolean]" - }, - { - "location": "/Options/#endisabledhours", - "text": "Default: false", - "title": "en/disabledHours" - }, - { - "location": "/Options/#disabledhours", - "text": "Returns an array variable with the currently set options.en/disabledHours option.", - "title": "disabledHours" - }, - { - "location": "/Options/#disabledhours-boolean", - "text": "Takes a array value. Must be in 24 hour format. Will allow or disallow hour selections (much like disabledTimeIntervals ) but will affect all days. Like en/disabledDates , these options are mutually exclusive and will reset one of the options back to false. disabledHours: [0, 1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24]\nenabledHours: [9, 10, 11, 12, 13, 14, 15, 16]", - "title": "disabledHours, boolean" - }, - { - "location": "/Options/#viewdate", - "text": "Default: false This will change the viewDate without changing or setting the selected date.", - "title": "viewDate" - }, - { - "location": "/Options/#parseinputdate", - "text": "", - "title": "parseInputDate" - }, - { - "location": "/Options/#parseinputdate_1", - "text": "Returns a function with the currently set options.parseInputDate", - "title": "parseInputDate" - }, - { - "location": "/Options/#parseinputdate-function", - "text": "Takes a function Allows custom input formatting For example: the user can enter 'yesterday' or '30 days ago. Example: var parseRelativeDate = function(relativeDate) {\n\n switch (relativeDate) {\n case 'today':\n return moment()\n case 'yesterday':\n return moment().subtract(1, 'day');\n default:\n return moment()\n .subtract(Number(relativeDate.replace( days ago , ).trim()), 'days');\n }\n}\n\nvar parseInputDate = function(inputDate) {\n var relativeDatePattern = /today|yesterday|[0-9]+\\s+(days ago)/,\n resultDate;\n\n if (moment.isMoment(inputDate) || inputDate instanceof Date) {\n resultDate = moment(inputDate);\n } else {\n var relativeDate = inputDate.match(relativeDatePattern),\n parseDate = null;\n\n if (relativeDate !== null) \n parseDate = this.parseRelativeDate(inputDate.match(relativeDatePattern)[0]);\n else \n parseDate = moment();\n\n resultDate = moment(parseDate, YYYY-MM-DD );\n }\n\n return resultDate;\n}", - "title": "parseInputDate, [function]" - }, - { - "location": "/Options/#tooltips", - "text": "tooltips: {\n today: 'Go to today',\n clear: 'Clear selection',\n close: 'Close the picker',\n selectMonth: 'Select Month',\n prevMonth: 'Previous Month',\n nextMonth: 'Next Month',\n selectYear: 'Select Year',\n prevYear: 'Previous Year',\n nextYear: 'Next Year',\n selectDecade: 'Select Decade',\n prevDecade: 'Previous Decade',\n nextDecade: 'Next Decade',\n prevCentury: 'Previous Century',\n nextCentury: 'Next Century'\n} This will change the tooltips over each icon to a custom string.", - "title": "tooltips" - }, - { - "location": "/Options/#tooltips_1", - "text": "Returns an Ojbect of options.tooltips", - "title": "tooltips" - }, - { - "location": "/Options/#tooltips-tooltips", - "text": "Takes an Ojbect of strings .", - "title": "tooltips, [tooltips]" - }, - { - "location": "/Options/#throws_7", - "text": "TypeError - if tooltips parameter is not an Ojbect", - "title": "Throws" - }, - { - "location": "/Options/#timezone", - "text": "timeZone: '' Allows the setting of the Time Zone. You must include moment-timezone.js and moment-timzone data. See moment timezone documentation for usage.", - "title": "timeZone" - }, - { - "location": "/Options/#timezone_1", - "text": "Returns an string of options.timeZone", - "title": "timeZone" - }, - { - "location": "/Options/#timezone-timezone", - "text": "Takes an string of a valid timezone.", - "title": "timeZone, [timeZone]" - }, - { - "location": "/Options/#throws_8", - "text": "TypeError - if tooltips parameter is not an string", - "title": "Throws" - }, - { - "location": "/Events/", - "text": "Events\n\n\nhide.datetimepicker\n\n\nFired when the widget is hidden.\n\n\nParameters:\n\n\ne = {\n date //the currently set date. Type: moment object (clone)\n}\n\n\n\n\nEmitted from:\n\n\n\n\ntoggle()\n\n\nhide()\n\n\ndisable()\n\n\n\n\n\n\nshow.datetimepicker\n\n\nFired when the widget is shown.\n\n\nParameters:\n\n\nNo parameters are include, listen to \nchange.datetimepicker\n instead\n\n\nEmitted from:\n\n\n\n\ntoggle()\n\n\nshow()\n\n\n\n\n\n\nchange.datetimepicker\n\n\nFired when the date is changed, including when changed to a non-date (e.g. When keepInvalid=true).\n\n\nParameters:\n\n\ne = {\n date, //date the picker changed to. Type: moment object (clone)\n oldDate //previous date. Type: moment object (clone) or false in the event of a null\n}\n\n\n\n\nEmitted from:\n\n\n\n\ntoggle() \nNote\n: Only fired when using \nuseCurrent\n\n\nshow() \nNote\n: Only fired when using \nuseCurrent\n or when or the date is changed to comply with date rules (min/max etc)\n\n\ndate(newDate)\n\n\nminDate(minDate)\n\n\nmaxDate(maxDate)\n\n\ndaysOfWeekDisabled()\n\n\n\n\n\n\nerror.datetimepicker\n\n\nFired when a selected date fails to pass validation.\n\n\nParameters:\n\n\ne = {\n date //the invalid date. Type: moment object (clone)\n oldDate //previous date. Type: moment object (clone) or false in the event of a null\n}\n\n\n\n\nEmmited from:\n\n\n\n\nminDate(minDate)\n\n\nmaxDate(maxDate)\n\n\ndaysOfWeekDisabled()\n\n\nsetValue() \nprivate function\n\n\n\n\n\n\nupdate.datetimepicker\n\n\nFired (in most cases) when the \nviewDate\n changes. E.g. Next and Previous buttons, selecting a year.\n\n\nParameters:\n\n\ne = {\n change, //Change type as a momentjs format token. Type: string e.g. yyyy on year change\n viewDate //new viewDate. Type: moment object\n}", - "title": "Events" - }, - { - "location": "/Events/#events", - "text": "", - "title": "Events" - }, - { - "location": "/Events/#hidedatetimepicker", - "text": "Fired when the widget is hidden. Parameters: e = {\n date //the currently set date. Type: moment object (clone)\n} Emitted from: toggle() hide() disable()", - "title": "hide.datetimepicker" - }, - { - "location": "/Events/#showdatetimepicker", - "text": "Fired when the widget is shown. Parameters: No parameters are include, listen to change.datetimepicker instead Emitted from: toggle() show()", - "title": "show.datetimepicker" - }, - { - "location": "/Events/#changedatetimepicker", - "text": "Fired when the date is changed, including when changed to a non-date (e.g. When keepInvalid=true). Parameters: e = {\n date, //date the picker changed to. Type: moment object (clone)\n oldDate //previous date. Type: moment object (clone) or false in the event of a null\n} Emitted from: toggle() Note : Only fired when using useCurrent show() Note : Only fired when using useCurrent or when or the date is changed to comply with date rules (min/max etc) date(newDate) minDate(minDate) maxDate(maxDate) daysOfWeekDisabled()", - "title": "change.datetimepicker" - }, - { - "location": "/Events/#errordatetimepicker", - "text": "Fired when a selected date fails to pass validation. Parameters: e = {\n date //the invalid date. Type: moment object (clone)\n oldDate //previous date. Type: moment object (clone) or false in the event of a null\n} Emmited from: minDate(minDate) maxDate(maxDate) daysOfWeekDisabled() setValue() private function", - "title": "error.datetimepicker" - }, - { - "location": "/Events/#updatedatetimepicker", - "text": "Fired (in most cases) when the viewDate changes. E.g. Next and Previous buttons, selecting a year. Parameters: e = {\n change, //Change type as a momentjs format token. Type: string e.g. yyyy on year change\n viewDate //new viewDate. Type: moment object\n}", - "title": "update.datetimepicker" - }, - { - "location": "/Changelog/", - "text": "Version 5\n\n\n5.0.0-alpha\n\n\nNew Features\n\n\n\n\nES6 rewrite\n\n\nStripped UI/UX related code and shunted it into its own module\n\n\nMore configuration based setup\n\n\nBootstrap 4-esk plugin creation style\n\n\nAll events are namespaced properly \n{event}.datetimepicker\n\n\nAdded a jquery no conflict option\n\n\n\n\nOther changes\n\n\n\n\nmoved \nshowTodayButton\n, \nshowClear\n and \nshowClose\n into \noptions.buttons", - "title": "Change Log" - }, - { - "location": "/Changelog/#version-5", - "text": "", - "title": "Version 5" - }, - { - "location": "/Changelog/#500-alpha", - "text": "", - "title": "5.0.0-alpha" - }, - { - "location": "/Changelog/#new-features", - "text": "ES6 rewrite Stripped UI/UX related code and shunted it into its own module More configuration based setup Bootstrap 4-esk plugin creation style All events are namespaced properly {event}.datetimepicker Added a jquery no conflict option", - "title": "New Features" - }, - { - "location": "/Changelog/#other-changes", - "text": "moved showTodayButton , showClear and showClose into options.buttons", - "title": "Other changes" - }, - { - "location": "/ContributorsGuide/", - "text": "This guide is aimed to contributors wishing to understand the internals of the code in order to change/evolve the component. \n\n\nNote:\n this guide refers to \nversion 5\n which is currently in alpha and will be updated as we progress\n\n\nIntroduction\n\n\nThis component consists actually of 2 subcomponent UI widgets one for the date and one for the time selection process. The developers can configure which of those are needed and also the granularity that the component will allow the users to select a date/time. Developers also choose the format that the selected date/time will be displayed in the input field.\nThe component uses on \njQuery\n, \nmoment.js\n libraries.\n\n\nCode\n\n\nPrivate variables\n\n\n\n\n\n\nelement\n - Holds the DOM element this instance is attached to\n\n\n\n\n\n\noptions\n - Holds an object with the currently set options for the specific instance of the component. Don't directly change the properties of that object use the public API methods instead. DO NOT expose this object or its properties outside of the component.\n\n\n\n\n\n\ndate\n - Holds the moment object for the model value of the component. \nDON'T\n directly change this variable unless you \nREALLY\n know what you are doing. Use \nsetValue()\n function to set it. It handles all component logic for updating the model value and emitting all the appropriate events\n\n\n\n\n\n\nviewDate\n - Holds the currently selected value that the user has selected through the widget. This is not the model value this is the view value. Changing this usually requires a subsequent call to \nupdate()\n function\n\n\n\n\n\n\nunset\n - A \nboolean\n variable that holds whether the components model value is set or not. Model's value starts as \nunset = true\n and if is either set by the user or programmatically through the api to a valid value then it is set to \nfalse\n. If subsequent events lead to an invalid value then this variable is set to \ntrue\n again. Setting this variable usually takes place in the \nsetValue()\n function.\n\n\n\n\n\n\ninput\n - Hold the DOM input element this instance is attached to\n\n\n\n\n\n\ncomponent\n - Holds a reference to the .input-group DOM element that the widget is attached or false if it is attached directly on an input field\n\n\n\n\n\n\nwidget\n - Holds a reference to the DOM element containing the widget or \nfalse\n if the widget is hidden\n\n\n\n\n\n\nuse24hours\n - Holds whether the component uses 24 hours format or not. This is initialized on the \nformat()\n function\n\n\n\n\n\n\nminViewModeNumber\n - Holds the Numeric equivalent of the options.minViewMode parameter\n\n\n\n\n\n\nformat\n - Holds the current format string that is used for formatting the date model value. Note this is not the same thing as the \noptions.format\n as the second could be set to \nfalse\n in which case the first takes the locale's \nL\n or \nLT\n value\n\n\n\n\n\n\ncurrentViewMode\n - Hold the state of the current viewMode for the DatePicker subcomponent\n\n\n\n\n\n\ndatePickerModes\n - An array of objects with configuration parameters for the different views of the DatePicker subcomponent\n\n\n\n\n\n\nviewModes\n - An array of strings containing all the possible strings that \noptions.viewMode\n can take through \nviewMode()\n public api function\n\n\n\n\n\n\ndirectionModes\n - An array of strings containing all the possible strings that \noptions.direction\n can take through \ndirection()\n public api function\n\n\n\n\n\n\norientationModes\n - An array of strings containing all the possible strings that \noptions.orientation\n can take through \norientation()\n public api function\n\n\n\n\n\n\nPrivate functions\n\n\nEvents related\n\n\n\n\n\n\nnotifyEvent(e)\n - Use this function when you want to send en event to listener this could be used as a filter later\n\n\n\n\n\n\nstopEvent(e)\n - Shortcut for stopping propagation of events\n\n\n\n\n\n\nkeydown(e)\n - Function to trap \n\n\n\n\n\n\nchange(e)\n - Listener function to track change events occurring on the \ninput\n dom element the component is attached to\n\n\n\n\n\n\nattachDatePickerElementEvents()\n - Attaches listeners to the existing DOM elements the component is attached to. Called upon construction of each datetimepicker instance\n\n\n\n\n\n\ndetachDatePickerElementEvents()\n - Detaches listeners from the DOM element the component is attached to. Called on \ndestroy()\n\n\n\n\n\n\nattachDatePickerWidgetEvents()\n - Attaches listeners on the components widget. Called on \nshow()\n\n\n\n\n\n\ndetachDatePickerWidgetEvents()\n - Detaches listeners on the components widget. Called on \nhide()\n\n\n\n\n\n\nModel related\n\n\n\n\n\n\nsetValue(targetMoment)\n - Sets the model value of the component takes a moment object. An \nerror\n event will be emmited if the \ntargetMoment\n does not pass the configured validations. Otherwise the \ndate\n variable will be set and the relevant events will be fired.\n\n\n\n\n\n\nisValid(targetMoment, granularity)\n - returns \ntrue\n if the \ntargetMoment\n moment object is valid according to the components set validation rules (\nmin/maxDates\n, \ndisabled/enabledDates\n and \ndaysOfWeekDisabled\n). You may pass a second variable to check only up the the specific granularity \nyear, month, day, hour, minute, second\n\n\n\n\n\n\nUtilities\n\n\n\n\n\n\nindexGivenDates (givenDatesArray)\n - Function that takes the array from \nenabledDates()\n and \ndisabledDates()\n public functions and stores them as object keys to enable quick lookup\n\n\n\n\n\n\nisInEnableDates(date)\n - Checks whether if the given moment object exists in the \noptions.enabledDates\n object\n\n\n\n\n\n\nisInDisableDates(date)\n - Checks whether if the given moment object exists in the \noptions.disabledDates\n array\n\n\n\n\n\n\ndataToOptions()\n - Parses \ndata-date-*\n options set on the input dom element the component is attached to and returns an object with them\n\n\n\n\n\n\nisInFixed()\n - Checks if the dom element or its parents has a fixed position css rule.\n\n\n\n\n\n\nparseInputDate(date)\n - Parses a date parameter with moment using the component's \noptions.format\n and \noptions.useStrict\n. It returns a \nmoment\n object or false if \nparsedMoment#isValid()\n returns \nfalse\n. Use this to parse date inputs from outside the component (public API calls).\n\n\n\n\n\n\ninit()\n - Initializes the component. Called when the component instance is created", - "title": "Dev Guide" - }, - { - "location": "/ContributorsGuide/#introduction", - "text": "This component consists actually of 2 subcomponent UI widgets one for the date and one for the time selection process. The developers can configure which of those are needed and also the granularity that the component will allow the users to select a date/time. Developers also choose the format that the selected date/time will be displayed in the input field.\nThe component uses on jQuery , moment.js libraries.", - "title": "Introduction" - }, - { - "location": "/ContributorsGuide/#code", - "text": "", - "title": "Code" - }, - { - "location": "/ContributorsGuide/#private-variables", - "text": "element - Holds the DOM element this instance is attached to options - Holds an object with the currently set options for the specific instance of the component. Don't directly change the properties of that object use the public API methods instead. DO NOT expose this object or its properties outside of the component. date - Holds the moment object for the model value of the component. DON'T directly change this variable unless you REALLY know what you are doing. Use setValue() function to set it. It handles all component logic for updating the model value and emitting all the appropriate events viewDate - Holds the currently selected value that the user has selected through the widget. This is not the model value this is the view value. Changing this usually requires a subsequent call to update() function unset - A boolean variable that holds whether the components model value is set or not. Model's value starts as unset = true and if is either set by the user or programmatically through the api to a valid value then it is set to false . If subsequent events lead to an invalid value then this variable is set to true again. Setting this variable usually takes place in the setValue() function. input - Hold the DOM input element this instance is attached to component - Holds a reference to the .input-group DOM element that the widget is attached or false if it is attached directly on an input field widget - Holds a reference to the DOM element containing the widget or false if the widget is hidden use24hours - Holds whether the component uses 24 hours format or not. This is initialized on the format() function minViewModeNumber - Holds the Numeric equivalent of the options.minViewMode parameter format - Holds the current format string that is used for formatting the date model value. Note this is not the same thing as the options.format as the second could be set to false in which case the first takes the locale's L or LT value currentViewMode - Hold the state of the current viewMode for the DatePicker subcomponent datePickerModes - An array of objects with configuration parameters for the different views of the DatePicker subcomponent viewModes - An array of strings containing all the possible strings that options.viewMode can take through viewMode() public api function directionModes - An array of strings containing all the possible strings that options.direction can take through direction() public api function orientationModes - An array of strings containing all the possible strings that options.orientation can take through orientation() public api function", - "title": "Private variables" - }, - { - "location": "/ContributorsGuide/#private-functions", - "text": "", - "title": "Private functions" - }, - { - "location": "/ContributorsGuide/#events-related", - "text": "notifyEvent(e) - Use this function when you want to send en event to listener this could be used as a filter later stopEvent(e) - Shortcut for stopping propagation of events keydown(e) - Function to trap change(e) - Listener function to track change events occurring on the input dom element the component is attached to attachDatePickerElementEvents() - Attaches listeners to the existing DOM elements the component is attached to. Called upon construction of each datetimepicker instance detachDatePickerElementEvents() - Detaches listeners from the DOM element the component is attached to. Called on destroy() attachDatePickerWidgetEvents() - Attaches listeners on the components widget. Called on show() detachDatePickerWidgetEvents() - Detaches listeners on the components widget. Called on hide()", - "title": "Events related" - }, - { - "location": "/ContributorsGuide/#model-related", - "text": "setValue(targetMoment) - Sets the model value of the component takes a moment object. An error event will be emmited if the targetMoment does not pass the configured validations. Otherwise the date variable will be set and the relevant events will be fired. isValid(targetMoment, granularity) - returns true if the targetMoment moment object is valid according to the components set validation rules ( min/maxDates , disabled/enabledDates and daysOfWeekDisabled ). You may pass a second variable to check only up the the specific granularity year, month, day, hour, minute, second", - "title": "Model related" - }, - { - "location": "/ContributorsGuide/#utilities", - "text": "indexGivenDates (givenDatesArray) - Function that takes the array from enabledDates() and disabledDates() public functions and stores them as object keys to enable quick lookup isInEnableDates(date) - Checks whether if the given moment object exists in the options.enabledDates object isInDisableDates(date) - Checks whether if the given moment object exists in the options.disabledDates array dataToOptions() - Parses data-date-* options set on the input dom element the component is attached to and returns an object with them isInFixed() - Checks if the dom element or its parents has a fixed position css rule. parseInputDate(date) - Parses a date parameter with moment using the component's options.format and options.useStrict . It returns a moment object or false if parsedMoment#isValid() returns false . Use this to parse date inputs from outside the component (public API calls). init() - Initializes the component. Called when the component instance is created", - "title": "Utilities" - }, - { - "location": "/Extras/", - "text": "Extras\n\n\nGuides for making the picker work better with rails, IE, etc. \nNote:\n I have no idea if these guides still apply for v5 or not.\n\n\nRails 3\n\n\nby \ndhulihan\n\n\nYou can easily override the default rails form helpers (\ndate_select\n and \ndatetime_select\n) with bootstrap-datetimepicker for a much nicer experience. \n\n\n# Add to config/initializers/form.rb or the end of app/helpers/application_helper.rb\nmodule ActionView\n module Helpers\n class FormBuilder \n def date_select(method, options = {}, html_options = {})\n existing_date = @object.send(method) \n formatted_date = existing_date.to_date.strftime(\n%F\n) if existing_date.present?\n @template.content_tag(:div, :class =\n \ninput-group\n) do \n text_field(method, :value =\n formatted_date, :class =\n \nform-control datepicker\n, :\ndata-date-format\n =\n \nYYYY-MM-DD\n) +\n @template.content_tag(:span, @template.content_tag(:span, \n, :class =\n \nglyphicon glyphicon-calendar\n) ,:class =\n \ninput-group-addon\n)\n end\n end\n\n def datetime_select(method, options = {}, html_options = {})\n existing_time = @object.send(method) \n formatted_time = existing_time.to_time.strftime(\n%F %I:%M %p\n) if existing_time.present?\n @template.content_tag(:div, :class =\n \ninput-group\n) do \n text_field(method, :value =\n formatted_time, :class =\n \nform-control datetimepicker\n, :\ndata-date-format\n =\n \nYYYY-MM-DD hh:mm A\n) +\n @template.content_tag(:span, @template.content_tag(:span, \n, :class =\n \nglyphicon glyphicon-calendar\n) ,:class =\n \ninput-group-addon\n)\n end\n end\n end\n end\nend\n\n\n\n\nThe time format used here is ActiveRecord-friendly, which means it will be parsed correctly when passed in through \nparams\n to your record.\n\n\nThat's all there is to it! Now all of your forms that use \ndatetime_select\n or \ndate_select\n will be automatically updated:\n\n\n% form_for @post do |f| %\n\n \ndiv class=\nform-group\n\n \nlabel\nPublished At\n/label\n\n \n%= f.datetime_select :published_at %\n\n \n/div\n\n\n% end %", - "title": "Extras" - }, - { - "location": "/Extras/#extras", - "text": "Guides for making the picker work better with rails, IE, etc. Note: I have no idea if these guides still apply for v5 or not.", - "title": "Extras" - }, - { - "location": "/Extras/#rails-3", - "text": "by dhulihan You can easily override the default rails form helpers ( date_select and datetime_select ) with bootstrap-datetimepicker for a much nicer experience. # Add to config/initializers/form.rb or the end of app/helpers/application_helper.rb\nmodule ActionView\n module Helpers\n class FormBuilder \n def date_select(method, options = {}, html_options = {})\n existing_date = @object.send(method) \n formatted_date = existing_date.to_date.strftime( %F ) if existing_date.present?\n @template.content_tag(:div, :class = input-group ) do \n text_field(method, :value = formatted_date, :class = form-control datepicker , : data-date-format = YYYY-MM-DD ) +\n @template.content_tag(:span, @template.content_tag(:span, , :class = glyphicon glyphicon-calendar ) ,:class = input-group-addon )\n end\n end\n\n def datetime_select(method, options = {}, html_options = {})\n existing_time = @object.send(method) \n formatted_time = existing_time.to_time.strftime( %F %I:%M %p ) if existing_time.present?\n @template.content_tag(:div, :class = input-group ) do \n text_field(method, :value = formatted_time, :class = form-control datetimepicker , : data-date-format = YYYY-MM-DD hh:mm A ) +\n @template.content_tag(:span, @template.content_tag(:span, , :class = glyphicon glyphicon-calendar ) ,:class = input-group-addon )\n end\n end\n end\n end\nend The time format used here is ActiveRecord-friendly, which means it will be parsed correctly when passed in through params to your record. That's all there is to it! Now all of your forms that use datetime_select or date_select will be automatically updated: % form_for @post do |f| % \n div class= form-group \n label Published At /label \n %= f.datetime_select :published_at % \n /div % end %", - "title": "Rails 3" - }, - { - "location": "/FAQ/", - "text": "FAQs\n\n\nHow do I disable the date or time element\n\n\nHow do I format ...; How do I add seconds; etc.\n\n\nThe picker uses the \nformat\n option to decide what components to show. Set \nformat\n to \nLT\n, \nLTS\n or another valid \nMomentJs format string\n to display certain components\n\n\nHow do I change the language/locale\n\n\nThe picker uses MomentJs to determine the language string. You can use \nmoment-with-locales\n or you can include whatever local file you need. Set the picker's \nlocale\n option to \nde\n or whatever the locale string is.\n\n\nHow do I change the styles? The picker closes.\n\n\nSet \ndebug:true\n which will force the picker to stay open, even \nonBlur\n. You can hide the picker manually by calling \nhide()\n\n\nHow do I change the start of the week?\n\n\nStart of the week is based on the \nlocale\n provided\n. This is defined by moment's locales. If you want to change it, create your own locale file or override. \nSee moment's docs\n.\n\n\nHow I use the picker as birthday picker?\n\n\nUse the \nviewMode\n option to \n'years'", - "title": "FAQs" - }, - { - "location": "/FAQ/#faqs", - "text": "", - "title": "FAQs" - }, - { - "location": "/FAQ/#how-do-i-disable-the-date-or-time-element", - "text": "How do I format ...; How do I add seconds; etc. The picker uses the format option to decide what components to show. Set format to LT , LTS or another valid MomentJs format string to display certain components", - "title": "How do I disable the date or time element" - }, - { - "location": "/FAQ/#how-do-i-change-the-languagelocale", - "text": "The picker uses MomentJs to determine the language string. You can use moment-with-locales or you can include whatever local file you need. Set the picker's locale option to de or whatever the locale string is.", - "title": "How do I change the language/locale" - }, - { - "location": "/FAQ/#how-do-i-change-the-styles-the-picker-closes", - "text": "Set debug:true which will force the picker to stay open, even onBlur . You can hide the picker manually by calling hide()", - "title": "How do I change the styles? The picker closes." - }, - { - "location": "/FAQ/#how-do-i-change-the-start-of-the-week", - "text": "Start of the week is based on the locale provided . This is defined by moment's locales. If you want to change it, create your own locale file or override. See moment's docs .", - "title": "How do I change the start of the week?" - }, - { - "location": "/FAQ/#how-i-use-the-picker-as-birthday-picker", - "text": "Use the viewMode option to 'years'", - "title": "How I use the picker as birthday picker?" - } - ] + "docs": [ + { + "location": "/", + "text": "Tempus Dominus - Core v5 Docs\n\n\n\n \nNote\n\n All functions are accessed via the \ndata\n attribute e.g. \n$('#datetimepicker').datetimepicker(FUNCTION)\n\n\n\n\n\nUnderstanding \"Core\"\n\n\nThese documents represent the functions and options specif to the Core module. Each UI module should contain these docs and their own code examples and requirements.\n\n\nUnless you are interested in developing your own UI module you should refer to the docs for the UI module you're using.", + "title": "Home" + }, + { + "location": "/#tempus-dominus-core-v5-docs", + "text": "Note \n All functions are accessed via the data attribute e.g. $('#datetimepicker').datetimepicker(FUNCTION)", + "title": "Tempus Dominus - Core v5 Docs" + }, + { + "location": "/#understanding-core", + "text": "These documents represent the functions and options specif to the Core module. Each UI module should contain these docs and their own code examples and requirements. Unless you are interested in developing your own UI module you should refer to the docs for the UI module you're using.", + "title": "Understanding \"Core\"" + }, + { + "location": "/Installing/", + "text": "Minimal Requirements\n\n\n\n\njQuery\n\n\nMoment.js\n\n\nLocales: Moment's locale files are \nhere\n\n\n\n\nInstallation Guides\n\n\n\n\nCDN\n\n\nBower\n\n\nNuget\n\n\nRails\n\n\nAngular\n\n\nMeteor.js\n\n\nManual\n\n\n\n\nCDN\n\n\nhead\n\n \nscript type=\ntext/javascript\n src=\nhttps://cdnjs.com/libraries/[fill-in].js\n/script\n\n\n/head\n\n\n\n\n\nbower\n \n\n\nRun the following command:\n\n\nbower install tempusdominus#latest --save\n\n\n\n\nInclude necessary scripts and styles:\n\n\nhead\n\n \n!-- ... --\n\n \nscript type=\ntext/javascript\n src=\n/bower_components/jquery/jquery.min.js\n/script\n\n \nscript type=\ntext/javascript\n src=\n/bower_components/moment/min/moment.min.js\n/script\n\n \nscript type=\ntext/javascript\n src=\n/bower_components/tempusdominus/build/js/core.min.js\n/script\n\n\n/head\n\n\n\n\n\nNuget\n\n\nCore\n: \n\n\nPM\n Install-Package Tempus.Dominus.Core\n\n\n\n\nhead\n\n \nscript type=\ntext/javascript\n src=\n/scripts/jquery.min.js\n/script\n\n \nscript type=\ntext/javascript\n src=\n/scripts/moment.min.js\n/script\n\n \nscript type=\ntext/javascript\n src=\n/scripts/tempusdominus/core.js\n/script\n\n\n/head\n\n\n\n\n\nRails\n\n\nNeed new wrapper for this version.\n\n\nAngular Wrapper\n\n\nNeed new wrapper for this version.\n\n\nMeteor.js\n\n\nNeed new wrapper for this version.\n\n\nManual\n\n\nAcquire \njQuery\n\n\nAcquire \nMoment.js\n\n\nscript type=\ntext/javascript\n src=\n/path/to/jquery.js\n/script\n\n\nscript type=\ntext/javascript\n src=\n/path/to/moment.js\n/script\n\n\nscript type=\ntext/javascript\n src=\n/path/to/core.min.js\n/script\n\n\n\n\n\nKnockout\n\n\nNeed new wrapper for this version.", + "title": "Installing" + }, + { + "location": "/Installing/#minimal-requirements", + "text": "jQuery Moment.js Locales: Moment's locale files are here", + "title": "Minimal Requirements" + }, + { + "location": "/Installing/#installation-guides", + "text": "CDN Bower Nuget Rails Angular Meteor.js Manual", + "title": "Installation Guides" + }, + { + "location": "/Installing/#cdn", + "text": "head \n script type= text/javascript src= https://cdnjs.com/libraries/[fill-in].js /script /head", + "title": "CDN" + }, + { + "location": "/Installing/#bower", + "text": "Run the following command: bower install tempusdominus#latest --save Include necessary scripts and styles: head \n !-- ... -- \n script type= text/javascript src= /bower_components/jquery/jquery.min.js /script \n script type= text/javascript src= /bower_components/moment/min/moment.min.js /script \n script type= text/javascript src= /bower_components/tempusdominus/build/js/core.min.js /script /head", + "title": "bower" + }, + { + "location": "/Installing/#nuget", + "text": "", + "title": "Nuget" + }, + { + "location": "/Installing/#core", + "text": "PM Install-Package Tempus.Dominus.Core head \n script type= text/javascript src= /scripts/jquery.min.js /script \n script type= text/javascript src= /scripts/moment.min.js /script \n script type= text/javascript src= /scripts/tempusdominus/core.js /script /head", + "title": "Core:" + }, + { + "location": "/Installing/#rails", + "text": "Need new wrapper for this version.", + "title": "Rails" + }, + { + "location": "/Installing/#angular-wrapper", + "text": "Need new wrapper for this version.", + "title": "Angular Wrapper" + }, + { + "location": "/Installing/#meteorjs", + "text": "Need new wrapper for this version.", + "title": "Meteor.js" + }, + { + "location": "/Installing/#manual", + "text": "", + "title": "Manual" + }, + { + "location": "/Installing/#acquire-jquery", + "text": "", + "title": "Acquire jQuery" + }, + { + "location": "/Installing/#acquire-momentjs", + "text": "script type= text/javascript src= /path/to/jquery.js /script script type= text/javascript src= /path/to/moment.js /script script type= text/javascript src= /path/to/core.min.js /script", + "title": "Acquire Moment.js" + }, + { + "location": "/Installing/#knockout", + "text": "Need new wrapper for this version.", + "title": "Knockout" + }, + { + "location": "/Functions/", + "text": "Functions\n\n\n\n \nNote\n\n All functions are accessed via the \ndata\n attribute e.g. \n$('#datetimepicker').datetimepicker(FUNCTION)\n\n\n\n\n\ndestroy\n\n\nDestroys the widget and removes all attached event listeners\n\n\n\n\ntoggle\n\n\nShows or hides the widget\n\n\nEmits\n\n\n\n\n\n\nhide.datetimepicker\n - if the widget is hidden after the toggle call\n\n\n\n\n\n\nshow.datetimepicker\n - if the widget is show after the toggle call\n\n\n\n\n\n\nchange.datetimepicker\n - if the widget is opened for the first time and the input element is empty and \noptions.useCurrent != false\n\n\n\n\n\n\n\n\nshow\n\n\nShows the widget\n\n\nEmits\n\n\n\n\n\n\nshow.datetimepicker\n - if the widget was hidden before that call\n\n\n\n\n\n\nchange.datetimepicker\n - if the widget is opened for the first time and the \nuseCurrent\n is set to true or to a granularity value and the input element the component is attached to has an empty value\n\n\n\n\n\n\n\n\nhide\n\n\nHides the widget\n\n\nEmits\n\n\n\n\nhide.datetimepicker\n - if the widget was visible before that call\n\n\n\n\n\n\ndisable\n\n\nDisables the input element, the component is attached to, by adding a \ndisabled=\"true\"\n attribute to it. If the widget was visible before that call it is hidden.\n\n\nEmits\n\n\n\n\nhide.datetimepicker\n - if the widget was visible before that call\n\n\n\n\n\n\nenable\n\n\nEnables the input element, the component is attached to, by removing \ndisabled\n attribute from it.\n\n\n\n\nclear\n\n\nClears the date picker by setting the value to \nnull\n\n\n\n\nviewDate\n\n\nviewDate\n\n\nReturns a \nmoment\n variable with the currently set \noptions.viewDate\n option.\n\n\nviewDate(viewDate)\n\n\nTakes a \nstring, moment or Date\n value.\n\n\nThis will change the \nviewDate\n without changing or setting the selected date.", + "title": "Functions" + }, + { + "location": "/Functions/#functions", + "text": "Note \n All functions are accessed via the data attribute e.g. $('#datetimepicker').datetimepicker(FUNCTION)", + "title": "Functions" + }, + { + "location": "/Functions/#destroy", + "text": "Destroys the widget and removes all attached event listeners", + "title": "destroy" + }, + { + "location": "/Functions/#toggle", + "text": "Shows or hides the widget", + "title": "toggle" + }, + { + "location": "/Functions/#emits", + "text": "hide.datetimepicker - if the widget is hidden after the toggle call show.datetimepicker - if the widget is show after the toggle call change.datetimepicker - if the widget is opened for the first time and the input element is empty and options.useCurrent != false", + "title": "Emits" + }, + { + "location": "/Functions/#show", + "text": "Shows the widget", + "title": "show" + }, + { + "location": "/Functions/#emits_1", + "text": "show.datetimepicker - if the widget was hidden before that call change.datetimepicker - if the widget is opened for the first time and the useCurrent is set to true or to a granularity value and the input element the component is attached to has an empty value", + "title": "Emits" + }, + { + "location": "/Functions/#hide", + "text": "Hides the widget", + "title": "hide" + }, + { + "location": "/Functions/#emits_2", + "text": "hide.datetimepicker - if the widget was visible before that call", + "title": "Emits" + }, + { + "location": "/Functions/#disable", + "text": "Disables the input element, the component is attached to, by adding a disabled=\"true\" attribute to it. If the widget was visible before that call it is hidden.", + "title": "disable" + }, + { + "location": "/Functions/#emits_3", + "text": "hide.datetimepicker - if the widget was visible before that call", + "title": "Emits" + }, + { + "location": "/Functions/#enable", + "text": "Enables the input element, the component is attached to, by removing disabled attribute from it.", + "title": "enable" + }, + { + "location": "/Functions/#clear", + "text": "Clears the date picker by setting the value to null", + "title": "clear" + }, + { + "location": "/Functions/#viewdate", + "text": "", + "title": "viewDate" + }, + { + "location": "/Functions/#viewdate_1", + "text": "Returns a moment variable with the currently set options.viewDate option.", + "title": "viewDate" + }, + { + "location": "/Functions/#viewdateviewdate", + "text": "Takes a string, moment or Date value. This will change the viewDate without changing or setting the selected date.", + "title": "viewDate(viewDate)" + }, + { + "location": "/Options/", + "text": "Options\n\n\n\n \nNote\n\n All options are accessed via the \ndata\n attribute e.g. \n$('#datetimepicker').datetimepicker(OPTION, ARGUMENT)\n\n\n **TODO** should I move some of this to the component?\n\n\n\n\noptions\n\n\nReturns the components current options object. Note that the changing the values of the returned object does not change the components actual configuration. Use \noptions(options)\n to set the components options massively or the other methods for setting config options individually.\n\n\noptions, [options]\n\n\nTakes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component.\n\n\n\n\ndate\n\n\nReturns the component's model current date, a \nmoment\n object or \nnull\n if not set.\n\n\ndate, [newDate]\n\n\nTakes \nstring, Date, moment, null\n parameter and sets the components model current moment to it. Passing a \nnull\n value unsets the components model current moment. Parsing of the \nnewDate\n parameter is made using moment library with the \noptions.format\n and \noptions.useStrict\n components configuration.\n\n\nThrows\n\n\n\n\nTypeError\n - in case the \nnewDate\n cannot be parsed\n\n\n\n\nEmits\n\n\n\n\nchange.datetimepicker\n - In case \nnewDate\n is different from current moment\n\n\n\n\n\n\nformat\n\n\nDefault: false\n\n\n\nSee \nmomentjs' docs\n for valid formats. Format also dictates what components are shown, e.g. \nMM/dd/YYYY\n will not display the time picker.\n\n\nformat\n\n\nReturns the component's \noptions.format\n \nstring\n\n\nformat, [format]\n\n\nTakes a \nmoment.js\n format \nstring\n and sets the components \noptions.format\n. This is used for displaying and also for parsing input strings either from the input element the component is attached to or the \ndate()\n function.\nThe parameter can also be a \nboolean:false\n in which case the format is set to the locale's \nL LT\n.\n\n\nNote:\n this is also used to determine if the time picker sub component will display the hours in 12 or 24 format. (if \na\n or \nh\n exists in the passed \nstring\n then a 12 hour mode is set)\n\n\n\n\ndayViewHeaderFormat\n\n\nDefault: 'MMMM YYYY'\n\n\n\nChanges the heading of the date picker when in \"days\" view.\n\n\n\n\ndayViewHeaderFormat\n\n\nReturns a \nstring\n variable with the currently set \noptions.dayViewHeaderFormat\n option.\n\n\ndayViewHeaderFormat, [string]\n\n\nTakes a \nstring\n value.\n\n\nUsed to customize the header of the day view.\n\n\n\n\nextraFormats\n\n\nDefault: false\n\n\n\nAllows for several input formats to be valid. See \nthis PR\n.\n\n\nextraFormats\n\n\nReturns a \nboolean\n or array with the \noptions.extraFormats\n option configuration\n\n\nextraFormats, [formats]\n\n\nTakes an array of valid input moment format options.\n\n\n\n\nstepping\n\n\nDefault: 1\n\n\n\nNumber of minutes the up/down arrow's will move the minutes value in the time picker\n\n\nstepping\n\n\nReturns a \nnumber\n with the \noptions.stepping\n option configuration\n\n\nstepping, [number]\n\n\nTakes a \nnumber\n. This be the amount the up/down arrows move the minute value with a time picker.\n\n\n\n\nmin/maxDate\n\n\nDefault: false\nAccepts: date, moment, string\n\n\n\nPrevents date/time selections before this date. Will override \ndefaultDate\n and \nuseCurrent\n if either of these settings are the same day since both options are invalid according to the rules you've selected.\n\n\nminDate\n\n\nReturns the currently set moment of the \noptions.minDate\n or \nfalse\n if not set\n\n\nminDate, [minDate]\n\n\nTakes a \nminDate\n \nstring, Date, moment, boolean:false\n parameter and disallows the user to select a moment that is before that moment. If a \nboolean:false\n value is passed the \noptions.minDate\n parameter is cleared and there is no restriction to the minimum moment the user can select. \n\n\nNote:\n If the \nminDate\n parameter is after the currently selected moment the currently selected moment changes to minDate parameter\n\n\nThrows\n\n\n\n\n\n\nTypeError\n - if \nminDate\n parameter cannot be parsed using the \noptions.format\n and \noptions.useStrict\n configuration settings\n\n\n\n\n\n\nTypeError\n - if \nminDate\n parameter is after \noptions.maxDate\n\n\n\n\n\n\nEmits\n\n\n\n\n\n\nchange.datetimepicker\n - if the new \nminDate\n is after currently selected moment (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\ndp.error\n - if the new \nminDate\n is after currently selected moment (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\n\n\nmaxDate\n\n\nReturns the currently set moment of the \noptions.maxDate\n or \nfalse\n if not set\n\n\nmaxDate, [maxDate]\n\n\nTakes a [maxDate] \nstring, Date, moment, boolean:false\n parameter and disallows the user to select a moment that is after that moment. If a \nboolean:false\n value is passed \noptions.maxDate\n is cleared and there is no restriction to the maximum moment the user can select.\n\n\nNote:\n If [maxDate] is before the currently selected moment the currently selected moment changes to [maxDate]\n\n\nThrows\n\n\n\n\n\n\nTypeError\n - if \nmaxDate\n parameter cannot be parsed using the \noptions.format\n and \noptions.useStrict\n configuration settings\n\n\n\n\n\n\nTypeError\n - if \nmaxDate\n parameter is before \noptions.minDate\n\n\n\n\n\n\nEmits\n\n\n\n\n\n\nchange.datetimepicker\n - if the new \nmaxDate\n is after currently selected moment (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\ndp.error\n - if the new \nmaxDate\n is after currently selected moment (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\n\n\nuseCurrent\n\n\nDefault: true\n\n\n\nOn \nshow\n, will set the picker to the current date/time.\n\n\nuseCurrent\n\n\nReturns a \nboolean\n or \nstring\n with the \noptions.useCurrent\n option configuration\n\n\nuseCurrent, boolean or string\n\n\nTakes a \nboolean\n or \nstring\n. If a \nboolean\n true is passed and the components model moment is not set (either through \nsetDate\n or through a valid value on the input element the component is attached to) then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. If a false \nboolean\n is passed then no initialization happens on the input element. You can select the granularity on the initialized moment by passing one of the following strings (\n'year', 'month', 'day', 'hour', 'minute'\n) in the variable.\n\n\nIf for example you pass \n'day'\n to the \nsetUseCurrent\n function and the input field is empty the first time the user opens the datetimepicker widget the input text will be initialized to the current date time with day granularity (e.g. if current time = \n2014-08-10 13:32:33\n the input value will be initialized to \n2014-08-10 00:00:00\n)\n\n\nNote:\n If the \noptions.defaultDate\n is set or the input element the component is attached to has already a value that takes precedence and the functionality of \nuseCurrent\n is not triggered!\n\n\n\n\ncollapse\n\n\nDefault: true\n\n\n\nUsing a Bootstraps collapse to switch between date/time pickers.\n\n\ncollapse\n\n\nReturns a \nboolean\n of the \noptions.sideBySide\n.\n\n\ncollapse, [collapse]\n\n\nTakes a \nboolean\n. If set to \nfalse\n the picker will display similar to \nsideBySide\n except vertical.\n\n\n\n\nlocale\n\n\nDefault: moment.locale()\nAccepts: string, moment.local('locale')\n\n\n\nSee \nmomentjs\n for valid locales.\n\n\nYou must include \nmoment-with-locales.js\n or a local js file.\n\n\nlocale\n\n\nReturns the currently set locale of the \noptions.locale\n\n\nlocale, [newLocale]\n\n\nTakes a \nstring\n of any valid \nmoment locale\n e.g. \nde\n for German.\n\n\nThrows\n\n\n\n\nTypeError\n - if the locale is not loaded via a separate script or \nmoment-with-locales\n\n\n\n\n\n\ndefaultDate\n\n\nDefault: false\nAccepts: date, moment, string\n\n\n\nSets the picker default date/time. Overrides \nuseCurrent\n\n\ndefaultDate\n\n\nReturns a \nmoment\n with the \noptions.defaultDate\n option configuration or \nfalse\n if not set\n\n\ndefaultDate, [defaultDate]\n\n\nTakes a \nstring, Date, moment, boolean:false\n. Will set the picker's initial date. If a \nboolean:false\n value is passed the \noptions.defaultDate\n parameter is cleared. \n\n\n\n\n\n\nTypeError\n - if the provided date pass validation, including \ndisabledDates\n, \nenabledDates\n, \nminDate\n, \nmaxDate\n, and \ndaysOfWeekDisabled\n\n\n\n\n\n\nTypeError\n - if the provided date cannot be parsed by moment.js\n\n\n\n\n\n\n\n\nen/disabledDates\n\n\nDefault: false\nAccepts: array of [date, moment, string]\n\n\n\ndisabledDates\n\n\nReturns an array with the currently set disabled dates on the component.\n\n\ndisabledDates, [dates]\n\n\nTakes an \n[\n \nstring\n or \nDate\n or \nmoment\n \n]\n of values and disallows the user to select those days. Setting this takes precedence over \noptions.minDate\n, \noptions.maxDate\n configuration. Also calling this function removes the configuration of options.enabledDates if such exist.\n\n\nNote:\n These values are matched with \nDay\n granularity.\n\n\n\n\nenabledDates\n\n\nReturns an array with the currently set enabled dates on the component.\n\n\nenabledDates, [dates]\n\n\nTakes an \n[\n \nstring\n or \nDate\n or \nmoment\n \n]\n of values and allows the user to select only from those days. Setting this takes precedence over \noptions.minDate\n, \noptions.maxDate\n configuration. Also calling this function removes the configuration of \noptions.disabledDates\n if such exist.\n\n\nNote:\n These values are matched with \nDay\n granularity.\n\n\n\n\nicons\n\n\nDefault: {\n time: 'glyphicon glyphicon-time',\n date: 'glyphicon glyphicon-calendar',\n up: 'glyphicon glyphicon-chevron-up',\n down: 'glyphicon glyphicon-chevron-down',\n previous: 'glyphicon glyphicon-chevron-left',\n next: 'glyphicon glyphicon-chevron-right',\n today: 'glyphicon glyphicon-screenshot',\n clear: 'glyphicon glyphicon-trash',\n close: 'glyphicon glyphicon-remove'\n }\nAccepts: object with all or some of the parameters above\n\n\n\nChange the default icons for the pickers functions.\n\n\nicons\n\n\nReturns an \nOjbect\n of \noptions.icons\n \n\n\nicons, [icons]\n\n\nTakes an \nOjbect\n of \nstrings\n.\n\n\nThrows\n\n\n\n\nTypeError\n - if icons parameter is not an \nOjbect\n\n\n\n\n\n\nuseStrict\n\n\nDefault: false\n\n\n\nDefines if moment should use strict date parsing when considering a date to be valid.\n\n\nuseStrict\n\n\nReturns a \nboolean\n of the \noptions.useStrict\n\n\nuseStrict, [useStrict]\n\n\nTakes a \nboolean\n. If \nuseStrict\n is \ntrue\n, moment.js parsing rules will be stricter when determining if a date is valid or not.\n\n\n\n\nsideBySide\n\n\nDefault: false\n\n\n\nShows the picker side by side when using the time and date together.\n\n\n\n\nsideBySide\n\n\nReturns a \nboolean\n of the \noptions.sideBySide\n.\n\n\nsideBySide, [sideBySide]\n\n\nTakes a \nboolean\n. If \nsideBySide\n is \ntrue\n and the time picker is used, both components will display side by side instead of collapsing.\n\n\n\n\ndaysOfWeekDisabled\n\n\nDefault: []\nAccepts: array of numbers from 0-6\n\n\n\nDisables the section of days of the week, e.g. weekends.\n\n\ndaysOfWeekDisabled\n\n\nReturns an array with the \noptions.daysOfWeekDisabled\n configuration setting of the component.\n\n\ndaysOfWeekDisabled, [daysOfWeek]\n\n\nTakes an \n[\n \nNumber\n:\n0\n to \n6\n \n]\n and disallow the user to select weekdays that exist in this array. This has lower priority over the \noptions.minDate\n, \noptions.maxDate\n, \noptions.disabledDates\n and \noptions.enabledDates\n configuration settings.\n\n\nEmits\n\n\n\n\n\n\nchange.datetimepicker\n - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\ndp.error\n - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part)\n\n\n\n\n\n\n\n\ncalendarWeeks\n\n\nDefault: false\n\n\n\nShows the week of the year to the left of first day of the week.\n\n\n\n\ncalendarWeeks\n\n\nReturns a \nboolean\n with the current \noptions.calendarWeeks\n option configuration\n\n\ncalendarWeeks, [boolean]\n\n\nTakes a \nboolean\n variable to set if the week numbers will appear to the left on the days view\n\n\n\n\nviewMode\n\n\nDefault: 'days'\nAccepts: 'decades','years','months','days'\n\n\n\nThe default view to display when the picker is shown.\n\n\nNote\n: To limit the picker to selecting, for instance the year and month, use \nformat: MM/YYYY\n.\n\n\nviewMode\n\n\nReturns a \nstring\n of the \noptions.viewMode\n.\n\n\nviewMode, [newViewMode]\n\n\nTakes a \nstring\n. Valid values are \n'days'\n, \n'months'\n, \n'years'\n and \n'decades'\n\n\nThrows\n\n\n\n\nTypeError\n - if \nnewViewMode\n parameter is not an a \nstring\n or if \nnewViewMode\n is not a valid value.\n\n\n\n\n\n\ntoolbarPlacement\n\n\nDefault: 'default'\nAccepts: 'default', 'top', 'bottom'\n\n\n\nChanges the placement of the icon toolbar.\n\n\n\n\ntoolbarplacement\n\n\nReturns a \nstring\n variable with the currently set \noptions.toolbarplacement\n option.\n\n\ntoolbarplacement, [string]\n\n\nTakes a \nstring\n value. Valid values are \n'default'\n, \n'top'\n and \n'bottom'\n.\n\n\nChanges the placement of the toolbar where the today, clear, component switch icon are located.\n\n\n\n\nbuttons\n\n\nDefault: {\n showToday: false,\n showClear: false,\n showClose: false\n }\nAccepts: object with all or some of the parameters above\n\n\n\nChange the default toolbar buttons for the pickers functions.\n\n\nbuttons\n\n\nReturns an \nOjbect\n of \noptions.buttons\n \n\n\nbuttons, [buttons]\n\n\nTakes an \nOjbect\n of \nboolean\n.\n\n\nThrows\n\n\n\n\nTypeError\n - if buttons parameter is not an \nOjbect\n\n\n\n\n\n\nwidgetPositioning\n\n\nDefault: {\n horizontal: 'auto'\n vertical: 'auto'\n }\nAccepts: object with the all or one of the parameters above\n horizontal: 'auto', 'left', 'right'\n vertical: 'auto', 'top', 'bottom'\n\n\n\nwidgetPositioning\n\n\nReturns the currently set \noptions.widgetPositioning\n object containing two keys \nhorizontal\n and \nvertical\n\n\nwidgetPositioning, [positioningObject]\n\n\nTakes an object parameter that can contain two keys \nvertical\n and \nhorizontal\n each having a value of \n'auto', 'top', 'bottom'\n for \nvertical\n and \n'auto', 'left', 'right'\n for \nhorizontal\n which defines where the dropdown with the widget will appear relative to the input element the component is attached to.\n\n\n'auto'\n is the default value for both \nhorizontal\n and \nvertical\n keys and it tries to automatically place the dropdown in a position that is visible to the user. Usually you should not override those options unless you have a special need in your layout.\n\n\n\n\nwidgetParent\n\n\nDefault: null\nAccepts: string or jQuery object\n\n\n\nOn picker show, places the widget at the identifier (string) or jQuery object \nif\n the element has css \nposition: 'relative'\n\n\nwidgetParent\n\n\nReturns a \n$(element)\n variable with the currently set \noptions.widgetParent\n option.\n\n\nwidgetParent, [widgetParent]\n\n\nTakes a \nstring\n or \n$(element)\n value.\n\n\n\n\nkeepOpen\n\n\nDefault: false\n\n\n\nWill cause the date picker to stay open after selecting a date.\n\n\nkeepOpen\n\n\nReturns a \nboolean\n variable with the currently set \noptions.keepOpen\n option.\n\n\nkeepOpen, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\n\n\ninline\n\n\nDefault: false\n\n\n\nWill display the picker inline without the need of a input field. This will also hide borders and shadows.\n\n\ninline\n\n\nReturns a \nboolean\n variable with the currently set \noptions.inline\n option.\n\n\ninline, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\n\n\nkeepInvalid\n\n\n4.7.14\n\n\nDefault: false\n\n\n\nWill cause the date picker to \nnot\n revert or overwrite invalid dates.\n\n\nkeepInvalid\n\n\nReturns a \nstring\n variable with the currently set \noptions.keepInvalid\n option.\n\n\nkeepInvalid, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\nIf \ntrue\n, invalid dates will not be reverted to a previous selection or changed.\n\n\n\n\nkeyBinds\n\n\nDefault: up: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(7, 'd'));\n } else {\n this.date(this.date().clone().add(1, 'm'));\n }\n },\n down: function (widget) {\n if (!widget) {\n this.show();\n }\n else if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(7, 'd'));\n } else {\n this.date(this.date().clone().subtract(1, 'm'));\n }\n },\n 'control up': function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'y'));\n } else {\n this.date(this.date().clone().add(1, 'h'));\n }\n },\n 'control down': function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'y'));\n } else {\n this.date(this.date().clone().subtract(1, 'h'));\n }\n },\n left: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'd'));\n }\n },\n right: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'd'));\n }\n },\n pageUp: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'M'));\n }\n },\n pageDown: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'M'));\n }\n },\n enter: function () {\n this.hide();\n },\n escape: function () {\n this.hide();\n },\n 'control space': function (widget) {\n if (widget.find('.timepicker').is(':visible')) {\n widget.find('.btn[data-action=\"togglePeriod\"]').click();\n }\n },\n t: function () {\n this.date(moment());\n },\n 'delete': function () {\n this.clear();\n }\n\n\n\nAllows for custom events to fire on keyboard press.\n\n\nkeyBinds\n\n\nReturns a \nstring\n variable with the currently set \noptions.keyBinds\n option.\n\n\nkeyBinds, [object]\n\n\nTakes an \nobject\n value.\n\n\nAllows for several \nkeyBinding\n functions to be specified for ease of access or accessibility. See the options page for defaults.\n\n\n\n\ndebug\n\n\nDefault: false\n\n\n\nWill cause the date picker to stay open after a \nblur\n event.\n\n\n\n\nignoreReadonly\n\n\nDefault: false\n\n\n\nAllow date picker show event to fire even when the associated input element has the \nreadonly=\"readonly\"\n property.\n\n\nignoreReadonly\n\n\nReturns a \nboolean\n variable with the currently set \noptions.ignoreReadonly\n option.\n\n\nignoreReadonly, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\nSet this to \ntrue\n to allow the picker to be used even if the input field is \nreadonly\n. This will \nnot\n bypass the \ndisabled\n property\n\n\n\n\ndisabledTimeIntervals\n\n\nDefault: false\n\n\n\nDisables time selection between the given \nmoments\n.\n\n\ndisabledTimeIntervals\n\n\nReturns an \narray\n variable with the currently set \noptions.disabledTimeIntervals\n option.\n\n\ndisabledTimeIntervals, [array]\n\n\nTakes a \narray\n value.\n\n\nThe array \nmust\n be in the following format \n[moment(),moment()]\n\n\nFor example:\n\n\ndisabledTimeIntervals: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]]\n\n\n\nWill disable times between 12-8am and 6-12pm today\n\n\n\n\nallowInputToggle\n\n\nDefault: false\n\n\n\nIf \ntrue\n, the picker will show on textbox focus and icon click when used in a button group.\n\n\nallowInputToggle\n\n\nReturns a \nboolean\n variable with the currently set \noptions.allowInputToggle\n option.\n\n\nallowInputToggle, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\nIf \ntrue\n, the picker will show on textbox focus and icon click when used in a button group\n\n\n\n\nfocusOnShow\n\n\nDefault: true\n\n\n\nIf \nfalse\n, the textbox will not be given focus when the picker is shown.\n\n\nfocusOnShow\n\n\nReturns a \nboolean\n variable with the currently set \noptions.focusOnShow\n option.\n\n\nfocusOnShow, [boolean]\n\n\nTakes a \nboolean\n value.\n\n\nIf \nfalse\n, the textbox will not be given focus when the picker is shown\n\n\n\n\nen/disabledHours\n\n\nDefault: false\n\n\n\ndisabledHours\n\n\nReturns an \narray\n variable with the currently set \noptions.en/disabledHours\n option.\n\n\ndisabledHours, boolean\n\n\nTakes a \narray\n value.\n\n\nMust be in 24 hour format. Will allow or disallow hour selections (much like \ndisabledTimeIntervals\n) but will affect all days.\n\n\nLike \nen/disabledDates\n, these options are mutually exclusive and will reset one of the options back to false.\n\n\ndisabledHours: [0, 1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24]\nenabledHours: [9, 10, 11, 12, 13, 14, 15, 16]\n\n\n\n\n\nviewDate\n\n\nDefault: false\n\n\n\nThis will change the \nviewDate\n without changing or setting the selected date.\n\n\n\n\nparseInputDate\n\n\nparseInputDate\n\n\nReturns a \nfunction\n with the currently set \noptions.parseInputDate\n\n\nparseInputDate, [function]\n\n\nTakes a \nfunction\n\n\nAllows custom input formatting For example: the user can enter 'yesterday' or '30 days ago.\n\n\nExample:\n\n\nvar parseRelativeDate = function(relativeDate) {\n\n switch (relativeDate) {\n case 'today':\n return moment()\n case 'yesterday':\n return moment().subtract(1, 'day');\n default:\n return moment()\n .subtract(Number(relativeDate.replace(\ndays ago\n, \n).trim()), 'days');\n }\n}\n\nvar parseInputDate = function(inputDate) {\n var relativeDatePattern = /today|yesterday|[0-9]+\\s+(days ago)/,\n resultDate;\n\n if (moment.isMoment(inputDate) || inputDate instanceof Date) {\n resultDate = moment(inputDate);\n } else {\n var relativeDate = inputDate.match(relativeDatePattern),\n parseDate = null;\n\n if (relativeDate !== null) \n parseDate = this.parseRelativeDate(inputDate.match(relativeDatePattern)[0]);\n else \n parseDate = moment();\n\n resultDate = moment(parseDate, \nYYYY-MM-DD\n);\n }\n\n return resultDate;\n}\n\n\n\n\n\n\ntooltips\n\n\ntooltips: {\n today: 'Go to today',\n clear: 'Clear selection',\n close: 'Close the picker',\n selectMonth: 'Select Month',\n prevMonth: 'Previous Month',\n nextMonth: 'Next Month',\n selectYear: 'Select Year',\n prevYear: 'Previous Year',\n nextYear: 'Next Year',\n selectDecade: 'Select Decade',\n prevDecade: 'Previous Decade',\n nextDecade: 'Next Decade',\n prevCentury: 'Previous Century',\n nextCentury: 'Next Century'\n}\n\n\n\n\nThis will change the \ntooltips\n over each icon to a custom string.\n\n\ntooltips\n\n\nReturns an \nOjbect\n of \noptions.tooltips\n \n\n\ntooltips, [tooltips]\n\n\nTakes an \nOjbect\n of \nstrings\n.\n\n\nThrows\n\n\n\n\nTypeError\n - if \ntooltips\n parameter is not an \nOjbect\n\n\n\n\n\n\ntimeZone\n\n\ntimeZone: ''\n\n\n\nAllows the setting of the Time Zone. You must include \nmoment-timezone.js\n and \nmoment-timzone\n data. See moment timezone documentation for usage.\n\n\ntimeZone\n\n\nReturns an \nstring\n of \noptions.timeZone\n \n\n\ntimeZone, [timeZone]\n\n\nTakes an \nstring\n of a valid timezone.\n\n\nThrows\n\n\n\n\nTypeError\n - if \ntooltips\n parameter is not an \nstring", + "title": "Options" + }, + { + "location": "/Options/#options", + "text": "Note \n All options are accessed via the data attribute e.g. $('#datetimepicker').datetimepicker(OPTION, ARGUMENT) \n\n **TODO** should I move some of this to the component?", + "title": "Options" + }, + { + "location": "/Options/#options_1", + "text": "Returns the components current options object. Note that the changing the values of the returned object does not change the components actual configuration. Use options(options) to set the components options massively or the other methods for setting config options individually.", + "title": "options" + }, + { + "location": "/Options/#options-options", + "text": "Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component.", + "title": "options, [options]" + }, + { + "location": "/Options/#date", + "text": "Returns the component's model current date, a moment object or null if not set.", + "title": "date" + }, + { + "location": "/Options/#date-newdate", + "text": "Takes string, Date, moment, null parameter and sets the components model current moment to it. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.", + "title": "date, [newDate]" + }, + { + "location": "/Options/#throws", + "text": "TypeError - in case the newDate cannot be parsed", + "title": "Throws" + }, + { + "location": "/Options/#emits", + "text": "change.datetimepicker - In case newDate is different from current moment", + "title": "Emits" + }, + { + "location": "/Options/#format", + "text": "Default: false See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker.", + "title": "format" + }, + { + "location": "/Options/#format_1", + "text": "Returns the component's options.format string", + "title": "format" + }, + { + "location": "/Options/#format-format", + "text": "Takes a moment.js format string and sets the components options.format . This is used for displaying and also for parsing input strings either from the input element the component is attached to or the date() function.\nThe parameter can also be a boolean:false in which case the format is set to the locale's L LT . Note: this is also used to determine if the time picker sub component will display the hours in 12 or 24 format. (if a or h exists in the passed string then a 12 hour mode is set)", + "title": "format, [format]" + }, + { + "location": "/Options/#dayviewheaderformat", + "text": "Default: 'MMMM YYYY' Changes the heading of the date picker when in \"days\" view.", + "title": "dayViewHeaderFormat" + }, + { + "location": "/Options/#dayviewheaderformat_1", + "text": "Returns a string variable with the currently set options.dayViewHeaderFormat option.", + "title": "dayViewHeaderFormat" + }, + { + "location": "/Options/#dayviewheaderformat-string", + "text": "Takes a string value. Used to customize the header of the day view.", + "title": "dayViewHeaderFormat, [string]" + }, + { + "location": "/Options/#extraformats", + "text": "Default: false Allows for several input formats to be valid. See this PR .", + "title": "extraFormats" + }, + { + "location": "/Options/#extraformats_1", + "text": "Returns a boolean or array with the options.extraFormats option configuration", + "title": "extraFormats" + }, + { + "location": "/Options/#extraformats-formats", + "text": "Takes an array of valid input moment format options.", + "title": "extraFormats, [formats]" + }, + { + "location": "/Options/#stepping", + "text": "Default: 1 Number of minutes the up/down arrow's will move the minutes value in the time picker", + "title": "stepping" + }, + { + "location": "/Options/#stepping_1", + "text": "Returns a number with the options.stepping option configuration", + "title": "stepping" + }, + { + "location": "/Options/#stepping-number", + "text": "Takes a number . This be the amount the up/down arrows move the minute value with a time picker.", + "title": "stepping, [number]" + }, + { + "location": "/Options/#minmaxdate", + "text": "Default: false\nAccepts: date, moment, string Prevents date/time selections before this date. Will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected.", + "title": "min/maxDate" + }, + { + "location": "/Options/#mindate", + "text": "Returns the currently set moment of the options.minDate or false if not set", + "title": "minDate" + }, + { + "location": "/Options/#mindate-mindate", + "text": "Takes a minDate string, Date, moment, boolean:false parameter and disallows the user to select a moment that is before that moment. If a boolean:false value is passed the options.minDate parameter is cleared and there is no restriction to the minimum moment the user can select. Note: If the minDate parameter is after the currently selected moment the currently selected moment changes to minDate parameter", + "title": "minDate, [minDate]" + }, + { + "location": "/Options/#throws_1", + "text": "TypeError - if minDate parameter cannot be parsed using the options.format and options.useStrict configuration settings TypeError - if minDate parameter is after options.maxDate", + "title": "Throws" + }, + { + "location": "/Options/#emits_1", + "text": "change.datetimepicker - if the new minDate is after currently selected moment (waiting for #472 to close in order to finalize this part) dp.error - if the new minDate is after currently selected moment (waiting for #472 to close in order to finalize this part)", + "title": "Emits" + }, + { + "location": "/Options/#maxdate", + "text": "Returns the currently set moment of the options.maxDate or false if not set", + "title": "maxDate" + }, + { + "location": "/Options/#maxdate-maxdate", + "text": "Takes a [maxDate] string, Date, moment, boolean:false parameter and disallows the user to select a moment that is after that moment. If a boolean:false value is passed options.maxDate is cleared and there is no restriction to the maximum moment the user can select. Note: If [maxDate] is before the currently selected moment the currently selected moment changes to [maxDate]", + "title": "maxDate, [maxDate]" + }, + { + "location": "/Options/#throws_2", + "text": "TypeError - if maxDate parameter cannot be parsed using the options.format and options.useStrict configuration settings TypeError - if maxDate parameter is before options.minDate", + "title": "Throws" + }, + { + "location": "/Options/#emits_2", + "text": "change.datetimepicker - if the new maxDate is after currently selected moment (waiting for #472 to close in order to finalize this part) dp.error - if the new maxDate is after currently selected moment (waiting for #472 to close in order to finalize this part)", + "title": "Emits" + }, + { + "location": "/Options/#usecurrent", + "text": "Default: true On show , will set the picker to the current date/time.", + "title": "useCurrent" + }, + { + "location": "/Options/#usecurrent_1", + "text": "Returns a boolean or string with the options.useCurrent option configuration", + "title": "useCurrent" + }, + { + "location": "/Options/#usecurrent-boolean-or-string", + "text": "Takes a boolean or string . If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to) then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. If a false boolean is passed then no initialization happens on the input element. You can select the granularity on the initialized moment by passing one of the following strings ( 'year', 'month', 'day', 'hour', 'minute' ) in the variable. If for example you pass 'day' to the setUseCurrent function and the input field is empty the first time the user opens the datetimepicker widget the input text will be initialized to the current date time with day granularity (e.g. if current time = 2014-08-10 13:32:33 the input value will be initialized to 2014-08-10 00:00:00 ) Note: If the options.defaultDate is set or the input element the component is attached to has already a value that takes precedence and the functionality of useCurrent is not triggered!", + "title": "useCurrent, boolean or string" + }, + { + "location": "/Options/#collapse", + "text": "Default: true Using a Bootstraps collapse to switch between date/time pickers.", + "title": "collapse" + }, + { + "location": "/Options/#collapse_1", + "text": "Returns a boolean of the options.sideBySide .", + "title": "collapse" + }, + { + "location": "/Options/#collapse-collapse", + "text": "Takes a boolean . If set to false the picker will display similar to sideBySide except vertical.", + "title": "collapse, [collapse]" + }, + { + "location": "/Options/#locale", + "text": "Default: moment.locale()\nAccepts: string, moment.local('locale') See momentjs for valid locales. You must include moment-with-locales.js or a local js file.", + "title": "locale" + }, + { + "location": "/Options/#locale_1", + "text": "Returns the currently set locale of the options.locale", + "title": "locale" + }, + { + "location": "/Options/#locale-newlocale", + "text": "Takes a string of any valid moment locale e.g. de for German.", + "title": "locale, [newLocale]" + }, + { + "location": "/Options/#throws_3", + "text": "TypeError - if the locale is not loaded via a separate script or moment-with-locales", + "title": "Throws" + }, + { + "location": "/Options/#defaultdate", + "text": "Default: false\nAccepts: date, moment, string Sets the picker default date/time. Overrides useCurrent", + "title": "defaultDate" + }, + { + "location": "/Options/#defaultdate_1", + "text": "Returns a moment with the options.defaultDate option configuration or false if not set", + "title": "defaultDate" + }, + { + "location": "/Options/#defaultdate-defaultdate", + "text": "Takes a string, Date, moment, boolean:false . Will set the picker's initial date. If a boolean:false value is passed the options.defaultDate parameter is cleared. TypeError - if the provided date pass validation, including disabledDates , enabledDates , minDate , maxDate , and daysOfWeekDisabled TypeError - if the provided date cannot be parsed by moment.js", + "title": "defaultDate, [defaultDate]" + }, + { + "location": "/Options/#endisableddates", + "text": "Default: false\nAccepts: array of [date, moment, string]", + "title": "en/disabledDates" + }, + { + "location": "/Options/#disableddates", + "text": "Returns an array with the currently set disabled dates on the component.", + "title": "disabledDates" + }, + { + "location": "/Options/#disableddates-dates", + "text": "Takes an [ string or Date or moment ] of values and disallows the user to select those days. Setting this takes precedence over options.minDate , options.maxDate configuration. Also calling this function removes the configuration of options.enabledDates if such exist. Note: These values are matched with Day granularity.", + "title": "disabledDates, [dates]" + }, + { + "location": "/Options/#enableddates", + "text": "Returns an array with the currently set enabled dates on the component.", + "title": "enabledDates" + }, + { + "location": "/Options/#enableddates-dates", + "text": "Takes an [ string or Date or moment ] of values and allows the user to select only from those days. Setting this takes precedence over options.minDate , options.maxDate configuration. Also calling this function removes the configuration of options.disabledDates if such exist. Note: These values are matched with Day granularity.", + "title": "enabledDates, [dates]" + }, + { + "location": "/Options/#icons", + "text": "Default: {\n time: 'glyphicon glyphicon-time',\n date: 'glyphicon glyphicon-calendar',\n up: 'glyphicon glyphicon-chevron-up',\n down: 'glyphicon glyphicon-chevron-down',\n previous: 'glyphicon glyphicon-chevron-left',\n next: 'glyphicon glyphicon-chevron-right',\n today: 'glyphicon glyphicon-screenshot',\n clear: 'glyphicon glyphicon-trash',\n close: 'glyphicon glyphicon-remove'\n }\nAccepts: object with all or some of the parameters above Change the default icons for the pickers functions.", + "title": "icons" + }, + { + "location": "/Options/#icons_1", + "text": "Returns an Ojbect of options.icons", + "title": "icons" + }, + { + "location": "/Options/#icons-icons", + "text": "Takes an Ojbect of strings .", + "title": "icons, [icons]" + }, + { + "location": "/Options/#throws_4", + "text": "TypeError - if icons parameter is not an Ojbect", + "title": "Throws" + }, + { + "location": "/Options/#usestrict", + "text": "Default: false Defines if moment should use strict date parsing when considering a date to be valid.", + "title": "useStrict" + }, + { + "location": "/Options/#usestrict_1", + "text": "Returns a boolean of the options.useStrict", + "title": "useStrict" + }, + { + "location": "/Options/#usestrict-usestrict", + "text": "Takes a boolean . If useStrict is true , moment.js parsing rules will be stricter when determining if a date is valid or not.", + "title": "useStrict, [useStrict]" + }, + { + "location": "/Options/#sidebyside", + "text": "Default: false Shows the picker side by side when using the time and date together.", + "title": "sideBySide" + }, + { + "location": "/Options/#sidebyside_1", + "text": "Returns a boolean of the options.sideBySide .", + "title": "sideBySide" + }, + { + "location": "/Options/#sidebyside-sidebyside", + "text": "Takes a boolean . If sideBySide is true and the time picker is used, both components will display side by side instead of collapsing.", + "title": "sideBySide, [sideBySide]" + }, + { + "location": "/Options/#daysofweekdisabled", + "text": "Default: []\nAccepts: array of numbers from 0-6 Disables the section of days of the week, e.g. weekends.", + "title": "daysOfWeekDisabled" + }, + { + "location": "/Options/#daysofweekdisabled_1", + "text": "Returns an array with the options.daysOfWeekDisabled configuration setting of the component.", + "title": "daysOfWeekDisabled" + }, + { + "location": "/Options/#daysofweekdisabled-daysofweek", + "text": "Takes an [ Number : 0 to 6 ] and disallow the user to select weekdays that exist in this array. This has lower priority over the options.minDate , options.maxDate , options.disabledDates and options.enabledDates configuration settings.", + "title": "daysOfWeekDisabled, [daysOfWeek]" + }, + { + "location": "/Options/#emits_3", + "text": "change.datetimepicker - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part) dp.error - if the currently selected moment falls in the values passed on the daysOfWeek parameter. (waiting for #472 to close in order to finalize this part)", + "title": "Emits" + }, + { + "location": "/Options/#calendarweeks", + "text": "Default: false Shows the week of the year to the left of first day of the week.", + "title": "calendarWeeks" + }, + { + "location": "/Options/#calendarweeks_1", + "text": "Returns a boolean with the current options.calendarWeeks option configuration", + "title": "calendarWeeks" + }, + { + "location": "/Options/#calendarweeks-boolean", + "text": "Takes a boolean variable to set if the week numbers will appear to the left on the days view", + "title": "calendarWeeks, [boolean]" + }, + { + "location": "/Options/#viewmode", + "text": "Default: 'days'\nAccepts: 'decades','years','months','days' The default view to display when the picker is shown. Note : To limit the picker to selecting, for instance the year and month, use format: MM/YYYY .", + "title": "viewMode" + }, + { + "location": "/Options/#viewmode_1", + "text": "Returns a string of the options.viewMode .", + "title": "viewMode" + }, + { + "location": "/Options/#viewmode-newviewmode", + "text": "Takes a string . Valid values are 'days' , 'months' , 'years' and 'decades'", + "title": "viewMode, [newViewMode]" + }, + { + "location": "/Options/#throws_5", + "text": "TypeError - if newViewMode parameter is not an a string or if newViewMode is not a valid value.", + "title": "Throws" + }, + { + "location": "/Options/#toolbarplacement", + "text": "Default: 'default'\nAccepts: 'default', 'top', 'bottom' Changes the placement of the icon toolbar.", + "title": "toolbarPlacement" + }, + { + "location": "/Options/#toolbarplacement_1", + "text": "Returns a string variable with the currently set options.toolbarplacement option.", + "title": "toolbarplacement" + }, + { + "location": "/Options/#toolbarplacement-string", + "text": "Takes a string value. Valid values are 'default' , 'top' and 'bottom' . Changes the placement of the toolbar where the today, clear, component switch icon are located.", + "title": "toolbarplacement, [string]" + }, + { + "location": "/Options/#buttons", + "text": "Default: {\n showToday: false,\n showClear: false,\n showClose: false\n }\nAccepts: object with all or some of the parameters above Change the default toolbar buttons for the pickers functions.", + "title": "buttons" + }, + { + "location": "/Options/#buttons_1", + "text": "Returns an Ojbect of options.buttons", + "title": "buttons" + }, + { + "location": "/Options/#buttons-buttons", + "text": "Takes an Ojbect of boolean .", + "title": "buttons, [buttons]" + }, + { + "location": "/Options/#throws_6", + "text": "TypeError - if buttons parameter is not an Ojbect", + "title": "Throws" + }, + { + "location": "/Options/#widgetpositioning", + "text": "Default: {\n horizontal: 'auto'\n vertical: 'auto'\n }\nAccepts: object with the all or one of the parameters above\n horizontal: 'auto', 'left', 'right'\n vertical: 'auto', 'top', 'bottom'", + "title": "widgetPositioning" + }, + { + "location": "/Options/#widgetpositioning_1", + "text": "Returns the currently set options.widgetPositioning object containing two keys horizontal and vertical", + "title": "widgetPositioning" + }, + { + "location": "/Options/#widgetpositioning-positioningobject", + "text": "Takes an object parameter that can contain two keys vertical and horizontal each having a value of 'auto', 'top', 'bottom' for vertical and 'auto', 'left', 'right' for horizontal which defines where the dropdown with the widget will appear relative to the input element the component is attached to. 'auto' is the default value for both horizontal and vertical keys and it tries to automatically place the dropdown in a position that is visible to the user. Usually you should not override those options unless you have a special need in your layout.", + "title": "widgetPositioning, [positioningObject]" + }, + { + "location": "/Options/#widgetparent", + "text": "Default: null\nAccepts: string or jQuery object On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: 'relative'", + "title": "widgetParent" + }, + { + "location": "/Options/#widgetparent_1", + "text": "Returns a $(element) variable with the currently set options.widgetParent option.", + "title": "widgetParent" + }, + { + "location": "/Options/#widgetparent-widgetparent", + "text": "Takes a string or $(element) value.", + "title": "widgetParent, [widgetParent]" + }, + { + "location": "/Options/#keepopen", + "text": "Default: false Will cause the date picker to stay open after selecting a date.", + "title": "keepOpen" + }, + { + "location": "/Options/#keepopen_1", + "text": "Returns a boolean variable with the currently set options.keepOpen option.", + "title": "keepOpen" + }, + { + "location": "/Options/#keepopen-boolean", + "text": "Takes a boolean value.", + "title": "keepOpen, [boolean]" + }, + { + "location": "/Options/#inline", + "text": "Default: false Will display the picker inline without the need of a input field. This will also hide borders and shadows.", + "title": "inline" + }, + { + "location": "/Options/#inline_1", + "text": "Returns a boolean variable with the currently set options.inline option.", + "title": "inline" + }, + { + "location": "/Options/#inline-boolean", + "text": "Takes a boolean value.", + "title": "inline, [boolean]" + }, + { + "location": "/Options/#keepinvalid", + "text": "4.7.14 Default: false Will cause the date picker to not revert or overwrite invalid dates.", + "title": "keepInvalid" + }, + { + "location": "/Options/#keepinvalid_1", + "text": "Returns a string variable with the currently set options.keepInvalid option.", + "title": "keepInvalid" + }, + { + "location": "/Options/#keepinvalid-boolean", + "text": "Takes a boolean value. If true , invalid dates will not be reverted to a previous selection or changed.", + "title": "keepInvalid, [boolean]" + }, + { + "location": "/Options/#keybinds", + "text": "Default: up: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(7, 'd'));\n } else {\n this.date(this.date().clone().add(1, 'm'));\n }\n },\n down: function (widget) {\n if (!widget) {\n this.show();\n }\n else if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(7, 'd'));\n } else {\n this.date(this.date().clone().subtract(1, 'm'));\n }\n },\n 'control up': function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'y'));\n } else {\n this.date(this.date().clone().add(1, 'h'));\n }\n },\n 'control down': function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'y'));\n } else {\n this.date(this.date().clone().subtract(1, 'h'));\n }\n },\n left: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'd'));\n }\n },\n right: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'd'));\n }\n },\n pageUp: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().subtract(1, 'M'));\n }\n },\n pageDown: function (widget) {\n if (widget.find('.datepicker').is(':visible')) {\n this.date(this.date().clone().add(1, 'M'));\n }\n },\n enter: function () {\n this.hide();\n },\n escape: function () {\n this.hide();\n },\n 'control space': function (widget) {\n if (widget.find('.timepicker').is(':visible')) {\n widget.find('.btn[data-action=\"togglePeriod\"]').click();\n }\n },\n t: function () {\n this.date(moment());\n },\n 'delete': function () {\n this.clear();\n } Allows for custom events to fire on keyboard press.", + "title": "keyBinds" + }, + { + "location": "/Options/#keybinds_1", + "text": "Returns a string variable with the currently set options.keyBinds option.", + "title": "keyBinds" + }, + { + "location": "/Options/#keybinds-object", + "text": "Takes an object value. Allows for several keyBinding functions to be specified for ease of access or accessibility. See the options page for defaults.", + "title": "keyBinds, [object]" + }, + { + "location": "/Options/#debug", + "text": "Default: false Will cause the date picker to stay open after a blur event.", + "title": "debug" + }, + { + "location": "/Options/#ignorereadonly", + "text": "Default: false Allow date picker show event to fire even when the associated input element has the readonly=\"readonly\" property.", + "title": "ignoreReadonly" + }, + { + "location": "/Options/#ignorereadonly_1", + "text": "Returns a boolean variable with the currently set options.ignoreReadonly option.", + "title": "ignoreReadonly" + }, + { + "location": "/Options/#ignorereadonly-boolean", + "text": "Takes a boolean value. Set this to true to allow the picker to be used even if the input field is readonly . This will not bypass the disabled property", + "title": "ignoreReadonly, [boolean]" + }, + { + "location": "/Options/#disabledtimeintervals", + "text": "Default: false Disables time selection between the given moments .", + "title": "disabledTimeIntervals" + }, + { + "location": "/Options/#disabledtimeintervals_1", + "text": "Returns an array variable with the currently set options.disabledTimeIntervals option.", + "title": "disabledTimeIntervals" + }, + { + "location": "/Options/#disabledtimeintervals-array", + "text": "Takes a array value. The array must be in the following format [moment(),moment()] For example: disabledTimeIntervals: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] Will disable times between 12-8am and 6-12pm today", + "title": "disabledTimeIntervals, [array]" + }, + { + "location": "/Options/#allowinputtoggle", + "text": "Default: false If true , the picker will show on textbox focus and icon click when used in a button group.", + "title": "allowInputToggle" + }, + { + "location": "/Options/#allowinputtoggle_1", + "text": "Returns a boolean variable with the currently set options.allowInputToggle option.", + "title": "allowInputToggle" + }, + { + "location": "/Options/#allowinputtoggle-boolean", + "text": "Takes a boolean value. If true , the picker will show on textbox focus and icon click when used in a button group", + "title": "allowInputToggle, [boolean]" + }, + { + "location": "/Options/#focusonshow", + "text": "Default: true If false , the textbox will not be given focus when the picker is shown.", + "title": "focusOnShow" + }, + { + "location": "/Options/#focusonshow_1", + "text": "Returns a boolean variable with the currently set options.focusOnShow option.", + "title": "focusOnShow" + }, + { + "location": "/Options/#focusonshow-boolean", + "text": "Takes a boolean value. If false , the textbox will not be given focus when the picker is shown", + "title": "focusOnShow, [boolean]" + }, + { + "location": "/Options/#endisabledhours", + "text": "Default: false", + "title": "en/disabledHours" + }, + { + "location": "/Options/#disabledhours", + "text": "Returns an array variable with the currently set options.en/disabledHours option.", + "title": "disabledHours" + }, + { + "location": "/Options/#disabledhours-boolean", + "text": "Takes a array value. Must be in 24 hour format. Will allow or disallow hour selections (much like disabledTimeIntervals ) but will affect all days. Like en/disabledDates , these options are mutually exclusive and will reset one of the options back to false. disabledHours: [0, 1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24]\nenabledHours: [9, 10, 11, 12, 13, 14, 15, 16]", + "title": "disabledHours, boolean" + }, + { + "location": "/Options/#viewdate", + "text": "Default: false This will change the viewDate without changing or setting the selected date.", + "title": "viewDate" + }, + { + "location": "/Options/#parseinputdate", + "text": "", + "title": "parseInputDate" + }, + { + "location": "/Options/#parseinputdate_1", + "text": "Returns a function with the currently set options.parseInputDate", + "title": "parseInputDate" + }, + { + "location": "/Options/#parseinputdate-function", + "text": "Takes a function Allows custom input formatting For example: the user can enter 'yesterday' or '30 days ago. Example: var parseRelativeDate = function(relativeDate) {\n\n switch (relativeDate) {\n case 'today':\n return moment()\n case 'yesterday':\n return moment().subtract(1, 'day');\n default:\n return moment()\n .subtract(Number(relativeDate.replace( days ago , ).trim()), 'days');\n }\n}\n\nvar parseInputDate = function(inputDate) {\n var relativeDatePattern = /today|yesterday|[0-9]+\\s+(days ago)/,\n resultDate;\n\n if (moment.isMoment(inputDate) || inputDate instanceof Date) {\n resultDate = moment(inputDate);\n } else {\n var relativeDate = inputDate.match(relativeDatePattern),\n parseDate = null;\n\n if (relativeDate !== null) \n parseDate = this.parseRelativeDate(inputDate.match(relativeDatePattern)[0]);\n else \n parseDate = moment();\n\n resultDate = moment(parseDate, YYYY-MM-DD );\n }\n\n return resultDate;\n}", + "title": "parseInputDate, [function]" + }, + { + "location": "/Options/#tooltips", + "text": "tooltips: {\n today: 'Go to today',\n clear: 'Clear selection',\n close: 'Close the picker',\n selectMonth: 'Select Month',\n prevMonth: 'Previous Month',\n nextMonth: 'Next Month',\n selectYear: 'Select Year',\n prevYear: 'Previous Year',\n nextYear: 'Next Year',\n selectDecade: 'Select Decade',\n prevDecade: 'Previous Decade',\n nextDecade: 'Next Decade',\n prevCentury: 'Previous Century',\n nextCentury: 'Next Century'\n} This will change the tooltips over each icon to a custom string.", + "title": "tooltips" + }, + { + "location": "/Options/#tooltips_1", + "text": "Returns an Ojbect of options.tooltips", + "title": "tooltips" + }, + { + "location": "/Options/#tooltips-tooltips", + "text": "Takes an Ojbect of strings .", + "title": "tooltips, [tooltips]" + }, + { + "location": "/Options/#throws_7", + "text": "TypeError - if tooltips parameter is not an Ojbect", + "title": "Throws" + }, + { + "location": "/Options/#timezone", + "text": "timeZone: '' Allows the setting of the Time Zone. You must include moment-timezone.js and moment-timzone data. See moment timezone documentation for usage.", + "title": "timeZone" + }, + { + "location": "/Options/#timezone_1", + "text": "Returns an string of options.timeZone", + "title": "timeZone" + }, + { + "location": "/Options/#timezone-timezone", + "text": "Takes an string of a valid timezone.", + "title": "timeZone, [timeZone]" + }, + { + "location": "/Options/#throws_8", + "text": "TypeError - if tooltips parameter is not an string", + "title": "Throws" + }, + { + "location": "/Events/", + "text": "Events\n\n\nhide.datetimepicker\n\n\nFired when the widget is hidden.\n\n\nParameters:\n\n\ne = {\n date //the currently set date. Type: moment object (clone)\n}\n\n\n\n\nEmitted from:\n\n\n\n\ntoggle()\n\n\nhide()\n\n\ndisable()\n\n\n\n\n\n\nshow.datetimepicker\n\n\nFired when the widget is shown.\n\n\nParameters:\n\n\nNo parameters are include, listen to \nchange.datetimepicker\n instead\n\n\nEmitted from:\n\n\n\n\ntoggle()\n\n\nshow()\n\n\n\n\n\n\nchange.datetimepicker\n\n\nFired when the date is changed, including when changed to a non-date (e.g. When keepInvalid=true).\n\n\nParameters:\n\n\ne = {\n date, //date the picker changed to. Type: moment object (clone)\n oldDate //previous date. Type: moment object (clone) or false in the event of a null\n}\n\n\n\n\nEmitted from:\n\n\n\n\ntoggle() \nNote\n: Only fired when using \nuseCurrent\n\n\nshow() \nNote\n: Only fired when using \nuseCurrent\n or when or the date is changed to comply with date rules (min/max etc)\n\n\ndate(newDate)\n\n\nminDate(minDate)\n\n\nmaxDate(maxDate)\n\n\ndaysOfWeekDisabled()\n\n\n\n\n\n\nerror.datetimepicker\n\n\nFired when a selected date fails to pass validation.\n\n\nParameters:\n\n\ne = {\n date //the invalid date. Type: moment object (clone)\n oldDate //previous date. Type: moment object (clone) or false in the event of a null\n}\n\n\n\n\nEmmited from:\n\n\n\n\nminDate(minDate)\n\n\nmaxDate(maxDate)\n\n\ndaysOfWeekDisabled()\n\n\nsetValue() \nprivate function\n\n\n\n\n\n\nupdate.datetimepicker\n\n\nFired (in most cases) when the \nviewDate\n changes. E.g. Next and Previous buttons, selecting a year.\n\n\nParameters:\n\n\ne = {\n change, //Change type as a momentjs format token. Type: string e.g. yyyy on year change\n viewDate //new viewDate. Type: moment object\n}", + "title": "Events" + }, + { + "location": "/Events/#events", + "text": "", + "title": "Events" + }, + { + "location": "/Events/#hidedatetimepicker", + "text": "Fired when the widget is hidden. Parameters: e = {\n date //the currently set date. Type: moment object (clone)\n} Emitted from: toggle() hide() disable()", + "title": "hide.datetimepicker" + }, + { + "location": "/Events/#showdatetimepicker", + "text": "Fired when the widget is shown. Parameters: No parameters are include, listen to change.datetimepicker instead Emitted from: toggle() show()", + "title": "show.datetimepicker" + }, + { + "location": "/Events/#changedatetimepicker", + "text": "Fired when the date is changed, including when changed to a non-date (e.g. When keepInvalid=true). Parameters: e = {\n date, //date the picker changed to. Type: moment object (clone)\n oldDate //previous date. Type: moment object (clone) or false in the event of a null\n} Emitted from: toggle() Note : Only fired when using useCurrent show() Note : Only fired when using useCurrent or when or the date is changed to comply with date rules (min/max etc) date(newDate) minDate(minDate) maxDate(maxDate) daysOfWeekDisabled()", + "title": "change.datetimepicker" + }, + { + "location": "/Events/#errordatetimepicker", + "text": "Fired when a selected date fails to pass validation. Parameters: e = {\n date //the invalid date. Type: moment object (clone)\n oldDate //previous date. Type: moment object (clone) or false in the event of a null\n} Emmited from: minDate(minDate) maxDate(maxDate) daysOfWeekDisabled() setValue() private function", + "title": "error.datetimepicker" + }, + { + "location": "/Events/#updatedatetimepicker", + "text": "Fired (in most cases) when the viewDate changes. E.g. Next and Previous buttons, selecting a year. Parameters: e = {\n change, //Change type as a momentjs format token. Type: string e.g. yyyy on year change\n viewDate //new viewDate. Type: moment object\n}", + "title": "update.datetimepicker" + }, + { + "location": "/Changelog/", + "text": "Version 5\n\n\n5.0.0-alpha\n\n\nNew Features\n\n\n\n\nES6 rewrite\n\n\nStripped UI/UX related code and shunted it into its own module\n\n\nMore configuration based setup\n\n\nBootstrap 4-esk plugin creation style\n\n\nAll events are namespaced properly \n{event}.datetimepicker\n\n\nAdded a jquery no conflict option\n\n\n\n\nOther changes\n\n\n\n\nmoved \nshowTodayButton\n, \nshowClear\n and \nshowClose\n into \noptions.buttons", + "title": "Change Log" + }, + { + "location": "/Changelog/#version-5", + "text": "", + "title": "Version 5" + }, + { + "location": "/Changelog/#500-alpha", + "text": "", + "title": "5.0.0-alpha" + }, + { + "location": "/Changelog/#new-features", + "text": "ES6 rewrite Stripped UI/UX related code and shunted it into its own module More configuration based setup Bootstrap 4-esk plugin creation style All events are namespaced properly {event}.datetimepicker Added a jquery no conflict option", + "title": "New Features" + }, + { + "location": "/Changelog/#other-changes", + "text": "moved showTodayButton , showClear and showClose into options.buttons", + "title": "Other changes" + }, + { + "location": "/ContributorsGuide/", + "text": "This guide is aimed to contributors wishing to understand the internals of the code in order to change/evolve the component. \n\n\nNote:\n this guide refers to \nversion 5\n which is currently in alpha and will be updated as we progress\n\n\nIntroduction\n\n\nThis component consists actually of 2 subcomponent UI widgets one for the date and one for the time selection process. The developers can configure which of those are needed and also the granularity that the component will allow the users to select a date/time. Developers also choose the format that the selected date/time will be displayed in the input field.\nThe component uses on \njQuery\n, \nmoment.js\n libraries.\n\n\nCode\n\n\nPrivate variables\n\n\n\n\n\n\nelement\n - Holds the DOM element this instance is attached to\n\n\n\n\n\n\noptions\n - Holds an object with the currently set options for the specific instance of the component. Don't directly change the properties of that object use the public API methods instead. DO NOT expose this object or its properties outside of the component.\n\n\n\n\n\n\ndate\n - Holds the moment object for the model value of the component. \nDON'T\n directly change this variable unless you \nREALLY\n know what you are doing. Use \nsetValue()\n function to set it. It handles all component logic for updating the model value and emitting all the appropriate events\n\n\n\n\n\n\nviewDate\n - Holds the currently selected value that the user has selected through the widget. This is not the model value this is the view value. Changing this usually requires a subsequent call to \nupdate()\n function\n\n\n\n\n\n\nunset\n - A \nboolean\n variable that holds whether the components model value is set or not. Model's value starts as \nunset = true\n and if is either set by the user or programmatically through the api to a valid value then it is set to \nfalse\n. If subsequent events lead to an invalid value then this variable is set to \ntrue\n again. Setting this variable usually takes place in the \nsetValue()\n function.\n\n\n\n\n\n\ninput\n - Hold the DOM input element this instance is attached to\n\n\n\n\n\n\ncomponent\n - Holds a reference to the .input-group DOM element that the widget is attached or false if it is attached directly on an input field\n\n\n\n\n\n\nwidget\n - Holds a reference to the DOM element containing the widget or \nfalse\n if the widget is hidden\n\n\n\n\n\n\nuse24hours\n - Holds whether the component uses 24 hours format or not. This is initialized on the \nformat()\n function\n\n\n\n\n\n\nminViewModeNumber\n - Holds the Numeric equivalent of the options.minViewMode parameter\n\n\n\n\n\n\nformat\n - Holds the current format string that is used for formatting the date model value. Note this is not the same thing as the \noptions.format\n as the second could be set to \nfalse\n in which case the first takes the locale's \nL\n or \nLT\n value\n\n\n\n\n\n\ncurrentViewMode\n - Hold the state of the current viewMode for the DatePicker subcomponent\n\n\n\n\n\n\ndatePickerModes\n - An array of objects with configuration parameters for the different views of the DatePicker subcomponent\n\n\n\n\n\n\nviewModes\n - An array of strings containing all the possible strings that \noptions.viewMode\n can take through \nviewMode()\n public api function\n\n\n\n\n\n\ndirectionModes\n - An array of strings containing all the possible strings that \noptions.direction\n can take through \ndirection()\n public api function\n\n\n\n\n\n\norientationModes\n - An array of strings containing all the possible strings that \noptions.orientation\n can take through \norientation()\n public api function\n\n\n\n\n\n\nPrivate functions\n\n\nEvents related\n\n\n\n\n\n\nnotifyEvent(e)\n - Use this function when you want to send en event to listener this could be used as a filter later\n\n\n\n\n\n\nstopEvent(e)\n - Shortcut for stopping propagation of events\n\n\n\n\n\n\nkeydown(e)\n - Function to trap \n\n\n\n\n\n\nchange(e)\n - Listener function to track change events occurring on the \ninput\n dom element the component is attached to\n\n\n\n\n\n\nattachDatePickerElementEvents()\n - Attaches listeners to the existing DOM elements the component is attached to. Called upon construction of each datetimepicker instance\n\n\n\n\n\n\ndetachDatePickerElementEvents()\n - Detaches listeners from the DOM element the component is attached to. Called on \ndestroy()\n\n\n\n\n\n\nattachDatePickerWidgetEvents()\n - Attaches listeners on the components widget. Called on \nshow()\n\n\n\n\n\n\ndetachDatePickerWidgetEvents()\n - Detaches listeners on the components widget. Called on \nhide()\n\n\n\n\n\n\nModel related\n\n\n\n\n\n\nsetValue(targetMoment)\n - Sets the model value of the component takes a moment object. An \nerror\n event will be emmited if the \ntargetMoment\n does not pass the configured validations. Otherwise the \ndate\n variable will be set and the relevant events will be fired.\n\n\n\n\n\n\nisValid(targetMoment, granularity)\n - returns \ntrue\n if the \ntargetMoment\n moment object is valid according to the components set validation rules (\nmin/maxDates\n, \ndisabled/enabledDates\n and \ndaysOfWeekDisabled\n). You may pass a second variable to check only up the the specific granularity \nyear, month, day, hour, minute, second\n\n\n\n\n\n\nUtilities\n\n\n\n\n\n\nindexGivenDates (givenDatesArray)\n - Function that takes the array from \nenabledDates()\n and \ndisabledDates()\n public functions and stores them as object keys to enable quick lookup\n\n\n\n\n\n\nisInEnableDates(date)\n - Checks whether if the given moment object exists in the \noptions.enabledDates\n object\n\n\n\n\n\n\nisInDisableDates(date)\n - Checks whether if the given moment object exists in the \noptions.disabledDates\n array\n\n\n\n\n\n\ndataToOptions()\n - Parses \ndata-date-*\n options set on the input dom element the component is attached to and returns an object with them\n\n\n\n\n\n\nisInFixed()\n - Checks if the dom element or its parents has a fixed position css rule.\n\n\n\n\n\n\nparseInputDate(date)\n - Parses a date parameter with moment using the component's \noptions.format\n and \noptions.useStrict\n. It returns a \nmoment\n object or false if \nparsedMoment#isValid()\n returns \nfalse\n. Use this to parse date inputs from outside the component (public API calls).\n\n\n\n\n\n\ninit()\n - Initializes the component. Called when the component instance is created", + "title": "Dev Guide" + }, + { + "location": "/ContributorsGuide/#introduction", + "text": "This component consists actually of 2 subcomponent UI widgets one for the date and one for the time selection process. The developers can configure which of those are needed and also the granularity that the component will allow the users to select a date/time. Developers also choose the format that the selected date/time will be displayed in the input field.\nThe component uses on jQuery , moment.js libraries.", + "title": "Introduction" + }, + { + "location": "/ContributorsGuide/#code", + "text": "", + "title": "Code" + }, + { + "location": "/ContributorsGuide/#private-variables", + "text": "element - Holds the DOM element this instance is attached to options - Holds an object with the currently set options for the specific instance of the component. Don't directly change the properties of that object use the public API methods instead. DO NOT expose this object or its properties outside of the component. date - Holds the moment object for the model value of the component. DON'T directly change this variable unless you REALLY know what you are doing. Use setValue() function to set it. It handles all component logic for updating the model value and emitting all the appropriate events viewDate - Holds the currently selected value that the user has selected through the widget. This is not the model value this is the view value. Changing this usually requires a subsequent call to update() function unset - A boolean variable that holds whether the components model value is set or not. Model's value starts as unset = true and if is either set by the user or programmatically through the api to a valid value then it is set to false . If subsequent events lead to an invalid value then this variable is set to true again. Setting this variable usually takes place in the setValue() function. input - Hold the DOM input element this instance is attached to component - Holds a reference to the .input-group DOM element that the widget is attached or false if it is attached directly on an input field widget - Holds a reference to the DOM element containing the widget or false if the widget is hidden use24hours - Holds whether the component uses 24 hours format or not. This is initialized on the format() function minViewModeNumber - Holds the Numeric equivalent of the options.minViewMode parameter format - Holds the current format string that is used for formatting the date model value. Note this is not the same thing as the options.format as the second could be set to false in which case the first takes the locale's L or LT value currentViewMode - Hold the state of the current viewMode for the DatePicker subcomponent datePickerModes - An array of objects with configuration parameters for the different views of the DatePicker subcomponent viewModes - An array of strings containing all the possible strings that options.viewMode can take through viewMode() public api function directionModes - An array of strings containing all the possible strings that options.direction can take through direction() public api function orientationModes - An array of strings containing all the possible strings that options.orientation can take through orientation() public api function", + "title": "Private variables" + }, + { + "location": "/ContributorsGuide/#private-functions", + "text": "", + "title": "Private functions" + }, + { + "location": "/ContributorsGuide/#events-related", + "text": "notifyEvent(e) - Use this function when you want to send en event to listener this could be used as a filter later stopEvent(e) - Shortcut for stopping propagation of events keydown(e) - Function to trap change(e) - Listener function to track change events occurring on the input dom element the component is attached to attachDatePickerElementEvents() - Attaches listeners to the existing DOM elements the component is attached to. Called upon construction of each datetimepicker instance detachDatePickerElementEvents() - Detaches listeners from the DOM element the component is attached to. Called on destroy() attachDatePickerWidgetEvents() - Attaches listeners on the components widget. Called on show() detachDatePickerWidgetEvents() - Detaches listeners on the components widget. Called on hide()", + "title": "Events related" + }, + { + "location": "/ContributorsGuide/#model-related", + "text": "setValue(targetMoment) - Sets the model value of the component takes a moment object. An error event will be emmited if the targetMoment does not pass the configured validations. Otherwise the date variable will be set and the relevant events will be fired. isValid(targetMoment, granularity) - returns true if the targetMoment moment object is valid according to the components set validation rules ( min/maxDates , disabled/enabledDates and daysOfWeekDisabled ). You may pass a second variable to check only up the the specific granularity year, month, day, hour, minute, second", + "title": "Model related" + }, + { + "location": "/ContributorsGuide/#utilities", + "text": "indexGivenDates (givenDatesArray) - Function that takes the array from enabledDates() and disabledDates() public functions and stores them as object keys to enable quick lookup isInEnableDates(date) - Checks whether if the given moment object exists in the options.enabledDates object isInDisableDates(date) - Checks whether if the given moment object exists in the options.disabledDates array dataToOptions() - Parses data-date-* options set on the input dom element the component is attached to and returns an object with them isInFixed() - Checks if the dom element or its parents has a fixed position css rule. parseInputDate(date) - Parses a date parameter with moment using the component's options.format and options.useStrict . It returns a moment object or false if parsedMoment#isValid() returns false . Use this to parse date inputs from outside the component (public API calls). init() - Initializes the component. Called when the component instance is created", + "title": "Utilities" + }, + { + "location": "/Extras/", + "text": "Extras\n\n\nGuides for making the picker work better with rails, IE, etc. \nNote:\n I have no idea if these guides still apply for v5 or not.\n\n\nRails 3\n\n\nby \ndhulihan\n\n\nYou can easily override the default rails form helpers (\ndate_select\n and \ndatetime_select\n) with bootstrap-datetimepicker for a much nicer experience. \n\n\n# Add to config/initializers/form.rb or the end of app/helpers/application_helper.rb\nmodule ActionView\n module Helpers\n class FormBuilder \n def date_select(method, options = {}, html_options = {})\n existing_date = @object.send(method) \n formatted_date = existing_date.to_date.strftime(\n%F\n) if existing_date.present?\n @template.content_tag(:div, :class =\n \ninput-group\n) do \n text_field(method, :value =\n formatted_date, :class =\n \nform-control datepicker\n, :\ndata-date-format\n =\n \nYYYY-MM-DD\n) +\n @template.content_tag(:span, @template.content_tag(:span, \n, :class =\n \nglyphicon glyphicon-calendar\n) ,:class =\n \ninput-group-addon\n)\n end\n end\n\n def datetime_select(method, options = {}, html_options = {})\n existing_time = @object.send(method) \n formatted_time = existing_time.to_time.strftime(\n%F %I:%M %p\n) if existing_time.present?\n @template.content_tag(:div, :class =\n \ninput-group\n) do \n text_field(method, :value =\n formatted_time, :class =\n \nform-control datetimepicker\n, :\ndata-date-format\n =\n \nYYYY-MM-DD hh:mm A\n) +\n @template.content_tag(:span, @template.content_tag(:span, \n, :class =\n \nglyphicon glyphicon-calendar\n) ,:class =\n \ninput-group-addon\n)\n end\n end\n end\n end\nend\n\n\n\n\nThe time format used here is ActiveRecord-friendly, which means it will be parsed correctly when passed in through \nparams\n to your record.\n\n\nThat's all there is to it! Now all of your forms that use \ndatetime_select\n or \ndate_select\n will be automatically updated:\n\n\n% form_for @post do |f| %\n\n \ndiv class=\nform-group\n\n \nlabel\nPublished At\n/label\n\n \n%= f.datetime_select :published_at %\n\n \n/div\n\n\n% end %", + "title": "Extras" + }, + { + "location": "/Extras/#extras", + "text": "Guides for making the picker work better with rails, IE, etc. Note: I have no idea if these guides still apply for v5 or not.", + "title": "Extras" + }, + { + "location": "/Extras/#rails-3", + "text": "by dhulihan You can easily override the default rails form helpers ( date_select and datetime_select ) with bootstrap-datetimepicker for a much nicer experience. # Add to config/initializers/form.rb or the end of app/helpers/application_helper.rb\nmodule ActionView\n module Helpers\n class FormBuilder \n def date_select(method, options = {}, html_options = {})\n existing_date = @object.send(method) \n formatted_date = existing_date.to_date.strftime( %F ) if existing_date.present?\n @template.content_tag(:div, :class = input-group ) do \n text_field(method, :value = formatted_date, :class = form-control datepicker , : data-date-format = YYYY-MM-DD ) +\n @template.content_tag(:span, @template.content_tag(:span, , :class = glyphicon glyphicon-calendar ) ,:class = input-group-addon )\n end\n end\n\n def datetime_select(method, options = {}, html_options = {})\n existing_time = @object.send(method) \n formatted_time = existing_time.to_time.strftime( %F %I:%M %p ) if existing_time.present?\n @template.content_tag(:div, :class = input-group ) do \n text_field(method, :value = formatted_time, :class = form-control datetimepicker , : data-date-format = YYYY-MM-DD hh:mm A ) +\n @template.content_tag(:span, @template.content_tag(:span, , :class = glyphicon glyphicon-calendar ) ,:class = input-group-addon )\n end\n end\n end\n end\nend The time format used here is ActiveRecord-friendly, which means it will be parsed correctly when passed in through params to your record. That's all there is to it! Now all of your forms that use datetime_select or date_select will be automatically updated: % form_for @post do |f| % \n div class= form-group \n label Published At /label \n %= f.datetime_select :published_at % \n /div % end %", + "title": "Rails 3" + }, + { + "location": "/FAQ/", + "text": "FAQs\n\n\nHow do I disable the date or time element\n\n\nHow do I format ...; How do I add seconds; etc.\n\n\nThe picker uses the \nformat\n option to decide what components to show. Set \nformat\n to \nLT\n, \nLTS\n or another valid \nMomentJs format string\n to display certain components\n\n\nHow do I change the language/locale\n\n\nThe picker uses MomentJs to determine the language string. You can use \nmoment-with-locales\n or you can include whatever local file you need. Set the picker's \nlocale\n option to \nde\n or whatever the locale string is.\n\n\nHow do I change the styles? The picker closes.\n\n\nSet \ndebug:true\n which will force the picker to stay open, even \nonBlur\n. You can hide the picker manually by calling \nhide()\n\n\nHow do I change the start of the week?\n\n\nStart of the week is based on the \nlocale\n provided\n. This is defined by moment's locales. If you want to change it, create your own locale file or override. \nSee moment's docs\n.\n\n\nHow I use the picker as birthday picker?\n\n\nUse the \nviewMode\n option to \n'years'", + "title": "FAQs" + }, + { + "location": "/FAQ/#faqs", + "text": "", + "title": "FAQs" + }, + { + "location": "/FAQ/#how-do-i-disable-the-date-or-time-element", + "text": "How do I format ...; How do I add seconds; etc. The picker uses the format option to decide what components to show. Set format to LT , LTS or another valid MomentJs format string to display certain components", + "title": "How do I disable the date or time element" + }, + { + "location": "/FAQ/#how-do-i-change-the-languagelocale", + "text": "The picker uses MomentJs to determine the language string. You can use moment-with-locales or you can include whatever local file you need. Set the picker's locale option to de or whatever the locale string is.", + "title": "How do I change the language/locale" + }, + { + "location": "/FAQ/#how-do-i-change-the-styles-the-picker-closes", + "text": "Set debug:true which will force the picker to stay open, even onBlur . You can hide the picker manually by calling hide()", + "title": "How do I change the styles? The picker closes." + }, + { + "location": "/FAQ/#how-do-i-change-the-start-of-the-week", + "text": "Start of the week is based on the locale provided . This is defined by moment's locales. If you want to change it, create your own locale file or override. See moment's docs .", + "title": "How do I change the start of the week?" + }, + { + "location": "/FAQ/#how-i-use-the-picker-as-birthday-picker", + "text": "Use the viewMode option to 'years'", + "title": "How I use the picker as birthday picker?" + } + ] } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index da60da2..03167bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "tempusdominus-core", + "name": "tempusdominus", "version": "5.0.3", "lockfileVersion": 1, "requires": true, @@ -6127,4 +6127,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 6f03b20..5b000f6 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "license": "MIT", - "main": "build/js/tempusdominus-core.js", - "module": "src/js/tempusdominus-core.js", - "name": "tempusdominus-core", + "main": "build/js/tempusdominus.js", + "module": "src/js/tempusdominus.js", + "name": "tempusdominus", "author": { "name": "Jonathan Peterson" }, @@ -55,4 +55,4 @@ "src/js/**/*.js", "Gruntfile.js" ] -} +} \ No newline at end of file diff --git a/src/js/tempusdominus-core.js b/src/js/tempusdominus.js similarity index 100% rename from src/js/tempusdominus-core.js rename to src/js/tempusdominus.js diff --git a/tasks/bump-version.js b/tasks/bump-version.js index b06d50e..6125584 100644 --- a/tasks/bump-version.js +++ b/tasks/bump-version.js @@ -41,7 +41,7 @@ module.exports = function (grunt) { }); grunt.config('string-replace.js', { - files: { 'src/js/tempusdominus-core.js': 'src/js/empusdominus-core.js' }, + files: { 'src/js/tempusdominus.js': 'src/js/empusdominus-core.js' }, options: { replacements: [ { From 17a61c689e100ee020f9db36cd3c6f6b7a9149f1 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 00:43:07 +0200 Subject: [PATCH 03/92] Fix a typo in package.json for peer dependencies --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4244977..06f4b80 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "moment": "^2.22.2", "moment-timezone": "^0.4.0" }, - "peerDependenciesd": { + "peerDependencies": { "jquery": "^3.0", "moment": "^2.10", "moment-timezone": "^0.4.0" @@ -55,4 +55,4 @@ "src/js/**/*.js", "Gruntfile.js" ] -} +} \ No newline at end of file From 043fae3f9f46cc5d92d0d847bcfa830cf5bed5e3 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 00:50:20 +0200 Subject: [PATCH 04/92] Added myself as a contributor --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 3db686b..17494ff 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,9 @@ "author": { "name": "Jonathan Peterson" }, + "contributors": [ + "Anton Bagdatyev (Tonix)" + ], "bugs": { "url": "https://github.com/tempusdominus/core/issues" }, From af8fdc6cda1ff69e30af688926a36ef411a6705d Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 00:55:55 +0200 Subject: [PATCH 05/92] Fix for multidate mode --- .prettierignore | 1 + src/js/tempusdominus-core.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..fa29cdf --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +** \ No newline at end of file diff --git a/src/js/tempusdominus-core.js b/src/js/tempusdominus-core.js index 8c4b5b3..d4b9c26 100644 --- a/src/js/tempusdominus-core.js +++ b/src/js/tempusdominus-core.js @@ -615,7 +615,7 @@ const DateTimePicker = (($, moment) => { } _isValid(targetMoment, granularity) { - if (!targetMoment.isValid()) { + if (!targetMoment || !targetMoment.isValid()) { return false; } if (this._options.disabledDates && granularity === 'd' && this._isInDisabledDates(targetMoment)) { From b4215a917facef1dba139bf0ff881c2d65bab6fc Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 01:07:04 +0200 Subject: [PATCH 06/92] Added build scripts --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 17494ff..70954b7 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,12 @@ "bugs": { "url": "https://github.com/tempusdominus/core/issues" }, + "scripts": { + "build": "grunt build", + "publish-patch": "npm version patch && npm run build && git add . && git commit -am \"Next patch version\" && npm publish && git push && git push --tags", + "publish-minor": "npm version minor && npm run build && git add . && git commit -am \"Next minor version\" && npm publish && git push && git push --tags", + "publish-major": "npm version major && npm run build && git add . && git commit -am \"Next major version\" && npm publish && git push && git push --tags" + }, "dependencies": { "jquery": "^3.5.0", "moment": "^2.24.0", From 8e08ad9986aaabcf1c0aa28fdef8afac4ce13136 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 01:10:20 +0200 Subject: [PATCH 07/92] 5.1.0 --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03167bc..e2c12c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.0.3", + "version": "5.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -6127,4 +6127,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 70954b7..be163d1 100644 --- a/package.json +++ b/package.json @@ -58,10 +58,10 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.0.3", + "version": "5.1.0", "files": [ "build", "src/js/**/*.js", "Gruntfile.js" ] -} \ No newline at end of file +} From 1a9bfd7b7f6e22b85d6e3e731e78063297123764 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 01:10:27 +0200 Subject: [PATCH 08/92] Next minor version --- build/js/tempusdominus.js | 2 +- build/js/tempusdominus.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index dc2927b..39c10e9 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -570,7 +570,7 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._isValid = function _isValid(targetMoment, granularity) { - if (!targetMoment.isValid()) { + if (!targetMoment || !targetMoment.isValid()) { return false; } if (this._options.disabledDates && granularity === 'd' && this._isInDisabledDates(targetMoment)) { diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 387e1b1..d6afd11 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+h[this.currentViewMode].CLASS_NAME).show())},_.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},_.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},_.prototype._isValid=function(t,e){if(!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},_.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},_.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in u[p]="p",u)u.hasOwnProperty(i)&&"p"===u[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&d[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(d[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},_.prototype._keyup=function(t){u[t.which]="r",f[t.which]&&(f[t.which]=!1,t.stopPropagation(),t.preventDefault())},_.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},_.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},_.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},_.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},_.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},_.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},_.prototype.toggle=function(){return this.widget?this.hide():this.show()},_.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},_.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},_.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},_.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},_.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},_.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},_.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},_.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},_.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},_.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+h[this.currentViewMode].CLASS_NAME).show())},_.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},_.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},_.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},_.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},_.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in u[p]="p",u)u.hasOwnProperty(i)&&"p"===u[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&d[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(d[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},_.prototype._keyup=function(t){u[t.which]="r",f[t.which]&&(f[t.which]=!1,t.stopPropagation(),t.preventDefault())},_.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},_.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},_.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},_.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},_.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},_.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},_.prototype.toggle=function(){return this.widget?this.hide():this.show()},_.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},_.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},_.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},_.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},_.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},_.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},_.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},_.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},_.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},_.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Thu, 30 Apr 2020 09:11:30 +0200 Subject: [PATCH 09/92] npm update --- package-lock.json | 8 ++++---- package.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index e2c12c1..7d4eb7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4252,11 +4252,11 @@ "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" }, "moment-timezone": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.4.1.tgz", - "integrity": "sha1-gfWYw61eIs2teWtn7NjYjQ9bqgY=", + "version": "0.5.28", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.28.tgz", + "integrity": "sha512-TDJkZvAyKIVWg5EtVqRzU97w0Rb0YVbfpqyjgu6GwXCAohVRqwZjf4fOzDE6p1Ch98Sro/8hQQi65WDXW5STPw==", "requires": { - "moment": ">= 2.6.0" + "moment": ">= 2.9.0" } }, "morgan": { diff --git a/package.json b/package.json index be163d1..1c72865 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,12 @@ "dependencies": { "jquery": "^3.5.0", "moment": "^2.24.0", - "moment-timezone": "^0.4.0" + "moment-timezone": "^0.5.28" }, "peerDependencies": { "jquery": "^3.0", "moment": "^2.10", - "moment-timezone": "^0.4.0" + "moment-timezone": "^0.5.0" }, "description": "A date/time picker component designed for Momentjs. For usage, installation and demos see Project Site on GitHub", "devDependencies": { From a9b28154af6d62cbff00d26a80f15561d0364fd1 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 09:11:44 +0200 Subject: [PATCH 10/92] 5.2.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7d4eb7f..6e6a1b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.1.0", + "version": "5.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1c72865..8765fdb 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.1.0", + "version": "5.2.0", "files": [ "build", "src/js/**/*.js", From 1ce23895ee2fd9e8d93d3c8039e717ddbc0e9891 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 10:37:08 +0200 Subject: [PATCH 11/92] Updated build scripts --- package.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 8765fdb..2c59024 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,10 @@ }, "scripts": { "build": "grunt build", - "publish-patch": "npm version patch && npm run build && git add . && git commit -am \"Next patch version\" && npm publish && git push && git push --tags", - "publish-minor": "npm version minor && npm run build && git add . && git commit -am \"Next minor version\" && npm publish && git push && git push --tags", - "publish-major": "npm version major && npm run build && git add . && git commit -am \"Next major version\" && npm publish && git push && git push --tags" + "git-add-cm": "git add . && git commit -am", + "publish-patch": "npm version patch && npm run build && ((npm run git-add-cm -- \"Next patch version\") || echo) && npm publish && git push && git push --tags", + "publish-minor": "npm version minor && npm run build && ((npm run git-add-cm -- \"Next minor version\") || echo) && npm publish && git push && git push --tags", + "publish-major": "npm version major && npm run build && ((npm run git-add-cm -- \"Next major version\") || echo) && npm publish && git push && git push --tags" }, "dependencies": { "jquery": "^3.5.0", @@ -64,4 +65,4 @@ "src/js/**/*.js", "Gruntfile.js" ] -} +} \ No newline at end of file From 01a292598cd1f528b9dc09583ec577623096be61 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 10:37:15 +0200 Subject: [PATCH 12/92] 5.3.0 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e6a1b4..acbc685 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.2.0", + "version": "5.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2c59024..ea65cd7 100644 --- a/package.json +++ b/package.json @@ -59,10 +59,10 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.2.0", + "version": "5.3.0", "files": [ "build", "src/js/**/*.js", "Gruntfile.js" ] -} \ No newline at end of file +} From 32fb473de44107246a80e1fead247674e7720bbf Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 10:43:36 +0200 Subject: [PATCH 13/92] Updated build scripts again and added comment --- package.json | 8 ++++---- src/js/tempusdominus.js | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ea65cd7..f94ca5e 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,9 @@ "scripts": { "build": "grunt build", "git-add-cm": "git add . && git commit -am", - "publish-patch": "npm version patch && npm run build && ((npm run git-add-cm -- \"Next patch version\") || echo) && npm publish && git push && git push --tags", - "publish-minor": "npm version minor && npm run build && ((npm run git-add-cm -- \"Next minor version\") || echo) && npm publish && git push && git push --tags", - "publish-major": "npm version major && npm run build && ((npm run git-add-cm -- \"Next major version\") || echo) && npm publish && git push && git push --tags" + "publish-patch": "npm version patch && npm run build && ((npm run git-add-cm -- \"Next patch version\" 2>/dev/null) || echo) && npm publish && git push && git push --tags", + "publish-minor": "npm version minor && npm run build && ((npm run git-add-cm -- \"Next minor version\" 2>/dev/null) || echo) && npm publish && git push && git push --tags", + "publish-major": "npm version major && npm run build && ((npm run git-add-cm -- \"Next major version\" 2>/dev/null) || echo) && npm publish && git push && git push --tags" }, "dependencies": { "jquery": "^3.5.0", @@ -65,4 +65,4 @@ "src/js/**/*.js", "Gruntfile.js" ] -} +} \ No newline at end of file diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index d4b9c26..d446ca8 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -1,6 +1,10 @@ import jQuery from 'jquery'; import moment from 'moment'; +/** + * tempusdominus - Fork of tempusdominus-core. + */ + // ReSharper disable once InconsistentNaming const DateTimePicker = (($, moment) => { // ReSharper disable InconsistentNaming From febcfa8992aa14501f973fb1bdbd62cf129af169 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 10:43:55 +0200 Subject: [PATCH 14/92] 5.4.0 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index acbc685..89221a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.3.0", + "version": "5.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f94ca5e..1aaa681 100644 --- a/package.json +++ b/package.json @@ -59,10 +59,10 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.3.0", + "version": "5.4.0", "files": [ "build", "src/js/**/*.js", "Gruntfile.js" ] -} \ No newline at end of file +} From 7fab5e11297457415660c380d5962e19e7ea96a0 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 10:44:02 +0200 Subject: [PATCH 15/92] Next minor version --- build/js/tempusdominus.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 39c10e9..c9f4373 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -2,6 +2,10 @@ var _createClass = function () { function defineProperties(target, props) { for function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/** + * tempusdominus - Fork of tempusdominus-core. + */ + // ReSharper disable once InconsistentNaming var DateTimePicker = function ($, moment) { // ReSharper disable InconsistentNaming From 8a77c10f4d34fb2aa56b9102eba03cdb9447f98d Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 10:44:51 +0200 Subject: [PATCH 16/92] Removed comment --- src/js/tempusdominus.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index d446ca8..d4b9c26 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -1,10 +1,6 @@ import jQuery from 'jquery'; import moment from 'moment'; -/** - * tempusdominus - Fork of tempusdominus-core. - */ - // ReSharper disable once InconsistentNaming const DateTimePicker = (($, moment) => { // ReSharper disable InconsistentNaming From 19d3d80d636f85ff487b266ebeee04f203943ef8 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 10:44:56 +0200 Subject: [PATCH 17/92] 5.5.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 89221a6..7c4e0eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.4.0", + "version": "5.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1aaa681..91c64e3 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.4.0", + "version": "5.5.0", "files": [ "build", "src/js/**/*.js", From 1e9b5d6841cfe3624ee6d0eb3118cc52dfa39f0f Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 10:45:03 +0200 Subject: [PATCH 18/92] Next minor version --- build/js/tempusdominus.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index c9f4373..39c10e9 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -2,10 +2,6 @@ var _createClass = function () { function defineProperties(target, props) { for function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/** - * tempusdominus - Fork of tempusdominus-core. - */ - // ReSharper disable once InconsistentNaming var DateTimePicker = function ($, moment) { // ReSharper disable InconsistentNaming From 1d55e6caf2730df42f39de28f36a3bf069205067 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 30 Apr 2020 10:45:23 +0200 Subject: [PATCH 19/92] 5.6.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7c4e0eb..16f919c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.5.0", + "version": "5.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 91c64e3..ef8cb54 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.5.0", + "version": "5.6.0", "files": [ "build", "src/js/**/*.js", From a7f6412631668e6a7feb5b52815d679bccb67a0a Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 1 May 2020 21:11:27 +0200 Subject: [PATCH 20/92] Allow multidateSeparator to include more than one character --- build/js/tempusdominus-core.js | 16 ++++++++++------ package.json | 5 ++++- src/js/tempusdominus-core.js | 10 ++++++---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/build/js/tempusdominus-core.js b/build/js/tempusdominus-core.js index 6337cf9..f1f6e55 100644 --- a/build/js/tempusdominus-core.js +++ b/build/js/tempusdominus-core.js @@ -5,7 +5,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons // ReSharper disable once InconsistentNaming var DateTimePicker = function ($, moment) { // ReSharper disable InconsistentNaming - var NAME = 'datetimepicker', + var trim = function trim(str) { + return str.replace(/(^\s+)|(\s+$)/g, ''); + }, + NAME = 'datetimepicker', DATA_KEY = '' + NAME, EVENT_KEY = '.' + DATA_KEY, DATA_API_KEY = '.data-api', @@ -288,7 +291,7 @@ var DateTimePicker = function ($, moment) { enabledHours: false, viewDate: false, allowMultidate: false, - multidateSeparator: ',' + multidateSeparator: ', ' }; // ReSharper restore InconsistentNaming @@ -418,6 +421,7 @@ var DateTimePicker = function ($, moment) { } else { outpValue = this._dates[index].format(this.actualFormat); } + outpValue = trim(outpValue); if (this.input !== undefined) { this.input.val(outpValue); this.input.trigger('input'); @@ -526,7 +530,7 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) { - if (e.type === DateTimePicker.Event.CHANGE && (e.date && e.date.isSame(e.oldDate)) || !e.date && !e.oldDate) { + if (e.type === DateTimePicker.Event.CHANGE && e.date && e.date.isSame(e.oldDate) || !e.date && !e.oldDate) { return; } this._element.trigger(e); @@ -570,7 +574,7 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._isValid = function _isValid(targetMoment, granularity) { - if (!targetMoment.isValid()) { + if (!targetMoment || !targetMoment.isValid()) { return false; } if (this._options.disabledDates && granularity === 'd' && this._isInDisabledDates(targetMoment)) { @@ -1458,8 +1462,8 @@ var DateTimePicker = function ($, moment) { return this._options.multidateSeparator; } - if (typeof _multidateSeparator !== 'string' || _multidateSeparator.length > 1) { - throw new TypeError('multidateSeparator expects a single character string parameter'); + if (typeof _multidateSeparator !== 'string') { + throw new TypeError('multidateSeparator expects a string parameter'); } this._options.multidateSeparator = _multidateSeparator; diff --git a/package.json b/package.json index 4244977..f0f118f 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,9 @@ "bugs": { "url": "https://github.com/tempusdominus/core/issues" }, + "scripts": { + "build": "grunt" + }, "dependencies": { "jquery": "^3.0", "moment": "^2.22.2", @@ -55,4 +58,4 @@ "src/js/**/*.js", "Gruntfile.js" ] -} +} \ No newline at end of file diff --git a/src/js/tempusdominus-core.js b/src/js/tempusdominus-core.js index d4b9c26..a741c5f 100644 --- a/src/js/tempusdominus-core.js +++ b/src/js/tempusdominus-core.js @@ -4,7 +4,8 @@ import moment from 'moment'; // ReSharper disable once InconsistentNaming const DateTimePicker = (($, moment) => { // ReSharper disable InconsistentNaming - const NAME = 'datetimepicker', + const trim = str => str.replace(/(^\s+)|(\s+$)/g, ''), + NAME = 'datetimepicker', DATA_KEY = `${NAME}`, EVENT_KEY = `.${DATA_KEY}`, DATA_API_KEY = '.data-api', @@ -287,7 +288,7 @@ const DateTimePicker = (($, moment) => { enabledHours: false, viewDate: false, allowMultidate: false, - multidateSeparator: ',' + multidateSeparator: ', ' }; // ReSharper restore InconsistentNaming @@ -465,6 +466,7 @@ const DateTimePicker = (($, moment) => { } else { outpValue = this._dates[index].format(this.actualFormat); } + outpValue = trim(outpValue) if (this.input !== undefined) { this.input.val(outpValue); this.input.trigger('input'); @@ -1499,8 +1501,8 @@ const DateTimePicker = (($, moment) => { return this._options.multidateSeparator; } - if (typeof multidateSeparator !== 'string' || multidateSeparator.length > 1) { - throw new TypeError('multidateSeparator expects a single character string parameter'); + if (typeof multidateSeparator !== 'string') { + throw new TypeError('multidateSeparator expects a string parameter'); } this._options.multidateSeparator = multidateSeparator; From 5829a661a778e1ce4caa7944920b7b256966e8f3 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 1 May 2020 21:12:46 +0200 Subject: [PATCH 21/92] 5.7.0 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 16f919c..4844db1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.6.0", + "version": "5.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2d1af19..3670435 100644 --- a/package.json +++ b/package.json @@ -59,10 +59,10 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.6.0", + "version": "5.7.0", "files": [ "build", "src/js/**/*.js", "Gruntfile.js" ] -} \ No newline at end of file +} From 8283ac94830fb4cd457a95cd951fbb02e01b8a02 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 1 May 2020 21:12:54 +0200 Subject: [PATCH 22/92] Next minor version --- build/js/tempusdominus.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index d6afd11..3c10a4f 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+h[this.currentViewMode].CLASS_NAME).show())},_.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},_.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},_.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},_.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},_.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in u[p]="p",u)u.hasOwnProperty(i)&&"p"===u[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&d[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(d[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},_.prototype._keyup=function(t){u[t.which]="r",f[t.which]&&(f[t.which]=!1,t.stopPropagation(),t.preventDefault())},_.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},_.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},_.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},_.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},_.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},_.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},_.prototype.toggle=function(){return this.widget?this.hide():this.show()},_.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},_.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},_.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},_.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},_.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},_.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},_.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},_.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},_.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},_.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+h[this.currentViewMode].CLASS_NAME).show())},_.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},_.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},_.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},_.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},_.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in u[p]="p",u)u.hasOwnProperty(i)&&"p"===u[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&d[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(d[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},_.prototype._keyup=function(t){u[t.which]="r",f[t.which]&&(f[t.which]=!1,t.stopPropagation(),t.preventDefault())},_.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},_.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},_.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},_.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},_.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},_.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},_.prototype.toggle=function(){return this.widget?this.hide():this.show()},_.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},_.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},_.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},_.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},_.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},_.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},_.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},_.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},_.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},_.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Sat, 2 May 2020 17:42:01 +0200 Subject: [PATCH 23/92] Added private_local_dir to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a7d9697..7da4cd5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ site *.sln *.nupkg /index.html -/test.html \ No newline at end of file +/test.html +private_local_dir/** \ No newline at end of file From 717eb1915707c5dd512abd2aabd67acc85d89a16 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sat, 2 May 2020 17:47:27 +0200 Subject: [PATCH 24/92] Added onchange dev dep and watch script --- package-lock.json | 190 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 8 +- 2 files changed, 195 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4844db1..6f0a93d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,6 +67,18 @@ } } }, + "@blakeembrey/deque": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@blakeembrey/deque/-/deque-1.0.5.tgz", + "integrity": "sha512-6xnwtvp9DY1EINIKdTfvfeAtCYw4OqBZJhtiqkT3ivjnEfa25VQ3TsKvaFfKm8MyGIEfE95qLe+bNEt3nB0Ylg==", + "dev": true + }, + "@blakeembrey/template": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@blakeembrey/template/-/template-1.0.0.tgz", + "integrity": "sha512-J6WGZqCLdRMHUkyRG6fBSIFJ0rL60/nsQNh5rQvsYZ5u0PsKw6XQcJcA3DWvd9cN3j/IQx5yB1fexhCafwwUUw==", + "dev": true + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -182,12 +194,28 @@ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "argparse": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", @@ -983,6 +1011,12 @@ "tweetnacl": "^0.14.3" } }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -1011,6 +1045,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -1146,6 +1189,22 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "chokidar": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", + "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.4.0" + } + }, "chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", @@ -2070,6 +2129,15 @@ "object-assign": "^4.0.1" } }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "finalhandler": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz", @@ -2241,6 +2309,13 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -3708,6 +3783,15 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3760,6 +3844,12 @@ "xtend": "^4.0.0" } }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", @@ -4419,6 +4509,12 @@ } } }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, "npm-bundled": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", @@ -4534,6 +4630,70 @@ "wrappy": "1" } }, + "onchange": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/onchange/-/onchange-7.0.2.tgz", + "integrity": "sha512-pyJroR9gZKilbJtdGsuyxhFhwaeYSpYVle9hAORGJ5vQQH8n7QT+qWpncJTMEk9dlIXI9tOMjdJwbPaTSPTKFA==", + "dev": true, + "requires": { + "@blakeembrey/deque": "^1.0.5", + "@blakeembrey/template": "^1.0.0", + "arg": "^4.1.3", + "chokidar": "^3.3.1", + "cross-spawn": "^7.0.1", + "ignore": "^5.1.4", + "tree-kill": "^1.2.2" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "onetime": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", @@ -4779,6 +4939,12 @@ "dev": true, "optional": true }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -5096,6 +5262,15 @@ "util-deprecate": "~1.0.1" } }, + "readdirp": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, "readline2": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", @@ -5841,6 +6016,15 @@ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -5852,6 +6036,12 @@ "punycode": "^2.1.1" } }, + "tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true + }, "trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", diff --git a/package.json b/package.json index 3670435..6666d04 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "url": "https://github.com/tempusdominus/core/issues" }, "scripts": { + "watch": "./node_modules/.bin/onchange './src/js/**' -- npm run build", "build": "grunt build", "git-add-cm": "git add . && git commit -am", "publish-patch": "npm version patch && npm run build && ((npm run git-add-cm -- \"Next patch version\" 2>/dev/null) || echo) && npm publish && git push && git push --tags", @@ -21,7 +22,7 @@ }, "dependencies": { "jquery": "^3.5.0", - "moment": "^2.24.0", + "moment": "~2.24.0", "moment-timezone": "^0.5.28" }, "peerDependencies": { @@ -46,7 +47,8 @@ "grunt-eslint": "^19.0.0", "grunt-nuget": "^0.3.1", "grunt-string-replace": "latest", - "load-grunt-tasks": "latest" + "load-grunt-tasks": "latest", + "onchange": "^7.0.2" }, "homepage": "https://github.com/tempusdominus/core", "keywords": [ @@ -65,4 +67,4 @@ "src/js/**/*.js", "Gruntfile.js" ] -} +} \ No newline at end of file From b83a3698330b30071df7c5e915a82132fdf18ea3 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sat, 2 May 2020 18:22:58 +0200 Subject: [PATCH 25/92] Added handling of custom multidate separator different from default ', ' one --- src/js/tempusdominus-core.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/js/tempusdominus-core.js b/src/js/tempusdominus-core.js index a741c5f..87096e4 100644 --- a/src/js/tempusdominus-core.js +++ b/src/js/tempusdominus-core.js @@ -3,6 +3,10 @@ import moment from 'moment'; // ReSharper disable once InconsistentNaming const DateTimePicker = (($, moment) => { + function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + } + // ReSharper disable InconsistentNaming const trim = str => str.replace(/(^\s+)|(\s+$)/g, ''), NAME = 'datetimepicker', @@ -425,11 +429,16 @@ const DateTimePicker = (($, moment) => { this._dates = []; this._datesFormatted = []; } else { - outpValue = `${this._element.data('date')},`; - outpValue = outpValue.replace(`${oldDate.format(this.actualFormat)},`, '').replace(',,', '').replace(/,\s*$/, ''); + outpValue = `${this._element.data('date')}${this._options.multidateSeparator}`; + outpValue = outpValue.replace( + `${oldDate.format(this.actualFormat)}${this._options.multidateSeparator}`, '' + ) + .replace(`${this._options.multidateSeparator}${this._options.multidateSeparator}`, '') + .replace(new RegExp(`${escapeRegExp(this._options.multidateSeparator)}\\s*$`), ''); this._dates.splice(index, 1); this._datesFormatted.splice(index, 1); } + outpValue = trim(outpValue); if (this.input !== undefined) { this.input.val(outpValue); this.input.trigger('input'); @@ -462,7 +471,7 @@ const DateTimePicker = (($, moment) => { for (let i = 0; i < this._dates.length; i++) { outpValue += `${this._dates[i].format(this.actualFormat)}${this._options.multidateSeparator}`; } - outpValue = outpValue.replace(/,\s*$/, ''); + outpValue = outpValue.replace(new RegExp(`${this._options.multidateSeparator}\\s*$`), ''); } else { outpValue = this._dates[index].format(this.actualFormat); } From c0ec81852b4eb20d6c922a4825da2be2b6e7860f Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sat, 2 May 2020 18:25:09 +0200 Subject: [PATCH 26/92] Fork build for multidate-mode-fixes merge into fork --- build/js/tempusdominus.js | 11 ++++++++--- build/js/tempusdominus.min.js | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index f1f6e55..2cec195 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -4,6 +4,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons // ReSharper disable once InconsistentNaming var DateTimePicker = function ($, moment) { + function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + } + // ReSharper disable InconsistentNaming var trim = function trim(str) { return str.replace(/(^\s+)|(\s+$)/g, ''); @@ -380,11 +384,12 @@ var DateTimePicker = function ($, moment) { this._dates = []; this._datesFormatted = []; } else { - outpValue = this._element.data('date') + ','; - outpValue = outpValue.replace(oldDate.format(this.actualFormat) + ',', '').replace(',,', '').replace(/,\s*$/, ''); + outpValue = '' + this._element.data('date') + this._options.multidateSeparator; + outpValue = outpValue.replace('' + oldDate.format(this.actualFormat) + this._options.multidateSeparator, '').replace('' + this._options.multidateSeparator + this._options.multidateSeparator, '').replace(new RegExp(escapeRegExp(this._options.multidateSeparator) + '\\s*$'), ''); this._dates.splice(index, 1); this._datesFormatted.splice(index, 1); } + outpValue = trim(outpValue); if (this.input !== undefined) { this.input.val(outpValue); this.input.trigger('input'); @@ -417,7 +422,7 @@ var DateTimePicker = function ($, moment) { for (var i = 0; i < this._dates.length; i++) { outpValue += '' + this._dates[i].format(this.actualFormat) + this._options.multidateSeparator; } - outpValue = outpValue.replace(/,\s*$/, ''); + outpValue = outpValue.replace(new RegExp(this._options.multidateSeparator + '\\s*$'), ''); } else { outpValue = this._dates[index].format(this.actualFormat); } diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 3c10a4f..2700c87 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+h[this.currentViewMode].CLASS_NAME).show())},_.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},_.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},_.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},_.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},_.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},_.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in u[p]="p",u)u.hasOwnProperty(i)&&"p"===u[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&d[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(d[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},_.prototype._keyup=function(t){u[t.which]="r",f[t.which]&&(f[t.which]=!1,t.stopPropagation(),t.preventDefault())},_.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},_.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},_.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},_.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},_.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},_.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},_.prototype.toggle=function(){return this.widget?this.hide():this.show()},_.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},_.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},_.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},_.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},_.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},_.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},_.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},_.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},_.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},_.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Sat, 2 May 2020 18:25:42 +0200 Subject: [PATCH 27/92] 5.7.1 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f0a93d..d3be4a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.7.0", + "version": "5.7.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6666d04..0d879ff 100644 --- a/package.json +++ b/package.json @@ -61,10 +61,10 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.7.0", + "version": "5.7.1", "files": [ "build", "src/js/**/*.js", "Gruntfile.js" ] -} \ No newline at end of file +} From 8d7ec05bb1cf0cb91422d995107c87539f74ac05 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 3 May 2020 10:41:45 +0200 Subject: [PATCH 28/92] Updated README.md with fork information --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 4bf04a1..9d82526 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +# tempusdominus + +This package is a fork of the original [tempusdominus/core](https://github.com/tempusdominus/core) repo. + +This fork includes bugfixes and comes with updated NPM packages. + +The original README.md follows below this paragraph. + # Tempus Dominus Core ![GitHub version](https://badge.fury.io/gh/tempusdominus%2Fcore.png) From 718d4429f03398d791b18bb634f13de364656f28 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 3 May 2020 13:50:58 +0200 Subject: [PATCH 29/92] Fix for change event listener fired twice and show event listener not fired --- src/js/tempusdominus-core.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/js/tempusdominus-core.js b/src/js/tempusdominus-core.js index 8c4b5b3..abe7243 100644 --- a/src/js/tempusdominus-core.js +++ b/src/js/tempusdominus-core.js @@ -570,8 +570,24 @@ const DateTimePicker = (($, moment) => { return dataOptions; } + _format() { + return this._options.format || 'YYYY-MM-DD HH:mm'; + } + + _areSameDates(a, b) { + const format = this._format(); + return a && b && (a.isSame(b) || (moment(a.format(format)).isSame(b.format(format)))); + } + _notifyEvent(e) { - if ((e.type === DateTimePicker.Event.CHANGE && (e.date && e.date.isSame(e.oldDate)) || !e.date && !e.oldDate)) { + if ( + e.type === DateTimePicker.Event.CHANGE && + ( + (e.date && this._areSameDates(e.date, e.oldDate)) + || + (!e.date && !e.oldDate) + ) + ) { return; } this._element.trigger(e); From f3c2df41def8aeab695978c64f95ef40e2b5927d Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 3 May 2020 13:58:15 +0200 Subject: [PATCH 30/92] Build for event listeners fixes --- build/js/tempusdominus.js | 11 ++++++++++- build/js/tempusdominus.min.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 2cec195..51d984d 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -534,8 +534,17 @@ var DateTimePicker = function ($, moment) { return dataOptions; }; + DateTimePicker.prototype._format = function _format() { + return this._options.format || 'YYYY-MM-DD HH:mm'; + }; + + DateTimePicker.prototype._areSameDates = function _areSameDates(a, b) { + var format = this._format(); + return a && b && (a.isSame(b) || moment(a.format(format)).isSame(b.format(format))); + }; + DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) { - if (e.type === DateTimePicker.Event.CHANGE && e.date && e.date.isSame(e.oldDate) || !e.date && !e.oldDate) { + if (e.type === DateTimePicker.Event.CHANGE && (e.date && this._areSameDates(e.date, e.oldDate) || !e.date && !e.oldDate)) { return; } this._element.trigger(e); diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 2700c87..7507e03 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Sun, 3 May 2020 13:58:35 +0200 Subject: [PATCH 31/92] 5.7.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d3be4a2..1d7e6e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.7.1", + "version": "5.7.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0d879ff..62ae0e9 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.7.1", + "version": "5.7.2", "files": [ "build", "src/js/**/*.js", From d53edb0f106f79fc41423f5de9b8cd0d04f784be Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 3 May 2020 16:44:33 +0200 Subject: [PATCH 32/92] Fix multidate mode when decrementing or incrementing hours/minutes/seconds --- src/js/tempusdominus-core.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/tempusdominus-core.js b/src/js/tempusdominus-core.js index 87096e4..d149d74 100644 --- a/src/js/tempusdominus-core.js +++ b/src/js/tempusdominus-core.js @@ -794,7 +794,11 @@ const DateTimePicker = (($, moment) => { } _getLastPickedDate() { - return this._dates[this._getLastPickedDateIndex()]; + let lastPickedDate = this._dates[this._getLastPickedDateIndex()]; + if (!lastPickedDate && this._options.allowMultidate) { + lastPickedDate = moment(new Date()); + } + return lastPickedDate; } _getLastPickedDateIndex() { From f76bb483d00d0a942e5f47d5440adcb8c120ecac Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 3 May 2020 17:09:28 +0200 Subject: [PATCH 33/92] 5.7.3 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d7e6e5..1c5affb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.7.2", + "version": "5.7.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 62ae0e9..84788cf 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.7.2", + "version": "5.7.3", "files": [ "build", "src/js/**/*.js", From 218f75541f97cd68a189f7a2dcab14d4dc32a444 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 3 May 2020 17:09:41 +0200 Subject: [PATCH 34/92] Next patch version --- build/js/tempusdominus.js | 6 +++++- build/js/tempusdominus.min.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 51d984d..8b8ab71 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -759,7 +759,11 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._getLastPickedDate = function _getLastPickedDate() { - return this._dates[this._getLastPickedDateIndex()]; + var lastPickedDate = this._dates[this._getLastPickedDateIndex()]; + if (!lastPickedDate && this._options.allowMultidate) { + lastPickedDate = moment(new Date()); + } + return lastPickedDate; }; DateTimePicker.prototype._getLastPickedDateIndex = function _getLastPickedDateIndex() { diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 7507e03..39a1132 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Fri, 8 May 2020 15:57:51 -0400 Subject: [PATCH 35/92] Fix momentjs deprecation warning Calling moment() constructor with a string that is not an ISO date triggers a deprecation warning. > Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to moment/moment#1407 for more info. Fixed it by passing the format into the constructor. --- src/js/tempusdominus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index 383e141..d05faac 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -587,7 +587,7 @@ const DateTimePicker = (($, moment) => { _areSameDates(a, b) { const format = this._format(); - return a && b && (a.isSame(b) || (moment(a.format(format)).isSame(b.format(format)))); + return a && b && (a.isSame(b) || moment(a.format(format), format).isSame(moment(b.format(format), format))); } _notifyEvent(e) { From 15b090d1661d61ee13558d56499225f982cdb659 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 8 May 2020 23:32:01 +0200 Subject: [PATCH 36/92] 5.7.4 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1c5affb..10e0754 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.7.3", + "version": "5.7.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 84788cf..ba35e2f 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.7.3", + "version": "5.7.4", "files": [ "build", "src/js/**/*.js", From a1ec25271e1f1bc36c26e88b039055dd49c7d512 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 8 May 2020 23:32:13 +0200 Subject: [PATCH 37/92] Next patch version --- build/js/tempusdominus.js | 2 +- build/js/tempusdominus.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 8b8ab71..5889a87 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -540,7 +540,7 @@ var DateTimePicker = function ($, moment) { DateTimePicker.prototype._areSameDates = function _areSameDates(a, b) { var format = this._format(); - return a && b && (a.isSame(b) || moment(a.format(format)).isSame(b.format(format))); + return a && b && (a.isSame(b) || moment(a.format(format), format).isSame(moment(b.format(format), format))); }; DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) { diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 39a1132..7565a12 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Thu, 14 May 2020 22:22:34 +0200 Subject: [PATCH 38/92] Bugfixes for buttons.showClear option --- build/js/tempusdominus.js | 9 +++++---- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 10 +++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 5889a87..5feaec4 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -108,7 +108,7 @@ var DateTimePicker = function ($, moment) { previous: 'fa fa-chevron-left', next: 'fa fa-chevron-right', today: 'fa fa-calendar-check-o', - clear: 'fa fa-delete', + clear: 'fa fa-trash', close: 'fa fa-times' }, tooltips: { @@ -375,17 +375,18 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._setValue = function _setValue(targetMoment, index) { - var oldDate = this.unset ? null : this._dates[index]; + var oldDate = this.unset ? null : this._dates[index], + isClear = !targetMoment && typeof index === 'undefined'; var outpValue = ''; // case of calling setValue(null or false) if (!targetMoment) { - if (!this._options.allowMultidate || this._dates.length === 1) { + if (!this._options.allowMultidate || this._dates.length === 1 || isClear) { this.unset = true; this._dates = []; this._datesFormatted = []; } else { outpValue = '' + this._element.data('date') + this._options.multidateSeparator; - outpValue = outpValue.replace('' + oldDate.format(this.actualFormat) + this._options.multidateSeparator, '').replace('' + this._options.multidateSeparator + this._options.multidateSeparator, '').replace(new RegExp(escapeRegExp(this._options.multidateSeparator) + '\\s*$'), ''); + outpValue = oldDate && outpValue.replace('' + oldDate.format(this.actualFormat) + this._options.multidateSeparator, '').replace('' + this._options.multidateSeparator + this._options.multidateSeparator, '').replace(new RegExp(escapeRegExp(this._options.multidateSeparator) + '\\s*$'), '') || ''; this._dates.splice(index, 1); this._datesFormatted.splice(index, 1); } diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 7565a12..8ee8865 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e { previous: 'fa fa-chevron-left', next: 'fa fa-chevron-right', today: 'fa fa-calendar-check-o', - clear: 'fa fa-delete', + clear: 'fa fa-trash', close: 'fa fa-times' }, tooltips: { @@ -420,21 +420,21 @@ const DateTimePicker = (($, moment) => { } _setValue(targetMoment, index) { - const oldDate = this.unset ? null : this._dates[index]; + const oldDate = this.unset ? null : this._dates[index], isClear = !targetMoment && (typeof index === 'undefined'); let outpValue = ''; // case of calling setValue(null or false) if (!targetMoment) { - if (!this._options.allowMultidate || this._dates.length === 1) { + if (!this._options.allowMultidate || this._dates.length === 1 || isClear) { this.unset = true; this._dates = []; this._datesFormatted = []; } else { outpValue = `${this._element.data('date')}${this._options.multidateSeparator}`; - outpValue = outpValue.replace( + outpValue = (oldDate && outpValue.replace( `${oldDate.format(this.actualFormat)}${this._options.multidateSeparator}`, '' ) .replace(`${this._options.multidateSeparator}${this._options.multidateSeparator}`, '') - .replace(new RegExp(`${escapeRegExp(this._options.multidateSeparator)}\\s*$`), ''); + .replace(new RegExp(`${escapeRegExp(this._options.multidateSeparator)}\\s*$`), '')) || ''; this._dates.splice(index, 1); this._datesFormatted.splice(index, 1); } From e8431e18a15d39211d63834eec45b9e1ea216178 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Thu, 14 May 2020 22:22:45 +0200 Subject: [PATCH 39/92] 5.7.5 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 10e0754..dc433c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.7.4", + "version": "5.7.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ba35e2f..048673b 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.7.4", + "version": "5.7.5", "files": [ "build", "src/js/**/*.js", From 7d53cbe7a8c06ec3178e56c5fc32a739eecb2bd8 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 15 May 2020 07:10:35 +0200 Subject: [PATCH 40/92] Bugfix for clear date/dates event not firing when buttons.showClear is true --- src/js/tempusdominus.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index 58518ff..722fe40 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -447,7 +447,8 @@ const DateTimePicker = (($, moment) => { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: false, - oldDate: oldDate + oldDate: oldDate, + isClear }); this._update(); return; @@ -487,7 +488,8 @@ const DateTimePicker = (($, moment) => { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: this._dates[index].clone(), - oldDate: oldDate + oldDate: oldDate, + isClear }); } else { if (!this._options.keepInvalid) { @@ -499,7 +501,8 @@ const DateTimePicker = (($, moment) => { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: targetMoment, - oldDate: oldDate + oldDate: oldDate, + isClear }); } this._notifyEvent({ @@ -596,7 +599,7 @@ const DateTimePicker = (($, moment) => { ( (e.date && this._areSameDates(e.date, e.oldDate)) || - (!e.date && !e.oldDate) + (!e.isClear && !e.date && !e.oldDate) ) ) { return; From 8fe51aec3430dfd3a7db41c4086edc2f42e922cb Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 15 May 2020 07:11:22 +0200 Subject: [PATCH 41/92] 5.7.6 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index dc433c5..b2e747c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.7.5", + "version": "5.7.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 048673b..58fa767 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.7.5", + "version": "5.7.6", "files": [ "build", "src/js/**/*.js", From 944f2e62c98be26711cdb99603ca449790d8f01b Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 15 May 2020 07:11:30 +0200 Subject: [PATCH 42/92] Next patch version --- build/js/tempusdominus.js | 11 +++++++---- build/js/tempusdominus.min.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 5feaec4..0d30032 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -399,7 +399,8 @@ var DateTimePicker = function ($, moment) { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: false, - oldDate: oldDate + oldDate: oldDate, + isClear: isClear }); this._update(); return; @@ -439,7 +440,8 @@ var DateTimePicker = function ($, moment) { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: this._dates[index].clone(), - oldDate: oldDate + oldDate: oldDate, + isClear: isClear }); } else { if (!this._options.keepInvalid) { @@ -451,7 +453,8 @@ var DateTimePicker = function ($, moment) { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: targetMoment, - oldDate: oldDate + oldDate: oldDate, + isClear: isClear }); } this._notifyEvent({ @@ -545,7 +548,7 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) { - if (e.type === DateTimePicker.Event.CHANGE && (e.date && this._areSameDates(e.date, e.oldDate) || !e.date && !e.oldDate)) { + if (e.type === DateTimePicker.Event.CHANGE && (e.date && this._areSameDates(e.date, e.oldDate) || !e.isClear && !e.date && !e.oldDate)) { return; } this._element.trigger(e); diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 8ee8865..cfa7fe9 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Fri, 15 May 2020 21:38:27 +0200 Subject: [PATCH 43/92] Bugfixes for date option --- src/js/tempusdominus.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index 722fe40..896c933 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -7,6 +7,14 @@ const DateTimePicker = (($, moment) => { return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); } + function isValidDate(date) { + return Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime()); + } + + function isValidDateTimeStr(str) { + return isValidDate(new Date(str)); + } + // ReSharper disable InconsistentNaming const trim = str => str.replace(/(^\s+)|(\s+$)/g, ''), NAME = 'datetimepicker', @@ -399,7 +407,9 @@ const DateTimePicker = (($, moment) => { this.options(this._options); + this.isInitFormatting = true; this._initFormatting(); + this.isInitFormatting = false; if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) { this._setValue(this._parseInputDate(this.input.val().trim()), 0); @@ -785,7 +795,7 @@ const DateTimePicker = (($, moment) => { const format = this._options.format || 'L LT', self = this; this.actualFormat = format.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) { - return self._dates[0].localeData().longDateFormat(formatInput) || formatInput; //todo taking the first date should be ok + return ((self.isInitFormatting && self._options.date === null ? moment() : self._dates[0]).localeData().longDateFormat(formatInput)) || formatInput; //todo taking the first date should be ok }); this.parseFormats = this._options.extraFormats ? this._options.extraFormats.slice() : []; @@ -894,6 +904,10 @@ const DateTimePicker = (($, moment) => { throw new TypeError('date() parameter must be one of [null, string, moment or Date]'); } + if (typeof newDate === 'string' && isValidDateTimeStr(newDate)) { + newDate = new Date(newDate); + } + this._setValue(newDate === null ? null : this._parseInputDate(newDate), index); } From 78c8a272c880d1e2f79d30661de9201d35f9e100 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 15 May 2020 21:38:40 +0200 Subject: [PATCH 44/92] 5.7.7 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b2e747c..4259137 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.7.6", + "version": "5.7.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 58fa767..47760ea 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.7.6", + "version": "5.7.7", "files": [ "build", "src/js/**/*.js", From 7a54b70c032bbdb10a82ed8c4b33c0e7953ecbd0 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 15 May 2020 21:38:48 +0200 Subject: [PATCH 45/92] Next patch version --- build/js/tempusdominus.js | 16 +++++++++++++++- build/js/tempusdominus.min.js | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 0d30032..d4a8a92 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -8,6 +8,14 @@ var DateTimePicker = function ($, moment) { return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); } + function isValidDate(date) { + return Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime()); + } + + function isValidDateTimeStr(str) { + return isValidDate(new Date(str)); + } + // ReSharper disable InconsistentNaming var trim = function trim(str) { return str.replace(/(^\s+)|(\s+$)/g, ''); @@ -354,7 +362,9 @@ var DateTimePicker = function ($, moment) { this.options(this._options); + this.isInitFormatting = true; this._initFormatting(); + this.isInitFormatting = false; if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) { this._setValue(this._parseInputDate(this.input.val().trim()), 0); @@ -735,7 +745,7 @@ var DateTimePicker = function ($, moment) { self = this; this.actualFormat = format.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) { - return self._dates[0].localeData().longDateFormat(formatInput) || formatInput; //todo taking the first date should be ok + return (self.isInitFormatting && self._options.date === null ? moment() : self._dates[0]).localeData().longDateFormat(formatInput) || formatInput; //todo taking the first date should be ok }); this.parseFormats = this._options.extraFormats ? this._options.extraFormats.slice() : []; @@ -845,6 +855,10 @@ var DateTimePicker = function ($, moment) { throw new TypeError('date() parameter must be one of [null, string, moment or Date]'); } + if (typeof newDate === 'string' && isValidDateTimeStr(newDate)) { + newDate = new Date(newDate); + } + this._setValue(newDate === null ? null : this._parseInputDate(newDate), index); }; diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index cfa7fe9..7d4fe1f 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},m.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},m.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},m.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},m.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},m.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},m.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},m.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},m.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},m.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},m.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},m.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},m.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},m.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},m.prototype.toggle=function(){return this.widget?this.hide():this.show()},m.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},m.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},m.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},m.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},m.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},m.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},m.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},m.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},m.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},m.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},y.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},y.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},y.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},y.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},y.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},y.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},y.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},y.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},y.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},y.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},y.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},y.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},y.prototype.toggle=function(){return this.widget?this.hide():this.show()},y.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},y.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},y.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},y.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},y.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},y.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},y.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},y.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},y.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},y.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Sat, 16 May 2020 12:37:09 +0200 Subject: [PATCH 46/92] Added 'updateOnlyThroughDateOption' option and 'isDateUpdateThroughDateOptionFromClientCode' property --- build/js/tempusdominus.js | 54 +++++++++++++++++++++++++++++++---- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 53 ++++++++++++++++++++++++++++++---- 3 files changed, 96 insertions(+), 13 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index d4a8a92..c6ea1da 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -303,7 +303,8 @@ var DateTimePicker = function ($, moment) { enabledHours: false, viewDate: false, allowMultidate: false, - multidateSeparator: ', ' + multidateSeparator: ', ', + updateOnlyThroughDateOption: false }; // ReSharper restore InconsistentNaming @@ -331,6 +332,7 @@ var DateTimePicker = function ($, moment) { this.parseFormats = null; this.currentViewMode = null; this.MinViewModeNumber = 0; + this.isDateUpdateThroughDateOptionFromClientCode = false; this._int(); } @@ -386,10 +388,24 @@ var DateTimePicker = function ($, moment) { DateTimePicker.prototype._setValue = function _setValue(targetMoment, index) { var oldDate = this.unset ? null : this._dates[index], - isClear = !targetMoment && typeof index === 'undefined'; - var outpValue = ''; + isClear = !targetMoment && typeof index === 'undefined', + isDateUpdateThroughDateOptionFromClientCode = this.isDateUpdateThroughDateOptionFromClientCode; + var outpValue = '', + isInvalid = false; + // case of calling setValue(null or false) if (!targetMoment) { + if (this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode) { + this._notifyEvent({ + type: DateTimePicker.Event.CHANGE, + date: targetMoment, + oldDate: oldDate, + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode + }); + return; + } if (!this._options.allowMultidate || this._dates.length === 1 || isClear) { this.unset = true; this._dates = []; @@ -410,7 +426,9 @@ var DateTimePicker = function ($, moment) { type: DateTimePicker.Event.CHANGE, date: false, oldDate: oldDate, - isClear: isClear + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode }); this._update(); return; @@ -427,6 +445,17 @@ var DateTimePicker = function ($, moment) { } if (this._isValid(targetMoment)) { + if (this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode) { + this._notifyEvent({ + type: DateTimePicker.Event.CHANGE, + date: targetMoment.clone(), + oldDate: oldDate, + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode + }); + return; + } this._dates[index] = targetMoment; this._datesFormatted[index] = targetMoment.format('YYYY-MM-DD'); this._viewDate = targetMoment.clone(); @@ -451,9 +480,12 @@ var DateTimePicker = function ($, moment) { type: DateTimePicker.Event.CHANGE, date: this._dates[index].clone(), oldDate: oldDate, - isClear: isClear + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode }); } else { + isInvalid = true; if (!this._options.keepInvalid) { if (this.input !== undefined) { this.input.val('' + (this.unset ? '' : this._dates[index].format(this.actualFormat))); @@ -464,7 +496,9 @@ var DateTimePicker = function ($, moment) { type: DateTimePicker.Event.CHANGE, date: targetMoment, oldDate: oldDate, - isClear: isClear + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode }); } this._notifyEvent({ @@ -862,6 +896,14 @@ var DateTimePicker = function ($, moment) { this._setValue(newDate === null ? null : this._parseInputDate(newDate), index); }; + DateTimePicker.prototype.updateOnlyThroughDateOption = function updateOnlyThroughDateOption(_updateOnlyThroughDateOption) { + if (typeof _updateOnlyThroughDateOption !== 'boolean') { + throw new TypeError('updateOnlyThroughDateOption() expects a boolean parameter'); + } + + this._options.updateOnlyThroughDateOption = _updateOnlyThroughDateOption; + }; + DateTimePicker.prototype.format = function format(newFormat) { if (arguments.length === 0) { return this._options.format; diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 7d4fe1f..c7ee87f 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},y.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},y.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},y.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},y.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},y.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},y.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},y.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},y.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},y.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},y.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},y.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},y.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},y.prototype.toggle=function(){return this.widget?this.hide():this.show()},y.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},y.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},y.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},y.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},y.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},y.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},y.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},y.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},y.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},y.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},y.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},y.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},y.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},y.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},y.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,n=void 0,s=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(n=i.split(" ")).length===a.length&&u[p]===n[n.length-1]){for(s=!0,o=n.length-2;0<=o;o--)if(!(u[n[o]]in r)){s=!1;break}if(s){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},y.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},y.prototype._indexGivenDates=function(t){var e={},i=this;return n.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},y.prototype._indexGivenHours=function(t){var e={};return n.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},y.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},y.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},y.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},y.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},y.prototype.toggle=function(){return this.widget?this.hide():this.show()},y.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},y.prototype.options=function(t){if(0===arguments.length)return n.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");n.extend(!0,this._options,t);var i=this;n.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},y.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},y.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},y.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},y.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},y.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},y.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},y.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?n.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},y.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?n.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},y.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e { enabledHours: false, viewDate: false, allowMultidate: false, - multidateSeparator: ', ' + multidateSeparator: ', ', + updateOnlyThroughDateOption: false }; // ReSharper restore InconsistentNaming @@ -325,6 +326,7 @@ const DateTimePicker = (($, moment) => { this.parseFormats = null; this.currentViewMode = null; this.MinViewModeNumber = 0; + this.isDateUpdateThroughDateOptionFromClientCode = false; this._int(); } @@ -430,10 +432,23 @@ const DateTimePicker = (($, moment) => { } _setValue(targetMoment, index) { - const oldDate = this.unset ? null : this._dates[index], isClear = !targetMoment && (typeof index === 'undefined'); - let outpValue = ''; + const oldDate = this.unset ? null : this._dates[index], isClear = !targetMoment && (typeof index === 'undefined'), + isDateUpdateThroughDateOptionFromClientCode = this.isDateUpdateThroughDateOptionFromClientCode; + let outpValue = '', isInvalid = false; + // case of calling setValue(null or false) if (!targetMoment) { + if (this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode) { + this._notifyEvent({ + type: DateTimePicker.Event.CHANGE, + date: targetMoment, + oldDate: oldDate, + isClear, + isInvalid, + isDateUpdateThroughDateOptionFromClientCode + }); + return; + } if (!this._options.allowMultidate || this._dates.length === 1 || isClear) { this.unset = true; this._dates = []; @@ -458,7 +473,9 @@ const DateTimePicker = (($, moment) => { type: DateTimePicker.Event.CHANGE, date: false, oldDate: oldDate, - isClear + isClear, + isInvalid, + isDateUpdateThroughDateOptionFromClientCode }); this._update(); return; @@ -475,6 +492,17 @@ const DateTimePicker = (($, moment) => { } if (this._isValid(targetMoment)) { + if (this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode) { + this._notifyEvent({ + type: DateTimePicker.Event.CHANGE, + date: targetMoment.clone(), + oldDate: oldDate, + isClear, + isInvalid, + isDateUpdateThroughDateOptionFromClientCode + }); + return; + } this._dates[index] = targetMoment; this._datesFormatted[index] = targetMoment.format('YYYY-MM-DD'); this._viewDate = targetMoment.clone(); @@ -499,9 +527,12 @@ const DateTimePicker = (($, moment) => { type: DateTimePicker.Event.CHANGE, date: this._dates[index].clone(), oldDate: oldDate, - isClear + isClear, + isInvalid, + isDateUpdateThroughDateOptionFromClientCode }); } else { + isInvalid = true; if (!this._options.keepInvalid) { if (this.input !== undefined) { this.input.val(`${this.unset ? '' : this._dates[index].format(this.actualFormat)}`); @@ -512,7 +543,9 @@ const DateTimePicker = (($, moment) => { type: DateTimePicker.Event.CHANGE, date: targetMoment, oldDate: oldDate, - isClear + isClear, + isInvalid, + isDateUpdateThroughDateOptionFromClientCode }); } this._notifyEvent({ @@ -911,6 +944,14 @@ const DateTimePicker = (($, moment) => { this._setValue(newDate === null ? null : this._parseInputDate(newDate), index); } + updateOnlyThroughDateOption(updateOnlyThroughDateOption) { + if (typeof updateOnlyThroughDateOption !== 'boolean') { + throw new TypeError('updateOnlyThroughDateOption() expects a boolean parameter'); + } + + this._options.updateOnlyThroughDateOption = updateOnlyThroughDateOption; + } + format(newFormat) { if (arguments.length === 0) { return this._options.format; From 55adc215c7affe74226de5a519d3aabd5251bd4b Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sat, 16 May 2020 12:37:21 +0200 Subject: [PATCH 47/92] 5.8.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4259137..5b68d0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.7.7", + "version": "5.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 47760ea..e97b511 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.7.7", + "version": "5.8.0", "files": [ "build", "src/js/**/*.js", From 8192a9bf31bd5e4c67e8650deb3a77e42b62f64b Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sat, 16 May 2020 13:09:24 +0200 Subject: [PATCH 48/92] Bugfix for initial date option setting when initializing the picker with updateOnlyThroughDateOption option set to true --- build/js/tempusdominus.js | 11 ++++++++--- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 11 ++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index c6ea1da..92d8b05 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -332,6 +332,8 @@ var DateTimePicker = function ($, moment) { this.parseFormats = null; this.currentViewMode = null; this.MinViewModeNumber = 0; + this.isInitFormatting = false; + this.isInit = false; this.isDateUpdateThroughDateOptionFromClientCode = false; this._int(); @@ -345,6 +347,7 @@ var DateTimePicker = function ($, moment) { //private DateTimePicker.prototype._int = function _int() { + this.isInit = true; var targetInput = this._element.data('target-input'); if (this._element.is('input')) { this.input = this._element; @@ -376,6 +379,7 @@ var DateTimePicker = function ($, moment) { if (this._options.inline) { this.show(); } + this.isInit = false; }; DateTimePicker.prototype._update = function _update() { @@ -389,13 +393,14 @@ var DateTimePicker = function ($, moment) { DateTimePicker.prototype._setValue = function _setValue(targetMoment, index) { var oldDate = this.unset ? null : this._dates[index], isClear = !targetMoment && typeof index === 'undefined', - isDateUpdateThroughDateOptionFromClientCode = this.isDateUpdateThroughDateOptionFromClientCode; + isDateUpdateThroughDateOptionFromClientCode = this.isDateUpdateThroughDateOptionFromClientCode, + isNotAllowedProgrammaticUpdate = !this.isInit && this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode; var outpValue = '', isInvalid = false; // case of calling setValue(null or false) if (!targetMoment) { - if (this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode) { + if (isNotAllowedProgrammaticUpdate) { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: targetMoment, @@ -445,7 +450,7 @@ var DateTimePicker = function ($, moment) { } if (this._isValid(targetMoment)) { - if (this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode) { + if (isNotAllowedProgrammaticUpdate) { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: targetMoment.clone(), diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index c7ee87f..41c7c2d 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},y.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},y.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},y.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},y.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},y.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,n=void 0,s=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(n=i.split(" ")).length===a.length&&u[p]===n[n.length-1]){for(s=!0,o=n.length-2;0<=o;o--)if(!(u[n[o]]in r)){s=!1;break}if(s){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},y.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},y.prototype._indexGivenDates=function(t){var e={},i=this;return n.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},y.prototype._indexGivenHours=function(t){var e={};return n.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},y.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},y.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},y.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},y.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},y.prototype.toggle=function(){return this.widget?this.hide():this.show()},y.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},y.prototype.options=function(t){if(0===arguments.length)return n.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");n.extend(!0,this._options,t);var i=this;n.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},y.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},y.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},y.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},y.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},y.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},y.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},y.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?n.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},y.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?n.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},y.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},y.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},y.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},y.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},y.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},y.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},y.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},y.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},y.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},y.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},y.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},y.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},y.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},y.prototype.toggle=function(){return this.widget?this.hide():this.show()},y.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},y.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},y.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},y.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},y.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},y.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},y.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},y.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},y.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},y.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},y.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e { this.parseFormats = null; this.currentViewMode = null; this.MinViewModeNumber = 0; + this.isInitFormatting = false; + this.isInit = false; this.isDateUpdateThroughDateOptionFromClientCode = false; this._int(); @@ -390,6 +392,7 @@ const DateTimePicker = (($, moment) => { //private _int() { + this.isInit = true; const targetInput = this._element.data('target-input'); if (this._element.is('input')) { this.input = this._element; @@ -421,6 +424,7 @@ const DateTimePicker = (($, moment) => { if (this._options.inline) { this.show(); } + this.isInit = false; } _update() { @@ -433,12 +437,13 @@ const DateTimePicker = (($, moment) => { _setValue(targetMoment, index) { const oldDate = this.unset ? null : this._dates[index], isClear = !targetMoment && (typeof index === 'undefined'), - isDateUpdateThroughDateOptionFromClientCode = this.isDateUpdateThroughDateOptionFromClientCode; + isDateUpdateThroughDateOptionFromClientCode = this.isDateUpdateThroughDateOptionFromClientCode, + isNotAllowedProgrammaticUpdate = !this.isInit && this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode; let outpValue = '', isInvalid = false; // case of calling setValue(null or false) if (!targetMoment) { - if (this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode) { + if (isNotAllowedProgrammaticUpdate) { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: targetMoment, @@ -492,7 +497,7 @@ const DateTimePicker = (($, moment) => { } if (this._isValid(targetMoment)) { - if (this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode) { + if (isNotAllowedProgrammaticUpdate) { this._notifyEvent({ type: DateTimePicker.Event.CHANGE, date: targetMoment.clone(), From 4ff9eb90049e5d7a88829a6996c72b6e9407556f Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sat, 16 May 2020 13:09:30 +0200 Subject: [PATCH 49/92] 5.8.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5b68d0b..1d31830 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.8.0", + "version": "5.8.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e97b511..cde66b4 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.8.0", + "version": "5.8.1", "files": [ "build", "src/js/**/*.js", From ea8406b750f033eecf2e1a88413a0195aef593c3 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sat, 16 May 2020 17:01:32 +0200 Subject: [PATCH 50/92] Added isInit property to change event --- src/js/tempusdominus.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index bbcc33f..9f7947e 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -450,7 +450,8 @@ const DateTimePicker = (($, moment) => { oldDate: oldDate, isClear, isInvalid, - isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); return; } @@ -480,7 +481,8 @@ const DateTimePicker = (($, moment) => { oldDate: oldDate, isClear, isInvalid, - isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); this._update(); return; @@ -504,7 +506,8 @@ const DateTimePicker = (($, moment) => { oldDate: oldDate, isClear, isInvalid, - isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); return; } @@ -534,7 +537,8 @@ const DateTimePicker = (($, moment) => { oldDate: oldDate, isClear, isInvalid, - isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); } else { isInvalid = true; @@ -550,7 +554,8 @@ const DateTimePicker = (($, moment) => { oldDate: oldDate, isClear, isInvalid, - isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); } this._notifyEvent({ From 833e0b01b6ce26c3bb4ff02277eacc7cde3f222f Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sat, 16 May 2020 17:01:41 +0200 Subject: [PATCH 51/92] 5.9.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d31830..6f48909 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.8.1", + "version": "5.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cde66b4..ca9640f 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.8.1", + "version": "5.9.0", "files": [ "build", "src/js/**/*.js", From ebffadbfbda7724aa34618781acde8e5fa526806 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sat, 16 May 2020 17:01:54 +0200 Subject: [PATCH 52/92] Next minor version --- build/js/tempusdominus.js | 15 ++++++++++----- build/js/tempusdominus.min.js | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 92d8b05..09ff9ff 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -407,7 +407,8 @@ var DateTimePicker = function ($, moment) { oldDate: oldDate, isClear: isClear, isInvalid: isInvalid, - isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); return; } @@ -433,7 +434,8 @@ var DateTimePicker = function ($, moment) { oldDate: oldDate, isClear: isClear, isInvalid: isInvalid, - isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); this._update(); return; @@ -457,7 +459,8 @@ var DateTimePicker = function ($, moment) { oldDate: oldDate, isClear: isClear, isInvalid: isInvalid, - isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); return; } @@ -487,7 +490,8 @@ var DateTimePicker = function ($, moment) { oldDate: oldDate, isClear: isClear, isInvalid: isInvalid, - isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); } else { isInvalid = true; @@ -503,7 +507,8 @@ var DateTimePicker = function ($, moment) { oldDate: oldDate, isClear: isClear, isInvalid: isInvalid, - isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit }); } this._notifyEvent({ diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 41c7c2d..79c4beb 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},y.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},y.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},y.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},y.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},y.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},y.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},y.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},y.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},y.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},y.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},y.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},y.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},y.prototype.toggle=function(){return this.widget?this.hide():this.show()},y.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},y.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},y.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},y.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},y.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},y.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},y.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},y.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},y.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},y.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},y.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},y.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},y.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},y.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},y.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},y.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},y.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},y.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},y.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},y.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},y.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},y.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},y.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},y.prototype.toggle=function(){return this.widget?this.hide():this.show()},y.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},y.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},y.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},y.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},y.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},y.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},y.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},y.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},y.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},y.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},y.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Sun, 17 May 2020 08:47:53 +0200 Subject: [PATCH 53/92] Bugfix for moment warning when using extraFormats option with date option on init --- build/js/tempusdominus.js | 81 +++++++++++++++++++++++++++++++-- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 85 +++++++++++++++++++++++++++++++++-- 3 files changed, 161 insertions(+), 7 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 09ff9ff..43fd742 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -92,7 +92,67 @@ var DateTimePicker = function ($, moment) { }, ViewModes = ['times', 'days', 'months', 'years', 'decades'], keyState = {}, - keyPressHandled = {}; + keyPressHandled = {}, + optionsSortMap = { + timeZone: -39, + format: -38, + dayViewHeaderFormat: -37, + extraFormats: -36, + stepping: -35, + minDate: -34, + maxDate: -33, + useCurrent: -32, + collapse: -31, + locale: -30, + defaultDate: -29, + disabledDates: -28, + enabledDates: -27, + icons: -26, + tooltips: -25, + useStrict: -24, + sideBySide: -23, + daysOfWeekDisabled: -22, + calendarWeeks: -21, + viewMode: -20, + toolbarPlacement: -19, + buttons: -18, + widgetPositioning: -17, + widgetParent: -16, + ignoreReadonly: -15, + keepOpen: -14, + focusOnShow: -13, + inline: -12, + keepInvalid: -11, + keyBinds: -10, + debug: -9, + allowInputToggle: -8, + disabledTimeIntervals: -7, + disabledHours: -6, + enabledHours: -5, + viewDate: -4, + allowMultidate: -3, + multidateSeparator: -2, + updateOnlyThroughDateOption: -1, + date: 1 + }; + + function optionsSortFn(optionKeyA, optionKeyB) { + if (optionsSortMap[optionKeyA] && optionsSortMap[optionKeyB]) { + if (optionsSortMap[optionKeyA] < 0 && optionsSortMap[optionKeyB] < 0) { + return Math.abs(optionsSortMap[optionKeyB]) - Math.abs(optionsSortMap[optionKeyA]); + } else if (optionsSortMap[optionKeyA] < 0) { + return -1; + } else if (optionsSortMap[optionKeyB] < 0) { + return 1; + } + return optionsSortMap[optionKeyA] - optionsSortMap[optionKeyB]; + } else if (optionsSortMap[optionKeyA]) { + return optionsSortMap[optionKeyA]; + } else if (optionsSortMap[optionKeyB]) { + return optionsSortMap[optionKeyB]; + } + return 0; + } var Default = { timeZone: '', @@ -335,6 +395,8 @@ var DateTimePicker = function ($, moment) { this.isInitFormatting = false; this.isInit = false; this.isDateUpdateThroughDateOptionFromClientCode = false; + this.hasInitDate = false; + this.initDate = void 0; this._int(); } @@ -365,12 +427,18 @@ var DateTimePicker = function ($, moment) { $.extend(true, this._options, this._dataToOptions()); + this.hasInitDate = false; + this.initDate = void 0; this.options(this._options); this.isInitFormatting = true; this._initFormatting(); this.isInitFormatting = false; + if (this.hasInitDate) { + this.date(this.initDate); + } + if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) { this._setValue(this._parseInputDate(this.input.val().trim()), 0); } else if (this._options.defaultDate && this.input !== undefined && this.input.attr('placeholder') === undefined) { @@ -874,9 +942,16 @@ var DateTimePicker = function ($, moment) { throw new TypeError('options() this.options parameter should be an object'); } $.extend(true, this._options, newOptions); - var self = this; - $.each(this._options, function (key, value) { + var self = this, + optionsKeys = Object.keys(this._options).sort(optionsSortFn); + $.each(optionsKeys, function (i, key) { + var value = self._options[key]; if (self[key] !== undefined) { + if (self.isInit && key === 'date') { + self.hasInitDate = true; + self.initDate = value; + return; + } self[key](value); } }); diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 79c4beb..3af0379 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},y.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},y.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},y.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},y.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},y.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},y.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},y.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},y.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},y.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},y.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},y.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},y.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},y.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},y.prototype.toggle=function(){return this.widget?this.hide():this.show()},y.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},y.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},y.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},y.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},y.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},y.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},y.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},y.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},y.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},y.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},y.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);s.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e { }, ViewModes = ['times', 'days', 'months', 'years', 'decades'], keyState = {}, - keyPressHandled = {}; + keyPressHandled = {}, + optionsSortMap = { + timeZone: -39, + format: -38, + dayViewHeaderFormat: -37, + extraFormats: -36, + stepping: -35, + minDate: -34, + maxDate: -33, + useCurrent: -32, + collapse: -31, + locale: -30, + defaultDate: -29, + disabledDates: -28, + enabledDates: -27, + icons: -26, + tooltips: -25, + useStrict: -24, + sideBySide: -23, + daysOfWeekDisabled: -22, + calendarWeeks: -21, + viewMode: -20, + toolbarPlacement: -19, + buttons: -18, + widgetPositioning: -17, + widgetParent: -16, + ignoreReadonly: -15, + keepOpen: -14, + focusOnShow: -13, + inline: -12, + keepInvalid: -11, + keyBinds: -10, + debug: -9, + allowInputToggle: -8, + disabledTimeIntervals: -7, + disabledHours: -6, + enabledHours: -5, + viewDate: -4, + allowMultidate: -3, + multidateSeparator: -2, + updateOnlyThroughDateOption: -1, + date: 1 + }; + + function optionsSortFn(optionKeyA, optionKeyB) { + if (optionsSortMap[optionKeyA] && optionsSortMap[optionKeyB]) { + if (optionsSortMap[optionKeyA] < 0 && optionsSortMap[optionKeyB] < 0) { + return Math.abs(optionsSortMap[optionKeyB]) - Math.abs(optionsSortMap[optionKeyA]); + } + else if (optionsSortMap[optionKeyA] < 0) { + return -1; + } + else if (optionsSortMap[optionKeyB] < 0) { + return 1; + } + return optionsSortMap[optionKeyA] - optionsSortMap[optionKeyB]; + } + else if (optionsSortMap[optionKeyA]) { + return optionsSortMap[optionKeyA]; + } + else if (optionsSortMap[optionKeyB]) { + return optionsSortMap[optionKeyB]; + } + return 0; + } let Default = { timeZone: '', @@ -329,6 +393,8 @@ const DateTimePicker = (($, moment) => { this.isInitFormatting = false; this.isInit = false; this.isDateUpdateThroughDateOptionFromClientCode = false; + this.hasInitDate = false; + this.initDate = void 0; this._int(); } @@ -410,12 +476,18 @@ const DateTimePicker = (($, moment) => { $.extend(true, this._options, this._dataToOptions()); + this.hasInitDate = false; + this.initDate = void 0; this.options(this._options); this.isInitFormatting = true; this._initFormatting(); this.isInitFormatting = false; + if (this.hasInitDate) { + this.date(this.initDate); + } + if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) { this._setValue(this._parseInputDate(this.input.val().trim()), 0); } else if (this._options.defaultDate && this.input !== undefined && this.input.attr('placeholder') === undefined) { @@ -921,9 +993,16 @@ const DateTimePicker = (($, moment) => { throw new TypeError('options() this.options parameter should be an object'); } $.extend(true, this._options, newOptions); - const self = this; - $.each(this._options, function (key, value) { + const self = this, + optionsKeys = Object.keys(this._options).sort(optionsSortFn); + $.each(optionsKeys, function (i, key) { + const value = self._options[key]; if (self[key] !== undefined) { + if (self.isInit && key === 'date') { + self.hasInitDate = true; + self.initDate = value; + return; + } self[key](value); } }); From e52650010680f415e9ece398cf0daac2ac713c36 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 17 May 2020 08:48:02 +0200 Subject: [PATCH 54/92] 5.9.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f48909..7d9d201 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.9.0", + "version": "5.9.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ca9640f..c545a3d 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.9.0", + "version": "5.9.1", "files": [ "build", "src/js/**/*.js", From 489eaa8362ef7a0df178872eb8f54d200db3031c Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 17 May 2020 12:35:29 +0200 Subject: [PATCH 55/92] Added readonly option --- src/js/tempusdominus.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index 4ff4c68..8f56f95 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -224,6 +224,7 @@ const DateTimePicker = (($, moment) => { vertical: 'auto' }, widgetParent: null, + readonly: false, ignoreReadonly: false, keepOpen: false, focusOnShow: true, From dfdd91a6aa1fdadc9a999d7e7f05f0a1de96a038 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 17 May 2020 12:35:36 +0200 Subject: [PATCH 56/92] 5.10.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7d9d201..06efc33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.9.1", + "version": "5.10.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c545a3d..1aa3c38 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.9.1", + "version": "5.10.0", "files": [ "build", "src/js/**/*.js", From 88e806abdb68b9ecd9bff551303f71525b55de30 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 17 May 2020 12:35:49 +0200 Subject: [PATCH 57/92] Next minor version --- build/js/tempusdominus.js | 1 + build/js/tempusdominus.min.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 43fd742..f5c8518 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -223,6 +223,7 @@ var DateTimePicker = function ($, moment) { vertical: 'auto' }, widgetParent: null, + readonly: false, ignoreReadonly: false, keepOpen: false, focusOnShow: true, diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 3af0379..00bd84c 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);s.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);s.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Sun, 17 May 2020 14:10:03 +0200 Subject: [PATCH 58/92] Bugfix: Added missing readonly method which allows setting the readonly property on the picker programmatically --- build/js/tempusdominus.js | 19 ++++++++++++++++++- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 20 +++++++++++++++++++- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index f5c8518..1b0b615 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -924,12 +924,29 @@ var DateTimePicker = function ($, moment) { return this.widget ? this.hide() : this.show(); }; + DateTimePicker.prototype.readonly = function readonly(_readonly) { + if (arguments.length === 0) { + return this._options.readonly; + } + if (typeof _readonly !== 'boolean') { + throw new TypeError('readonly() expects a boolean parameter'); + } + this._options.readonly = _readonly; + if (this.input !== undefined) { + this.input.prop('readonly', this._options.readonly); + } + if (this.widget) { + this.hide(); + this.show(); + } + }; + DateTimePicker.prototype.ignoreReadonly = function ignoreReadonly(_ignoreReadonly) { if (arguments.length === 0) { return this._options.ignoreReadonly; } if (typeof _ignoreReadonly !== 'boolean') { - throw new TypeError('ignoreReadonly () expects a boolean parameter'); + throw new TypeError('ignoreReadonly() expects a boolean parameter'); } this._options.ignoreReadonly = _ignoreReadonly; }; diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 00bd84c..f3cbe05 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);s.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.readonly=function(t){if(0===arguments.length)return this._options.readonly;if("boolean"!=typeof t)throw new TypeError("readonly() expects a boolean parameter");this._options.readonly=t,void 0!==this.input&&this.input.prop("readonly",this._options.readonly),this.widget&&(this.hide(),this.show())},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly() expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);s.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e { return this.widget ? this.hide() : this.show(); } + readonly(readonly) { + if (arguments.length === 0) { + return this._options.readonly; + } + if (typeof readonly !== 'boolean') { + throw new TypeError('readonly() expects a boolean parameter'); + } + this._options.readonly = readonly; + if (this.input !== undefined) { + this.input.prop('readonly', this._options.readonly); + } + if (this.widget) { + this.hide(); + this.show(); + } + } + + ignoreReadonly(ignoreReadonly) { if (arguments.length === 0) { return this._options.ignoreReadonly; } if (typeof ignoreReadonly !== 'boolean') { - throw new TypeError('ignoreReadonly () expects a boolean parameter'); + throw new TypeError('ignoreReadonly() expects a boolean parameter'); } this._options.ignoreReadonly = ignoreReadonly; } From 3a6799bea9acef4ea3f8aad170f47cd92ed967f0 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 17 May 2020 14:10:12 +0200 Subject: [PATCH 59/92] 5.10.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 06efc33..b0e6653 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.10.0", + "version": "5.10.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1aa3c38..509f993 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.10.0", + "version": "5.10.1", "files": [ "build", "src/js/**/*.js", From 15a280507f5277b31b0b3319ab1edc7c19a000fb Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 19 May 2020 00:35:03 +0200 Subject: [PATCH 60/92] Bugfix/patch for max call stack error in case of picker with input and without button --- src/js/tempusdominus.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index 42f4375..3097639 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -396,6 +396,7 @@ const DateTimePicker = (($, moment) => { this.isDateUpdateThroughDateOptionFromClientCode = false; this.hasInitDate = false; this.initDate = void 0; + this._notifyChangeEventContext = void 0; this._int(); } @@ -720,17 +721,21 @@ const DateTimePicker = (($, moment) => { } _notifyEvent(e) { - if ( - e.type === DateTimePicker.Event.CHANGE && - ( + if (e.type === DateTimePicker.Event.CHANGE) { + this._notifyChangeEventContext = this._notifyChangeEventContext || 0; + this._notifyChangeEventContext++; + if ( (e.date && this._areSameDates(e.date, e.oldDate)) || (!e.isClear && !e.date && !e.oldDate) - ) - ) { - return; + || + (this._notifyChangeEventContext > 1) + ) { + return; + } } this._element.trigger(e); + this._notifyChangeEventContext = void 0; } _viewUpdate(e) { From 3a0998b14d29a75754d723897050d0a541d720f8 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 19 May 2020 00:35:10 +0200 Subject: [PATCH 61/92] 5.10.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b0e6653..995ab5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.10.1", + "version": "5.10.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 509f993..51d7f08 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.10.1", + "version": "5.10.2", "files": [ "build", "src/js/**/*.js", From 1a1e34f8f540690de439cd4054da7f0a4a1e66ae Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 19 May 2020 00:35:23 +0200 Subject: [PATCH 62/92] Next patch version --- build/js/tempusdominus.js | 10 ++++++++-- build/js/tempusdominus.min.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 1b0b615..abcf673 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -398,6 +398,7 @@ var DateTimePicker = function ($, moment) { this.isDateUpdateThroughDateOptionFromClientCode = false; this.hasInitDate = false; this.initDate = void 0; + this._notifyChangeEventContext = void 0; this._int(); } @@ -671,10 +672,15 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) { - if (e.type === DateTimePicker.Event.CHANGE && (e.date && this._areSameDates(e.date, e.oldDate) || !e.isClear && !e.date && !e.oldDate)) { - return; + if (e.type === DateTimePicker.Event.CHANGE) { + this._notifyChangeEventContext = this._notifyChangeEventContext || 0; + this._notifyChangeEventContext++; + if (e.date && this._areSameDates(e.date, e.oldDate) || !e.isClear && !e.date && !e.oldDate || this._notifyChangeEventContext > 1) { + return; + } } this._element.trigger(e); + this._notifyChangeEventContext = void 0; }; DateTimePicker.prototype._viewUpdate = function _viewUpdate(e) { diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index f3cbe05..800797d 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&u[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(u[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.readonly=function(t){if(0===arguments.length)return this._options.readonly;if("boolean"!=typeof t)throw new TypeError("readonly() expects a boolean parameter");this._options.readonly=t,void 0!==this.input&&this.input.prop("readonly",this._options.readonly),this.widget&&(this.hide(),this.show())},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly() expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);s.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,n=void 0,s=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(n=i.split(" ")).length===a.length&&u[p]===n[n.length-1]){for(s=!0,o=n.length-2;0<=o;o--)if(!(u[n[o]]in r)){s=!1;break}if(s){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return n.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return n.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.readonly=function(t){if(0===arguments.length)return this._options.readonly;if("boolean"!=typeof t)throw new TypeError("readonly() expects a boolean parameter");this._options.readonly=t,void 0!==this.input&&this.input.prop("readonly",this._options.readonly),this.widget&&(this.hide(),this.show())},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly() expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return n.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");n.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);n.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?n.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?n.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e Date: Tue, 19 May 2020 08:58:13 +0200 Subject: [PATCH 63/92] Bugfix for oldDate property of change event when using clear button (buttons.showClear = true) --- build/js/tempusdominus.js | 10 +++++++--- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 8 ++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index abcf673..77e8321 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -461,12 +461,16 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._setValue = function _setValue(targetMoment, index) { - var oldDate = this.unset ? null : this._dates[index], - isClear = !targetMoment && typeof index === 'undefined', + var noIndex = typeof index === 'undefined', + isClear = !targetMoment && noIndex, isDateUpdateThroughDateOptionFromClientCode = this.isDateUpdateThroughDateOptionFromClientCode, isNotAllowedProgrammaticUpdate = !this.isInit && this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode; var outpValue = '', - isInvalid = false; + isInvalid = false, + oldDate = this.unset ? null : this._dates[index]; + if (!oldDate && !this.unset && noIndex && isClear) { + oldDate = this._dates[this._dates.length - 1]; + } // case of calling setValue(null or false) if (!targetMoment) { diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 800797d..18d7a80 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,n=void 0,s=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(n=i.split(" ")).length===a.length&&u[p]===n[n.length-1]){for(s=!0,o=n.length-2;0<=o;o--)if(!(u[n[o]]in r)){s=!1;break}if(s){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return n.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return n.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.readonly=function(t){if(0===arguments.length)return this._options.readonly;if("boolean"!=typeof t)throw new TypeError("readonly() expects a boolean parameter");this._options.readonly=t,void 0!==this.input&&this.input.prop("readonly",this._options.readonly),this.widget&&(this.hide(),this.show())},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly() expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return n.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");n.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);n.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?n.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?n.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,n=void 0,s=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(n=i.split(" ")).length===a.length&&u[p]===n[n.length-1]){for(s=!0,o=n.length-2;0<=o;o--)if(!(u[n[o]]in r)){s=!1;break}if(s){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return n.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return n.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.readonly=function(t){if(0===arguments.length)return this._options.readonly;if("boolean"!=typeof t)throw new TypeError("readonly() expects a boolean parameter");this._options.readonly=t,void 0!==this.input&&this.input.prop("readonly",this._options.readonly),this.widget&&(this.hide(),this.show())},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly() expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return n.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");n.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);n.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?n.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?n.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e { } _setValue(targetMoment, index) { - const oldDate = this.unset ? null : this._dates[index], isClear = !targetMoment && (typeof index === 'undefined'), + const noIndex = (typeof index === 'undefined'), + isClear = !targetMoment && noIndex, isDateUpdateThroughDateOptionFromClientCode = this.isDateUpdateThroughDateOptionFromClientCode, isNotAllowedProgrammaticUpdate = !this.isInit && this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode; - let outpValue = '', isInvalid = false; + let outpValue = '', isInvalid = false, oldDate = this.unset ? null : this._dates[index]; + if (!oldDate && !this.unset && noIndex && isClear) { + oldDate = this._dates[this._dates.length - 1]; + } // case of calling setValue(null or false) if (!targetMoment) { From f9d07e72e640bf956572ada3daf1eb6522d25f30 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 19 May 2020 08:58:21 +0200 Subject: [PATCH 64/92] 5.10.3 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 995ab5a..22c4d2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.10.2", + "version": "5.10.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 51d7f08..a346ff6 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.10.2", + "version": "5.10.3", "files": [ "build", "src/js/**/*.js", From c1271e50a6fe613d987eb10acbf324677c93b7f7 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 19 May 2020 13:01:04 +0200 Subject: [PATCH 65/92] Bugfix for view update and onUpdate event listener --- build/js/tempusdominus.js | 5 ++++- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 77e8321..2322d4b 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -1637,9 +1637,12 @@ var DateTimePicker = function ($, moment) { } this._viewDate = this._parseInputDate(newDate); - this._viewUpdate(); + this._update(); + this._viewUpdate(DatePickerModes[this.currentViewMode] && DatePickerModes[this.currentViewMode].NAV_FUNCTION); }; + DateTimePicker.prototype._fillDate = function _fillDate() {}; + DateTimePicker.prototype.allowMultidate = function allowMultidate(_allowMultidate) { if (typeof _allowMultidate !== 'boolean') { throw new TypeError('allowMultidate() expects a boolean parameter'); diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 18d7a80..ed36ec1 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,n=void 0,s=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(n=i.split(" ")).length===a.length&&u[p]===n[n.length-1]){for(s=!0,o=n.length-2;0<=o;o--)if(!(u[n[o]]in r)){s=!1;break}if(s){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return n.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return n.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.readonly=function(t){if(0===arguments.length)return this._options.readonly;if("boolean"!=typeof t)throw new TypeError("readonly() expects a boolean parameter");this._options.readonly=t,void 0!==this.input&&this.input.prop("readonly",this._options.readonly),this.widget&&(this.hide(),this.show())},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly() expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return n.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");n.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);n.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?n.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?n.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,n=void 0,s=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(n=i.split(" ")).length===a.length&&u[p]===n[n.length-1]){for(s=!0,o=n.length-2;0<=o;o--)if(!(u[n[o]]in r)){s=!1;break}if(s){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return n.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return n.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.readonly=function(t){if(0===arguments.length)return this._options.readonly;if("boolean"!=typeof t)throw new TypeError("readonly() expects a boolean parameter");this._options.readonly=t,void 0!==this.input&&this.input.prop("readonly",this._options.readonly),this.widget&&(this.hide(),this.show())},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly() expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return n.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");n.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);n.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?n.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?n.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e { } this._viewDate = this._parseInputDate(newDate); - this._viewUpdate(); + this._update(); + this._viewUpdate(DatePickerModes[this.currentViewMode] && DatePickerModes[this.currentViewMode].NAV_FUNCTION); } + _fillDate() {} + allowMultidate(allowMultidate) { if (typeof allowMultidate !== 'boolean') { throw new TypeError('allowMultidate() expects a boolean parameter'); From 041a553a0ee9f04c9a99739a47a34e09153d68c3 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 19 May 2020 13:01:14 +0200 Subject: [PATCH 66/92] 5.10.4 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 22c4d2e..5defdfa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.10.3", + "version": "5.10.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a346ff6..1b01f64 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.10.3", + "version": "5.10.4", "files": [ "build", "src/js/**/*.js", From 2fa6b32b5158a944cc19c9ec6bd8965a66053233 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 19 May 2020 20:57:19 +0200 Subject: [PATCH 67/92] Bugfix for parseInputDate option --- build/js/tempusdominus.js | 14 +++++++++----- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 12 ++++++------ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 2322d4b..b050bb3 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -437,15 +437,15 @@ var DateTimePicker = function ($, moment) { this._initFormatting(); this.isInitFormatting = false; - if (this.hasInitDate) { - this.date(this.initDate); - } - if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) { this._setValue(this._parseInputDate(this.input.val().trim()), 0); } else if (this._options.defaultDate && this.input !== undefined && this.input.attr('placeholder') === undefined) { this._setValue(this._options.defaultDate, 0); } + if (this.hasInitDate) { + this.date(this.initDate); + } + if (this._options.inline) { this.show(); } @@ -765,7 +765,11 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._parseInputDate = function _parseInputDate(inputDate) { - if (this._options.parseInputDate === undefined) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$isPickerShow = _ref.isPickerShow, + isPickerShow = _ref$isPickerShow === undefined ? false : _ref$isPickerShow; + + if (this._options.parseInputDate === undefined || isPickerShow) { if (!moment.isMoment(inputDate)) { inputDate = this.getMoment(inputDate); } diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index ed36ec1..a1f004a 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?o.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},g.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,n=void 0,s=void 0,a=[],r={},p=t.which;for(i in c[p]="p",c)c.hasOwnProperty(i)&&"p"===c[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(n=i.split(" ")).length===a.length&&u[p]===n[n.length-1]){for(s=!0,o=n.length-2;0<=o;o--)if(!(u[n[o]]in r)){s=!1;break}if(s){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},g.prototype._keyup=function(t){c[t.which]="r",_[t.which]&&(_[t.which]=!1,t.stopPropagation(),t.preventDefault())},g.prototype._indexGivenDates=function(t){var e={},i=this;return n.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},g.prototype._indexGivenHours=function(t){var e={};return n.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},g.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(e.isInitFormatting&&null===e._options.date?o():e._dates[0]).localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},g.prototype._getLastPickedDate=function(){var t=this._dates[this._getLastPickedDateIndex()];return!t&&this._options.allowMultidate&&(t=o(new Date)),t},g.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},g.prototype.getMoment=function(t){var e=void 0;return e=null==t?o():this._hasTimeZone()?o.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):o(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},g.prototype.toggle=function(){return this.widget?this.hide():this.show()},g.prototype.readonly=function(t){if(0===arguments.length)return this._options.readonly;if("boolean"!=typeof t)throw new TypeError("readonly() expects a boolean parameter");this._options.readonly=t,void 0!==this.input&&this.input.prop("readonly",this._options.readonly),this.widget&&(this.hide(),this.show())},g.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly() expects a boolean parameter");this._options.ignoreReadonly=t},g.prototype.options=function(t){if(0===arguments.length)return n.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");n.extend(!0,this._options,t);var o=this,e=Object.keys(this._options).sort(y);n.each(e,function(t,e){var i=o._options[e];if(void 0!==o[e]){if(o.isInit&&"date"===e)return o.hasInitDate=!0,void(o.initDate=i);o[e](i)}})},g.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||o.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");"string"==typeof t&&i(t)&&(t=new Date(t)),this._setValue(null===t?null:this._parseInputDate(t),e)},g.prototype.updateOnlyThroughDateOption=function(t){if("boolean"!=typeof t)throw new TypeError("updateOnlyThroughDateOption() expects a boolean parameter");this._options.updateOnlyThroughDateOption=t},g.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},g.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},g.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},g.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},g.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?n.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},g.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?n.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},g.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t,e){var i=(1 { this._initFormatting(); this.isInitFormatting = false; - if (this.hasInitDate) { - this.date(this.initDate); - } - if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) { this._setValue(this._parseInputDate(this.input.val().trim()), 0); } else if (this._options.defaultDate && this.input !== undefined && this.input.attr('placeholder') === undefined) { this._setValue(this._options.defaultDate, 0); } + if (this.hasInitDate) { + this.date(this.initDate); + } + if (this._options.inline) { this.show(); } @@ -819,8 +819,8 @@ const DateTimePicker = (($, moment) => { return true; } - _parseInputDate(inputDate) { - if (this._options.parseInputDate === undefined) { + _parseInputDate(inputDate, { isPickerShow = false } = {}) { + if (this._options.parseInputDate === undefined || isPickerShow) { if (!moment.isMoment(inputDate)) { inputDate = this.getMoment(inputDate); } From 051d6c8c63c06f8673f9b99811d9acdbcfb6616b Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 19 May 2020 20:57:28 +0200 Subject: [PATCH 68/92] 5.10.5 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5defdfa..c343084 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.10.4", + "version": "5.10.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1b01f64..47f00e5 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.10.4", + "version": "5.10.5", "files": [ "build", "src/js/**/*.js", From 04dba912f9fca4c841743c87fc27b08094c89eb7 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 20 May 2020 08:09:00 +0200 Subject: [PATCH 69/92] Patch for locale when using useCurrent option set to false --- src/js/tempusdominus.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index c5d20d4..355ec5b 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -920,7 +920,7 @@ const DateTimePicker = (($, moment) => { const format = this._options.format || 'L LT', self = this; this.actualFormat = format.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) { - return ((self.isInitFormatting && self._options.date === null ? moment() : self._dates[0]).localeData().longDateFormat(formatInput)) || formatInput; //todo taking the first date should be ok + return ((self.isInitFormatting && self._options.date === null ? self.getMoment() : self._dates[0]).localeData().longDateFormat(formatInput)) || formatInput; //todo taking the first date should be ok }); this.parseFormats = this._options.extraFormats ? this._options.extraFormats.slice() : []; @@ -964,7 +964,8 @@ const DateTimePicker = (($, moment) => { let returnMoment; if (d === undefined || d === null) { - returnMoment = moment(); //TODO should this use format? and locale? + // TODO: Should this use format? + returnMoment = moment().clone().locale(this._options.locale); } else if (this._hasTimeZone()) { // There is a string to parse and a default time zone // parse with the tz function which takes a default time zone if it is not in the format string From 12f6978c49f1fd2ddf947fc71f280244abca03be Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 20 May 2020 08:09:07 +0200 Subject: [PATCH 70/92] 5.10.6 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c343084..8c60780 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.10.5", + "version": "5.10.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 47f00e5..775fe0c 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.10.5", + "version": "5.10.6", "files": [ "build", "src/js/**/*.js", From e2218fab5e111bc999c1e3318f50938ffc583ee2 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 20 May 2020 08:09:19 +0200 Subject: [PATCH 71/92] Next patch version --- build/js/tempusdominus.js | 5 +++-- build/js/tempusdominus.min.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index b050bb3..4e2bd8c 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -872,7 +872,7 @@ var DateTimePicker = function ($, moment) { self = this; this.actualFormat = format.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) { - return (self.isInitFormatting && self._options.date === null ? moment() : self._dates[0]).localeData().longDateFormat(formatInput) || formatInput; //todo taking the first date should be ok + return (self.isInitFormatting && self._options.date === null ? self.getMoment() : self._dates[0]).localeData().longDateFormat(formatInput) || formatInput; //todo taking the first date should be ok }); this.parseFormats = this._options.extraFormats ? this._options.extraFormats.slice() : []; @@ -918,7 +918,8 @@ var DateTimePicker = function ($, moment) { var returnMoment = void 0; if (d === undefined || d === null) { - returnMoment = moment(); //TODO should this use format? and locale? + // TODO: Should this use format? + returnMoment = moment().clone().locale(this._options.locale); } else if (this._hasTimeZone()) { // There is a string to parse and a default time zone // parse with the tz function which takes a default time zone if it is not in the format string diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index a1f004a..0b6be0c 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t,e){var i=(1 div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t,e){var i=(1 Date: Fri, 22 May 2020 00:47:48 +0200 Subject: [PATCH 72/92] Added support for Feather icons --- build/js/tempusdominus.js | 20 +++++++++++++++++++- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 25 ++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 4e2bd8c..1c9d240 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -134,6 +134,17 @@ var DateTimePicker = function ($, moment) { multidateSeparator: -2, updateOnlyThroughDateOption: -1, date: 1 + }, + defaultFeatherIcons = { + time: 'clock', + date: 'calendar', + up: 'arrow-up', + down: 'arrow-down', + previous: 'arrow-left', + next: 'arrow-right', + today: 'arrow-down-circle', + clear: 'trash-2', + close: 'x' }; function optionsSortFn(optionKeyA, optionKeyB) { @@ -169,6 +180,7 @@ var DateTimePicker = function ($, moment) { disabledDates: false, enabledDates: false, icons: { + type: 'class', time: 'fa fa-clock-o', date: 'fa fa-calendar', up: 'fa fa-arrow-up', @@ -605,7 +617,9 @@ var DateTimePicker = function ($, moment) { DateTimePicker.prototype._getOptions = function _getOptions(options) { - options = $.extend(true, {}, Default, options); + options = $.extend(true, {}, Default, options.icons && options.icons.type === 'feather' ? { + icons: defaultFeatherIcons + } : {}, options); return options; }; @@ -1648,6 +1662,10 @@ var DateTimePicker = function ($, moment) { DateTimePicker.prototype._fillDate = function _fillDate() {}; + DateTimePicker.prototype._useFeatherIcons = function _useFeatherIcons() { + return this._options.icons.type === 'feather'; + }; + DateTimePicker.prototype.allowMultidate = function allowMultidate(_allowMultidate) { if (typeof _allowMultidate !== 'boolean') { throw new TypeError('allowMultidate() expects a boolean parameter'); diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 0b6be0c..f98c336 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},g.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},g.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},g.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},g.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},g.prototype._parseInputDate=function(t,e){var i=(1 div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1 { multidateSeparator: -2, updateOnlyThroughDateOption: -1, date: 1 + }, + defaultFeatherIcons = { + time: 'clock', + date: 'calendar', + up: 'arrow-up', + down: 'arrow-down', + previous: 'arrow-left', + next: 'arrow-right', + today: 'arrow-down-circle', + clear: 'trash-2', + close: 'x' }; function optionsSortFn(optionKeyA, optionKeyB) { @@ -170,6 +181,7 @@ const DateTimePicker = (($, moment) => { disabledDates: false, enabledDates: false, icons: { + type: 'class', time: 'fa fa-clock-o', date: 'fa fa-calendar', up: 'fa fa-arrow-up', @@ -654,7 +666,14 @@ const DateTimePicker = (($, moment) => { //noinspection JSMethodCanBeStatic _getOptions(options) { - options = $.extend(true, {}, Default, options); + options = $.extend(true, {}, Default, ( + options.icons && options.icons.type === 'feather' ? + { + icons: defaultFeatherIcons + } + : + {} + ), options); return options; } @@ -1696,6 +1715,10 @@ const DateTimePicker = (($, moment) => { _fillDate() {} + _useFeatherIcons() { + return this._options.icons.type === 'feather'; + } + allowMultidate(allowMultidate) { if (typeof allowMultidate !== 'boolean') { throw new TypeError('allowMultidate() expects a boolean parameter'); From bde511dca26c60e9f64f46c8de281eb7e8bd758f Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 22 May 2020 00:47:57 +0200 Subject: [PATCH 73/92] 5.11.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8c60780..5c0f598 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.10.6", + "version": "5.11.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 775fe0c..1fab35f 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.10.6", + "version": "5.11.0", "files": [ "build", "src/js/**/*.js", From 409d09f825670892578e906884eecd1d01dd4947 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 22 May 2020 15:39:05 +0200 Subject: [PATCH 74/92] Bugfix for internal _notifyChangeEventContext property --- src/js/tempusdominus.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index 4869eab..103b618 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -754,6 +754,7 @@ const DateTimePicker = (($, moment) => { || (this._notifyChangeEventContext > 1) ) { + this._notifyChangeEventContext = void 0; return; } } From 922899778fe1500385ca10ae389418bf48a5fe63 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 22 May 2020 15:39:12 +0200 Subject: [PATCH 75/92] 5.11.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c0f598..7859c95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.11.0", + "version": "5.11.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1fab35f..0f77c7f 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.11.0", + "version": "5.11.1", "files": [ "build", "src/js/**/*.js", From 3e7ef6a289318b37bf0732c33d69958ee73490c9 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Fri, 22 May 2020 15:39:23 +0200 Subject: [PATCH 76/92] Next patch version --- build/js/tempusdominus.js | 1 + build/js/tempusdominus.min.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index 1c9d240..d443c13 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -694,6 +694,7 @@ var DateTimePicker = function ($, moment) { this._notifyChangeEventContext = this._notifyChangeEventContext || 0; this._notifyChangeEventContext++; if (e.date && this._areSameDates(e.date, e.oldDate) || !e.isClear && !e.date && !e.oldDate || this._notifyChangeEventContext > 1) { + this._notifyChangeEventContext = void 0; return; } } diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index f98c336..3fccf82 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1 div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1 Date: Sun, 7 Jun 2020 18:11:44 +0200 Subject: [PATCH 77/92] Added promptTimeOnDateChange and promptTimeOnDateChangeTransitionDelay options to let the datetimepicker prompt for time when a date changes --- build/js/tempusdominus.js | 27 ++++++++++++++++++++++- build/js/tempusdominus.min.js | 2 +- package.json | 3 ++- src/js/tempusdominus.js | 40 ++++++++++++++++++++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index d443c13..aabef87 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -377,7 +377,9 @@ var DateTimePicker = function ($, moment) { viewDate: false, allowMultidate: false, multidateSeparator: ', ', - updateOnlyThroughDateOption: false + updateOnlyThroughDateOption: false, + promptTimeOnDateChange: false, + promptTimeOnDateChangeTransitionDelay: 200 }; // ReSharper restore InconsistentNaming @@ -411,6 +413,7 @@ var DateTimePicker = function ($, moment) { this.hasInitDate = false; this.initDate = void 0; this._notifyChangeEventContext = void 0; + this._currentPromptTimeTimeout = null; this._int(); } @@ -697,11 +700,33 @@ var DateTimePicker = function ($, moment) { this._notifyChangeEventContext = void 0; return; } + this._handlePromptTimeIfNeeded(e); } this._element.trigger(e); this._notifyChangeEventContext = void 0; }; + DateTimePicker.prototype._handlePromptTimeIfNeeded = function _handlePromptTimeIfNeeded(e) { + if (this._options.promptTimeOnDateChange) { + if (!e.oldDate && this._options.useCurrent) { + // First time ever. If useCurrent option is set to true (default), do nothing + // because the first date is selected automatically. + return; + } else if (e.oldDate && e.date && (e.oldDate.format('YYYY-MM-DD') === e.date.format('YYYY-MM-DD') || e.oldDate.format('YYYY-MM-DD') !== e.date.format('YYYY-MM-DD') && e.oldDate.format('HH:mm:ss') !== e.date.format('HH:mm:ss'))) { + // Date didn't change (time did) or date changed because time did. + return; + } + + var that = this; + clearTimeout(this._currentPromptTimeTimeout); + this._currentPromptTimeTimeout = setTimeout(function () { + if (that.widget) { + that.widget.find('[data-action="togglePicker"]').click(); + } + }, this._options.promptTimeOnDateChangeTransitionDelay); + } + }; + DateTimePicker.prototype._viewUpdate = function _viewUpdate(e) { if (e === 'y') { e = 'YYYY'; diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 3fccf82..d7a477d 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1 div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1/dev/null) || echo) && npm publish && git push && git push --tags", "publish-minor": "npm version minor && npm run build && ((npm run git-add-cm -- \"Next minor version\" 2>/dev/null) || echo) && npm publish && git push && git push --tags", @@ -67,4 +68,4 @@ "src/js/**/*.js", "Gruntfile.js" ] -} +} \ No newline at end of file diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index 103b618..782d841 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -378,7 +378,9 @@ const DateTimePicker = (($, moment) => { viewDate: false, allowMultidate: false, multidateSeparator: ', ', - updateOnlyThroughDateOption: false + updateOnlyThroughDateOption: false, + promptTimeOnDateChange: false, + promptTimeOnDateChangeTransitionDelay: 200 }; // ReSharper restore InconsistentNaming @@ -409,6 +411,7 @@ const DateTimePicker = (($, moment) => { this.hasInitDate = false; this.initDate = void 0; this._notifyChangeEventContext = void 0; + this._currentPromptTimeTimeout = null; this._int(); } @@ -757,11 +760,46 @@ const DateTimePicker = (($, moment) => { this._notifyChangeEventContext = void 0; return; } + this._handlePromptTimeIfNeeded(e); } this._element.trigger(e); this._notifyChangeEventContext = void 0; } + _handlePromptTimeIfNeeded(e) { + if (this._options.promptTimeOnDateChange) { + if (!e.oldDate && this._options.useCurrent) { + // First time ever. If useCurrent option is set to true (default), do nothing + // because the first date is selected automatically. + return; + } + else if ( + e.oldDate && + e.date && + ( + (e.oldDate.format('YYYY-MM-DD') === e.date.format('YYYY-MM-DD')) + || + ( + e.oldDate.format('YYYY-MM-DD') !== e.date.format('YYYY-MM-DD') + && + e.oldDate.format('HH:mm:ss') !== e.date.format('HH:mm:ss') + ) + ) + ) { + // Date didn't change (time did) or date changed because time did. + return; + } + + const that = this; + clearTimeout(this._currentPromptTimeTimeout); + this._currentPromptTimeTimeout = setTimeout(function() { + if (that.widget) { + that.widget.find('[data-action="togglePicker"]').click(); + } + }, this._options.promptTimeOnDateChangeTransitionDelay); + } + } + _viewUpdate(e) { if (e === 'y') { e = 'YYYY'; From 31a60e49fc4f272e311e1c36f5772cb35b358b59 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Sun, 7 Jun 2020 18:11:51 +0200 Subject: [PATCH 78/92] 5.12.0 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7859c95..554ed65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.11.1", + "version": "5.12.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 448c91e..4615fbd 100644 --- a/package.json +++ b/package.json @@ -62,10 +62,10 @@ "type": "git", "url": "https://github.com/tempusdominus/core.git" }, - "version": "5.11.1", + "version": "5.12.0", "files": [ "build", "src/js/**/*.js", "Gruntfile.js" ] -} \ No newline at end of file +} From 42617fc6b5f60fbedcf3b86bb28d2bfdfac9fca7 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 24 Jun 2020 09:26:14 +0200 Subject: [PATCH 79/92] Updated package.json's forked repo URLs --- package.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4615fbd..670f65b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "Anton Bagdatyev (Tonix)" ], "bugs": { - "url": "https://github.com/tempusdominus/core/issues" + "url": "https://github.com/tonix-tuft/tempusdominus/pulls" }, "scripts": { "watch": "./node_modules/.bin/onchange './src/js/**' -- npm run build", @@ -51,7 +51,6 @@ "load-grunt-tasks": "latest", "onchange": "^7.0.2" }, - "homepage": "https://github.com/tempusdominus/core", "keywords": [ "datepicker", "datetimepicker", @@ -60,7 +59,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/tempusdominus/core.git" + "url": "https://github.com/tonix-tuft/tempusdominus" }, "version": "5.12.0", "files": [ @@ -68,4 +67,4 @@ "src/js/**/*.js", "Gruntfile.js" ] -} +} \ No newline at end of file From 1bdedd5a3dcf12a11cfa2b45b93b8ea5987e1db5 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 24 Jun 2020 09:26:51 +0200 Subject: [PATCH 80/92] 5.13.0 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 554ed65..6fa1e58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.12.0", + "version": "5.13.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 670f65b..569c191 100644 --- a/package.json +++ b/package.json @@ -61,10 +61,10 @@ "type": "git", "url": "https://github.com/tonix-tuft/tempusdominus" }, - "version": "5.12.0", + "version": "5.13.0", "files": [ "build", "src/js/**/*.js", "Gruntfile.js" ] -} \ No newline at end of file +} From d15e32945cc7622b51e9443ff41c6addf66764c6 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 24 Jun 2020 09:32:28 +0200 Subject: [PATCH 81/92] Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d82526..4a15803 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This package is a fork of the original [tempusdominus/core](https://github.com/tempusdominus/core) repo. -This fork includes bugfixes and comes with updated NPM packages. +This fork includes bugfixes, new features, and comes with updated NPM packages. The original README.md follows below this paragraph. From 6e2af210333afc31cc9c206bc114e357709a660e Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 24 Jun 2020 09:33:02 +0200 Subject: [PATCH 82/92] 5.14.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6fa1e58..2628e33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.13.0", + "version": "5.14.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 569c191..e0a453d 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tonix-tuft/tempusdominus" }, - "version": "5.13.0", + "version": "5.14.0", "files": [ "build", "src/js/**/*.js", From ef89bb3899db7f575b3960e72afdf79729e4de57 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Mon, 6 Jul 2020 22:31:21 +0200 Subject: [PATCH 83/92] Updated package.json's description --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e0a453d..4b8280b 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "moment": "^2.10", "moment-timezone": "^0.5.0" }, - "description": "A date/time picker component designed for Momentjs. For usage, installation and demos see Project Site on GitHub", + "description": "A date/time picker component designed for Momentjs.", "devDependencies": { "babel-plugin-transform-es2015-modules-strip": "^0.1.0", "babel-preset-es2015": "^6.16.0", @@ -67,4 +67,4 @@ "src/js/**/*.js", "Gruntfile.js" ] -} +} \ No newline at end of file From e305d4b2b6157b17a6be98aba106a19a414d6ea3 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Mon, 6 Jul 2020 22:31:26 +0200 Subject: [PATCH 84/92] 5.15.0 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2628e33..55aca3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.14.0", + "version": "5.15.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4b8280b..210cb9c 100644 --- a/package.json +++ b/package.json @@ -61,10 +61,10 @@ "type": "git", "url": "https://github.com/tonix-tuft/tempusdominus" }, - "version": "5.14.0", + "version": "5.15.0", "files": [ "build", "src/js/**/*.js", "Gruntfile.js" ] -} \ No newline at end of file +} From 832fda87bc6cfa888fdb23f07375c3a54924871a Mon Sep 17 00:00:00 2001 From: Mateusz Starzec Date: Wed, 8 Jul 2020 09:11:41 +0200 Subject: [PATCH 85/92] Avoid `Cannot read property 'icons' of undefined` The `options` property can be undefined here. --- src/js/tempusdominus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus.js index 782d841..3395ba5 100644 --- a/src/js/tempusdominus.js +++ b/src/js/tempusdominus.js @@ -670,7 +670,7 @@ const DateTimePicker = (($, moment) => { //noinspection JSMethodCanBeStatic _getOptions(options) { options = $.extend(true, {}, Default, ( - options.icons && options.icons.type === 'feather' ? + options && options.icons && options.icons.type === 'feather' ? { icons: defaultFeatherIcons } From 66af3d981e79f160b145513427c248e6eb85144d Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 8 Jul 2020 17:18:51 +0200 Subject: [PATCH 86/92] Build --- build/js/tempusdominus.js | 2 +- build/js/tempusdominus.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index aabef87..b5cedc8 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -620,7 +620,7 @@ var DateTimePicker = function ($, moment) { DateTimePicker.prototype._getOptions = function _getOptions(options) { - options = $.extend(true, {}, Default, options.icons && options.icons.type === 'feather' ? { + options = $.extend(true, {}, Default, options && options.icons && options.icons.type === 'feather' ? { icons: defaultFeatherIcons } : {}, options); return options; diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index d7a477d..3090141 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1 div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1 Date: Wed, 8 Jul 2020 17:19:03 +0200 Subject: [PATCH 87/92] 5.15.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 55aca3e..ddfce51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.15.0", + "version": "5.15.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 210cb9c..13959a4 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tonix-tuft/tempusdominus" }, - "version": "5.15.0", + "version": "5.15.1", "files": [ "build", "src/js/**/*.js", From 0c471608b5f79bf9b8d6afc36b1567a0e8b81e05 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 2 Sep 2020 23:04:06 +0200 Subject: [PATCH 88/92] Bugfix for tempusdominus-bootstrap repo (issue 7): https://github.com/tonix-tuft/tempusdominus-bootstrap/issues/7 --- build/js/tempusdominus.js | 2 +- build/js/tempusdominus.min.js | 2 +- src/js/tempusdominus.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/js/tempusdominus.js b/build/js/tempusdominus.js index b5cedc8..dc9d917 100644 --- a/build/js/tempusdominus.js +++ b/build/js/tempusdominus.js @@ -611,7 +611,7 @@ var DateTimePicker = function ($, moment) { DateTimePicker.prototype._change = function _change(e) { var val = $(e.target).val().trim(), parsedDate = val ? this._parseInputDate(val) : null; - this._setValue(parsedDate); + this._setValue(parsedDate, 0); e.stopImmediatePropagation(); return false; }; diff --git a/build/js/tempusdominus.min.js b/build/js/tempusdominus.min.js index 3090141..2a5b2dc 100644 --- a/build/js/tempusdominus.min.js +++ b/build/js/tempusdominus.min.js @@ -1 +1 @@ -var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1 div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1 { _change(e) { const val = $(e.target).val().trim(), parsedDate = val ? this._parseInputDate(val) : null; - this._setValue(parsedDate); + this._setValue(parsedDate, 0); e.stopImmediatePropagation(); return false; } From 928c1de988dd3926b80e6a66a43cab1b7f94cb44 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Wed, 2 Sep 2020 23:04:16 +0200 Subject: [PATCH 89/92] 5.15.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ddfce51..8c694e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.15.1", + "version": "5.15.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 13959a4..021a2c6 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tonix-tuft/tempusdominus" }, - "version": "5.15.1", + "version": "5.15.2", "files": [ "build", "src/js/**/*.js", From 74514c0d488727ad2e9230625402ef0a4342dbe7 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 29 Sep 2020 20:59:50 +0200 Subject: [PATCH 90/92] npm audit fix; Updated CONTRIBUTING.md; Updated composer.json --- CONTRIBUTING.md | 35 ++++++++---------- composer.json | 13 +++---- package-lock.json | 90 +++++++++++++++++++++++------------------------ 3 files changed, 67 insertions(+), 71 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c4db38..30ae787 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,38 +1,33 @@ Submitting Issues ================= -If you are submitting a bug, please test and/or fork [this jsfiddle](http://jsfiddle.net/Eonasdan/0Ltv25o8/) demonstrating the issue. Code issues and fringe case bugs that do not include a jsfiddle (or similar) will be closed. +If you are submitting a bug, please test and/or fork [this JSFiddle](https://jsfiddle.net/nmocbjLf/1/) demonstrating the issue. +In your Pull Request (PR), describe the use case and provide a link to your forked JSFiddle and possibly provide a code example in the PR itself. Issues that are submitted without a description (title only) will be closed with no further explanation. Contributing code ================= -To contribute, fork the library and install grunt and dependencies. You need [node](http://nodejs.org/); use [nvm](https://github.com/creationix/nvm) or [nenv](https://github.com/ryuone/nenv) to install it. +PRs are welcome. + +**Working on your first Pull Request?** You can learn how from this _free_ series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). + +To contribute, fork the library and install dependencies. You will need [node](http://nodejs.org/). +You can use [nvm](https://github.com/nvm-sh/nvm) or [nenv](https://github.com/ryuone/nenv) to install it. + +Then, run the following commands: ```bash -git clone https://github.com/Eonasdan/bootstrap-datetimepicker.git -cd bootstrap-datetimepicker +git clone https://github.com/tonix-tuft/tempusdominus.git +cd tempusdominus npm install -g grunt-cli npm install -git checkout development # all patches against development branch, please! -grunt # this runs tests and jshint +npm run watch ``` Very important notes ==================== - * **Pull requests to the `master` branch will be closed.** Please submit all pull requests to the `development` branch. - * **Do not include the minified files in your pull request.** Don't worry, we'll build them when we cut a release. - * Pull requests that do not include a description (title only) and the following will be closed: - * What the change does - * A use case (for new features or enhancements) - -Grunt tasks -=========== - -We use Grunt for managing the build. Here are some useful Grunt tasks: - - * `grunt` The default task lints the code and runs the tests. You should make sure you do this before submitting a PR. - * `grunt build` Compiles the less stylesheet and minifies the javascript source in build directory. - * `grunt build:travis` Compliles and runs the jasmine/travis tests. **All PR's MUST pass tests in place** \ No newline at end of file + * **Please submit your pull requests to a new branch** (you may call it like you want, just choose a name that describes your feature/bugfix). + * **You don't have to include the minified files in your pull request** (by running `npm run build-all`). Don't worry, we'll build them when we bump a new version. diff --git a/composer.json b/composer.json index dce1d2a..c4664bd 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,14 @@ { - "name": "tempusdominus/core", + "name": "tonix-tuft/tempusdominus", "type": "component", - "version": "5.0.3", - "description": "Tempus Dominus core", + "description": "A date/time picker component designed for Momentjs.", "keywords": [ - "bootstrap", - "datetimepicker" + "datepicker", + "datetimepicker", + "timepicker", + "moment" ], - "homepage": "https://github.com/tempusdominus/core", + "homepage": "https://github.com/tonix-tuft/tempusdominus", "license": "MIT", "require": { "robloach/component-installer": "*", diff --git a/package-lock.json b/package-lock.json index 8c694e9..6af9b10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -416,9 +416,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -478,9 +478,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -559,9 +559,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -883,9 +883,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -914,9 +914,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -939,9 +939,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -959,9 +959,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -1871,9 +1871,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "shelljs": { @@ -2936,9 +2936,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "ms": { @@ -3204,9 +3204,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -3399,9 +3399,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -3972,9 +3972,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -4152,9 +4152,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "loose-envify": { @@ -4565,9 +4565,9 @@ } }, "npm-registry-fetch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.4.tgz", - "integrity": "sha512-6jb34hX/iYNQebqWUHtU8YF6Cjb1H6ouTFPClYsyiW6lpFkljTpdeftm53rRojtja1rKAvKNIIiTS5Sjpw4wsA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.7.tgz", + "integrity": "sha512-cny9v0+Mq6Tjz+e0erFAB+RYJ/AVGzkjnISiobqP8OWj9c9FLoZZu8/SPSKJWE17F1tk4018wfjV+ZbIbqC7fQ==", "dev": true, "requires": { "JSONStream": "^1.3.4", @@ -4580,9 +4580,9 @@ }, "dependencies": { "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true } } From 78e1b0ae275a3b489b6be85bb4192bc2ab66f3c1 Mon Sep 17 00:00:00 2001 From: "Anton Bagdatyev (Tonix)" Date: Tue, 29 Sep 2020 20:59:59 +0200 Subject: [PATCH 91/92] 5.16.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6af9b10..da45c3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tempusdominus", - "version": "5.15.2", + "version": "5.16.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 021a2c6..127a9b6 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "type": "git", "url": "https://github.com/tonix-tuft/tempusdominus" }, - "version": "5.15.2", + "version": "5.16.0", "files": [ "build", "src/js/**/*.js", From d6cb70e0f26b0fa920545f39ac55b1941d8532ff Mon Sep 17 00:00:00 2001 From: Eonasdan Date: Fri, 20 Nov 2020 11:14:59 -0500 Subject: [PATCH 92/92] merge tonix's updates --- CONTRIBUTING.md | 2 +- README.md | 8 - build/js/tempusdominus-core.js | 1789 +++++++++++++++++ build/js/tempusdominus-core.min.js | 1 + composer.json | 4 +- mkdocs.yml | 6 +- package-lock.json | 584 +----- package.json | 8 +- src/docs/theme/nav.html | 6 +- ...tempusdominus.js => tempusdominus-core.js} | 0 tasks/bump-version.js | 4 +- 11 files changed, 1898 insertions(+), 514 deletions(-) create mode 100644 build/js/tempusdominus-core.js create mode 100644 build/js/tempusdominus-core.min.js rename src/js/{tempusdominus.js => tempusdominus-core.js} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 30ae787..64ee05e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ You can use [nvm](https://github.com/nvm-sh/nvm) or [nenv](https://github.com/ry Then, run the following commands: ```bash -git clone https://github.com/tonix-tuft/tempusdominus.git +git clone https://github.com/tempusdominus/core.git cd tempusdominus npm install -g grunt-cli npm install diff --git a/README.md b/README.md index 4a15803..4bf04a1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,3 @@ -# tempusdominus - -This package is a fork of the original [tempusdominus/core](https://github.com/tempusdominus/core) repo. - -This fork includes bugfixes, new features, and comes with updated NPM packages. - -The original README.md follows below this paragraph. - # Tempus Dominus Core ![GitHub version](https://badge.fury.io/gh/tempusdominus%2Fcore.png) diff --git a/build/js/tempusdominus-core.js b/build/js/tempusdominus-core.js new file mode 100644 index 0000000..dc9d917 --- /dev/null +++ b/build/js/tempusdominus-core.js @@ -0,0 +1,1789 @@ +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// ReSharper disable once InconsistentNaming +var DateTimePicker = function ($, moment) { + function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + } + + function isValidDate(date) { + return Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime()); + } + + function isValidDateTimeStr(str) { + return isValidDate(new Date(str)); + } + + // ReSharper disable InconsistentNaming + var trim = function trim(str) { + return str.replace(/(^\s+)|(\s+$)/g, ''); + }, + NAME = 'datetimepicker', + DATA_KEY = '' + NAME, + EVENT_KEY = '.' + DATA_KEY, + DATA_API_KEY = '.data-api', + Selector = { + DATA_TOGGLE: '[data-toggle="' + DATA_KEY + '"]' + }, + ClassName = { + INPUT: NAME + '-input' + }, + Event = { + CHANGE: 'change' + EVENT_KEY, + BLUR: 'blur' + EVENT_KEY, + KEYUP: 'keyup' + EVENT_KEY, + KEYDOWN: 'keydown' + EVENT_KEY, + FOCUS: 'focus' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY, + //emitted + UPDATE: 'update' + EVENT_KEY, + ERROR: 'error' + EVENT_KEY, + HIDE: 'hide' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY + }, + DatePickerModes = [{ + CLASS_NAME: 'days', + NAV_FUNCTION: 'M', + NAV_STEP: 1 + }, { + CLASS_NAME: 'months', + NAV_FUNCTION: 'y', + NAV_STEP: 1 + }, { + CLASS_NAME: 'years', + NAV_FUNCTION: 'y', + NAV_STEP: 10 + }, { + CLASS_NAME: 'decades', + NAV_FUNCTION: 'y', + NAV_STEP: 100 + }], + KeyMap = { + 'up': 38, + 38: 'up', + 'down': 40, + 40: 'down', + 'left': 37, + 37: 'left', + 'right': 39, + 39: 'right', + 'tab': 9, + 9: 'tab', + 'escape': 27, + 27: 'escape', + 'enter': 13, + 13: 'enter', + 'pageUp': 33, + 33: 'pageUp', + 'pageDown': 34, + 34: 'pageDown', + 'shift': 16, + 16: 'shift', + 'control': 17, + 17: 'control', + 'space': 32, + 32: 'space', + 't': 84, + 84: 't', + 'delete': 46, + 46: 'delete' + }, + ViewModes = ['times', 'days', 'months', 'years', 'decades'], + keyState = {}, + keyPressHandled = {}, + optionsSortMap = { + timeZone: -39, + format: -38, + dayViewHeaderFormat: -37, + extraFormats: -36, + stepping: -35, + minDate: -34, + maxDate: -33, + useCurrent: -32, + collapse: -31, + locale: -30, + defaultDate: -29, + disabledDates: -28, + enabledDates: -27, + icons: -26, + tooltips: -25, + useStrict: -24, + sideBySide: -23, + daysOfWeekDisabled: -22, + calendarWeeks: -21, + viewMode: -20, + toolbarPlacement: -19, + buttons: -18, + widgetPositioning: -17, + widgetParent: -16, + ignoreReadonly: -15, + keepOpen: -14, + focusOnShow: -13, + inline: -12, + keepInvalid: -11, + keyBinds: -10, + debug: -9, + allowInputToggle: -8, + disabledTimeIntervals: -7, + disabledHours: -6, + enabledHours: -5, + viewDate: -4, + allowMultidate: -3, + multidateSeparator: -2, + updateOnlyThroughDateOption: -1, + date: 1 + }, + defaultFeatherIcons = { + time: 'clock', + date: 'calendar', + up: 'arrow-up', + down: 'arrow-down', + previous: 'arrow-left', + next: 'arrow-right', + today: 'arrow-down-circle', + clear: 'trash-2', + close: 'x' + }; + + function optionsSortFn(optionKeyA, optionKeyB) { + if (optionsSortMap[optionKeyA] && optionsSortMap[optionKeyB]) { + if (optionsSortMap[optionKeyA] < 0 && optionsSortMap[optionKeyB] < 0) { + return Math.abs(optionsSortMap[optionKeyB]) - Math.abs(optionsSortMap[optionKeyA]); + } else if (optionsSortMap[optionKeyA] < 0) { + return -1; + } else if (optionsSortMap[optionKeyB] < 0) { + return 1; + } + return optionsSortMap[optionKeyA] - optionsSortMap[optionKeyB]; + } else if (optionsSortMap[optionKeyA]) { + return optionsSortMap[optionKeyA]; + } else if (optionsSortMap[optionKeyB]) { + return optionsSortMap[optionKeyB]; + } + return 0; + } + + var Default = { + timeZone: '', + format: false, + dayViewHeaderFormat: 'MMMM YYYY', + extraFormats: false, + stepping: 1, + minDate: false, + maxDate: false, + useCurrent: true, + collapse: true, + locale: moment.locale(), + defaultDate: false, + disabledDates: false, + enabledDates: false, + icons: { + type: 'class', + time: 'fa fa-clock-o', + date: 'fa fa-calendar', + up: 'fa fa-arrow-up', + down: 'fa fa-arrow-down', + previous: 'fa fa-chevron-left', + next: 'fa fa-chevron-right', + today: 'fa fa-calendar-check-o', + clear: 'fa fa-trash', + close: 'fa fa-times' + }, + tooltips: { + today: 'Go to today', + clear: 'Clear selection', + close: 'Close the picker', + selectMonth: 'Select Month', + prevMonth: 'Previous Month', + nextMonth: 'Next Month', + selectYear: 'Select Year', + prevYear: 'Previous Year', + nextYear: 'Next Year', + selectDecade: 'Select Decade', + prevDecade: 'Previous Decade', + nextDecade: 'Next Decade', + prevCentury: 'Previous Century', + nextCentury: 'Next Century', + pickHour: 'Pick Hour', + incrementHour: 'Increment Hour', + decrementHour: 'Decrement Hour', + pickMinute: 'Pick Minute', + incrementMinute: 'Increment Minute', + decrementMinute: 'Decrement Minute', + pickSecond: 'Pick Second', + incrementSecond: 'Increment Second', + decrementSecond: 'Decrement Second', + togglePeriod: 'Toggle Period', + selectTime: 'Select Time', + selectDate: 'Select Date' + }, + useStrict: false, + sideBySide: false, + daysOfWeekDisabled: false, + calendarWeeks: false, + viewMode: 'days', + toolbarPlacement: 'default', + buttons: { + showToday: false, + showClear: false, + showClose: false + }, + widgetPositioning: { + horizontal: 'auto', + vertical: 'auto' + }, + widgetParent: null, + readonly: false, + ignoreReadonly: false, + keepOpen: false, + focusOnShow: true, + inline: false, + keepInvalid: false, + keyBinds: { + up: function up() { + if (!this.widget) { + return false; + } + var d = this._dates[0] || this.getMoment(); + if (this.widget.find('.datepicker').is(':visible')) { + this.date(d.clone().subtract(7, 'd')); + } else { + this.date(d.clone().add(this.stepping(), 'm')); + } + return true; + }, + down: function down() { + if (!this.widget) { + this.show(); + return false; + } + var d = this._dates[0] || this.getMoment(); + if (this.widget.find('.datepicker').is(':visible')) { + this.date(d.clone().add(7, 'd')); + } else { + this.date(d.clone().subtract(this.stepping(), 'm')); + } + return true; + }, + 'control up': function controlUp() { + if (!this.widget) { + return false; + } + var d = this._dates[0] || this.getMoment(); + if (this.widget.find('.datepicker').is(':visible')) { + this.date(d.clone().subtract(1, 'y')); + } else { + this.date(d.clone().add(1, 'h')); + } + return true; + }, + 'control down': function controlDown() { + if (!this.widget) { + return false; + } + var d = this._dates[0] || this.getMoment(); + if (this.widget.find('.datepicker').is(':visible')) { + this.date(d.clone().add(1, 'y')); + } else { + this.date(d.clone().subtract(1, 'h')); + } + return true; + }, + left: function left() { + if (!this.widget) { + return false; + } + var d = this._dates[0] || this.getMoment(); + if (this.widget.find('.datepicker').is(':visible')) { + this.date(d.clone().subtract(1, 'd')); + } + return true; + }, + right: function right() { + if (!this.widget) { + return false; + } + var d = this._dates[0] || this.getMoment(); + if (this.widget.find('.datepicker').is(':visible')) { + this.date(d.clone().add(1, 'd')); + } + return true; + }, + pageUp: function pageUp() { + if (!this.widget) { + return false; + } + var d = this._dates[0] || this.getMoment(); + if (this.widget.find('.datepicker').is(':visible')) { + this.date(d.clone().subtract(1, 'M')); + } + return true; + }, + pageDown: function pageDown() { + if (!this.widget) { + return false; + } + var d = this._dates[0] || this.getMoment(); + if (this.widget.find('.datepicker').is(':visible')) { + this.date(d.clone().add(1, 'M')); + } + return true; + }, + enter: function enter() { + if (!this.widget) { + return false; + } + this.hide(); + return true; + }, + escape: function escape() { + if (!this.widget) { + return false; + } + this.hide(); + return true; + }, + 'control space': function controlSpace() { + if (!this.widget) { + return false; + } + if (this.widget.find('.timepicker').is(':visible')) { + this.widget.find('.btn[data-action="togglePeriod"]').click(); + } + return true; + }, + t: function t() { + if (!this.widget) { + return false; + } + this.date(this.getMoment()); + return true; + }, + 'delete': function _delete() { + if (!this.widget) { + return false; + } + this.clear(); + return true; + } + }, + debug: false, + allowInputToggle: false, + disabledTimeIntervals: false, + disabledHours: false, + enabledHours: false, + viewDate: false, + allowMultidate: false, + multidateSeparator: ', ', + updateOnlyThroughDateOption: false, + promptTimeOnDateChange: false, + promptTimeOnDateChangeTransitionDelay: 200 + }; + + // ReSharper restore InconsistentNaming + + // ReSharper disable once DeclarationHides + // ReSharper disable once InconsistentNaming + + var DateTimePicker = function () { + /** @namespace eData.dateOptions */ + /** @namespace moment.tz */ + + function DateTimePicker(element, options) { + _classCallCheck(this, DateTimePicker); + + this._options = this._getOptions(options); + this._element = element; + this._dates = []; + this._datesFormatted = []; + this._viewDate = null; + this.unset = true; + this.component = false; + this.widget = false; + this.use24Hours = null; + this.actualFormat = null; + this.parseFormats = null; + this.currentViewMode = null; + this.MinViewModeNumber = 0; + this.isInitFormatting = false; + this.isInit = false; + this.isDateUpdateThroughDateOptionFromClientCode = false; + this.hasInitDate = false; + this.initDate = void 0; + this._notifyChangeEventContext = void 0; + this._currentPromptTimeTimeout = null; + + this._int(); + } + + /** + * @return {string} + */ + + + //private + + DateTimePicker.prototype._int = function _int() { + this.isInit = true; + var targetInput = this._element.data('target-input'); + if (this._element.is('input')) { + this.input = this._element; + } else if (targetInput !== undefined) { + if (targetInput === 'nearest') { + this.input = this._element.find('input'); + } else { + this.input = $(targetInput); + } + } + + this._dates = []; + this._dates[0] = this.getMoment(); + this._viewDate = this.getMoment().clone(); + + $.extend(true, this._options, this._dataToOptions()); + + this.hasInitDate = false; + this.initDate = void 0; + this.options(this._options); + + this.isInitFormatting = true; + this._initFormatting(); + this.isInitFormatting = false; + + if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) { + this._setValue(this._parseInputDate(this.input.val().trim()), 0); + } else if (this._options.defaultDate && this.input !== undefined && this.input.attr('placeholder') === undefined) { + this._setValue(this._options.defaultDate, 0); + } + if (this.hasInitDate) { + this.date(this.initDate); + } + + if (this._options.inline) { + this.show(); + } + this.isInit = false; + }; + + DateTimePicker.prototype._update = function _update() { + if (!this.widget) { + return; + } + this._fillDate(); + this._fillTime(); + }; + + DateTimePicker.prototype._setValue = function _setValue(targetMoment, index) { + var noIndex = typeof index === 'undefined', + isClear = !targetMoment && noIndex, + isDateUpdateThroughDateOptionFromClientCode = this.isDateUpdateThroughDateOptionFromClientCode, + isNotAllowedProgrammaticUpdate = !this.isInit && this._options.updateOnlyThroughDateOption && !isDateUpdateThroughDateOptionFromClientCode; + var outpValue = '', + isInvalid = false, + oldDate = this.unset ? null : this._dates[index]; + if (!oldDate && !this.unset && noIndex && isClear) { + oldDate = this._dates[this._dates.length - 1]; + } + + // case of calling setValue(null or false) + if (!targetMoment) { + if (isNotAllowedProgrammaticUpdate) { + this._notifyEvent({ + type: DateTimePicker.Event.CHANGE, + date: targetMoment, + oldDate: oldDate, + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit + }); + return; + } + if (!this._options.allowMultidate || this._dates.length === 1 || isClear) { + this.unset = true; + this._dates = []; + this._datesFormatted = []; + } else { + outpValue = '' + this._element.data('date') + this._options.multidateSeparator; + outpValue = oldDate && outpValue.replace('' + oldDate.format(this.actualFormat) + this._options.multidateSeparator, '').replace('' + this._options.multidateSeparator + this._options.multidateSeparator, '').replace(new RegExp(escapeRegExp(this._options.multidateSeparator) + '\\s*$'), '') || ''; + this._dates.splice(index, 1); + this._datesFormatted.splice(index, 1); + } + outpValue = trim(outpValue); + if (this.input !== undefined) { + this.input.val(outpValue); + this.input.trigger('input'); + } + this._element.data('date', outpValue); + this._notifyEvent({ + type: DateTimePicker.Event.CHANGE, + date: false, + oldDate: oldDate, + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit + }); + this._update(); + return; + } + + targetMoment = targetMoment.clone().locale(this._options.locale); + + if (this._hasTimeZone()) { + targetMoment.tz(this._options.timeZone); + } + + if (this._options.stepping !== 1) { + targetMoment.minutes(Math.round(targetMoment.minutes() / this._options.stepping) * this._options.stepping).seconds(0); + } + + if (this._isValid(targetMoment)) { + if (isNotAllowedProgrammaticUpdate) { + this._notifyEvent({ + type: DateTimePicker.Event.CHANGE, + date: targetMoment.clone(), + oldDate: oldDate, + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit + }); + return; + } + this._dates[index] = targetMoment; + this._datesFormatted[index] = targetMoment.format('YYYY-MM-DD'); + this._viewDate = targetMoment.clone(); + if (this._options.allowMultidate && this._dates.length > 1) { + for (var i = 0; i < this._dates.length; i++) { + outpValue += '' + this._dates[i].format(this.actualFormat) + this._options.multidateSeparator; + } + outpValue = outpValue.replace(new RegExp(this._options.multidateSeparator + '\\s*$'), ''); + } else { + outpValue = this._dates[index].format(this.actualFormat); + } + outpValue = trim(outpValue); + if (this.input !== undefined) { + this.input.val(outpValue); + this.input.trigger('input'); + } + this._element.data('date', outpValue); + + this.unset = false; + this._update(); + this._notifyEvent({ + type: DateTimePicker.Event.CHANGE, + date: this._dates[index].clone(), + oldDate: oldDate, + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit + }); + } else { + isInvalid = true; + if (!this._options.keepInvalid) { + if (this.input !== undefined) { + this.input.val('' + (this.unset ? '' : this._dates[index].format(this.actualFormat))); + this.input.trigger('input'); + } + } else { + this._notifyEvent({ + type: DateTimePicker.Event.CHANGE, + date: targetMoment, + oldDate: oldDate, + isClear: isClear, + isInvalid: isInvalid, + isDateUpdateThroughDateOptionFromClientCode: isDateUpdateThroughDateOptionFromClientCode, + isInit: this.isInit + }); + } + this._notifyEvent({ + type: DateTimePicker.Event.ERROR, + date: targetMoment, + oldDate: oldDate + }); + } + }; + + DateTimePicker.prototype._change = function _change(e) { + var val = $(e.target).val().trim(), + parsedDate = val ? this._parseInputDate(val) : null; + this._setValue(parsedDate, 0); + e.stopImmediatePropagation(); + return false; + }; + + //noinspection JSMethodCanBeStatic + + + DateTimePicker.prototype._getOptions = function _getOptions(options) { + options = $.extend(true, {}, Default, options && options.icons && options.icons.type === 'feather' ? { + icons: defaultFeatherIcons + } : {}, options); + return options; + }; + + DateTimePicker.prototype._hasTimeZone = function _hasTimeZone() { + return moment.tz !== undefined && this._options.timeZone !== undefined && this._options.timeZone !== null && this._options.timeZone !== ''; + }; + + DateTimePicker.prototype._isEnabled = function _isEnabled(granularity) { + if (typeof granularity !== 'string' || granularity.length > 1) { + throw new TypeError('isEnabled expects a single character string parameter'); + } + switch (granularity) { + case 'y': + return this.actualFormat.indexOf('Y') !== -1; + case 'M': + return this.actualFormat.indexOf('M') !== -1; + case 'd': + return this.actualFormat.toLowerCase().indexOf('d') !== -1; + case 'h': + case 'H': + return this.actualFormat.toLowerCase().indexOf('h') !== -1; + case 'm': + return this.actualFormat.indexOf('m') !== -1; + case 's': + return this.actualFormat.indexOf('s') !== -1; + case 'a': + case 'A': + return this.actualFormat.toLowerCase().indexOf('a') !== -1; + default: + return false; + } + }; + + DateTimePicker.prototype._hasTime = function _hasTime() { + return this._isEnabled('h') || this._isEnabled('m') || this._isEnabled('s'); + }; + + DateTimePicker.prototype._hasDate = function _hasDate() { + return this._isEnabled('y') || this._isEnabled('M') || this._isEnabled('d'); + }; + + DateTimePicker.prototype._dataToOptions = function _dataToOptions() { + var eData = this._element.data(); + var dataOptions = {}; + + if (eData.dateOptions && eData.dateOptions instanceof Object) { + dataOptions = $.extend(true, dataOptions, eData.dateOptions); + } + + $.each(this._options, function (key) { + var attributeName = 'date' + key.charAt(0).toUpperCase() + key.slice(1); //todo data api key + if (eData[attributeName] !== undefined) { + dataOptions[key] = eData[attributeName]; + } else { + delete dataOptions[key]; + } + }); + return dataOptions; + }; + + DateTimePicker.prototype._format = function _format() { + return this._options.format || 'YYYY-MM-DD HH:mm'; + }; + + DateTimePicker.prototype._areSameDates = function _areSameDates(a, b) { + var format = this._format(); + return a && b && (a.isSame(b) || moment(a.format(format), format).isSame(moment(b.format(format), format))); + }; + + DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) { + if (e.type === DateTimePicker.Event.CHANGE) { + this._notifyChangeEventContext = this._notifyChangeEventContext || 0; + this._notifyChangeEventContext++; + if (e.date && this._areSameDates(e.date, e.oldDate) || !e.isClear && !e.date && !e.oldDate || this._notifyChangeEventContext > 1) { + this._notifyChangeEventContext = void 0; + return; + } + this._handlePromptTimeIfNeeded(e); + } + this._element.trigger(e); + this._notifyChangeEventContext = void 0; + }; + + DateTimePicker.prototype._handlePromptTimeIfNeeded = function _handlePromptTimeIfNeeded(e) { + if (this._options.promptTimeOnDateChange) { + if (!e.oldDate && this._options.useCurrent) { + // First time ever. If useCurrent option is set to true (default), do nothing + // because the first date is selected automatically. + return; + } else if (e.oldDate && e.date && (e.oldDate.format('YYYY-MM-DD') === e.date.format('YYYY-MM-DD') || e.oldDate.format('YYYY-MM-DD') !== e.date.format('YYYY-MM-DD') && e.oldDate.format('HH:mm:ss') !== e.date.format('HH:mm:ss'))) { + // Date didn't change (time did) or date changed because time did. + return; + } + + var that = this; + clearTimeout(this._currentPromptTimeTimeout); + this._currentPromptTimeTimeout = setTimeout(function () { + if (that.widget) { + that.widget.find('[data-action="togglePicker"]').click(); + } + }, this._options.promptTimeOnDateChangeTransitionDelay); + } + }; + + DateTimePicker.prototype._viewUpdate = function _viewUpdate(e) { + if (e === 'y') { + e = 'YYYY'; + } + this._notifyEvent({ + type: DateTimePicker.Event.UPDATE, + change: e, + viewDate: this._viewDate.clone() + }); + }; + + DateTimePicker.prototype._showMode = function _showMode(dir) { + if (!this.widget) { + return; + } + if (dir) { + this.currentViewMode = Math.max(this.MinViewModeNumber, Math.min(3, this.currentViewMode + dir)); + } + this.widget.find('.datepicker > div').hide().filter('.datepicker-' + DatePickerModes[this.currentViewMode].CLASS_NAME).show(); + }; + + DateTimePicker.prototype._isInDisabledDates = function _isInDisabledDates(testDate) { + return this._options.disabledDates[testDate.format('YYYY-MM-DD')] === true; + }; + + DateTimePicker.prototype._isInEnabledDates = function _isInEnabledDates(testDate) { + return this._options.enabledDates[testDate.format('YYYY-MM-DD')] === true; + }; + + DateTimePicker.prototype._isInDisabledHours = function _isInDisabledHours(testDate) { + return this._options.disabledHours[testDate.format('H')] === true; + }; + + DateTimePicker.prototype._isInEnabledHours = function _isInEnabledHours(testDate) { + return this._options.enabledHours[testDate.format('H')] === true; + }; + + DateTimePicker.prototype._isValid = function _isValid(targetMoment, granularity) { + if (!targetMoment || !targetMoment.isValid()) { + return false; + } + if (this._options.disabledDates && granularity === 'd' && this._isInDisabledDates(targetMoment)) { + return false; + } + if (this._options.enabledDates && granularity === 'd' && !this._isInEnabledDates(targetMoment)) { + return false; + } + if (this._options.minDate && targetMoment.isBefore(this._options.minDate, granularity)) { + return false; + } + if (this._options.maxDate && targetMoment.isAfter(this._options.maxDate, granularity)) { + return false; + } + if (this._options.daysOfWeekDisabled && granularity === 'd' && this._options.daysOfWeekDisabled.indexOf(targetMoment.day()) !== -1) { + return false; + } + if (this._options.disabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && this._isInDisabledHours(targetMoment)) { + return false; + } + if (this._options.enabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && !this._isInEnabledHours(targetMoment)) { + return false; + } + if (this._options.disabledTimeIntervals && (granularity === 'h' || granularity === 'm' || granularity === 's')) { + var found = false; + $.each(this._options.disabledTimeIntervals, function () { + if (targetMoment.isBetween(this[0], this[1])) { + found = true; + return false; + } + }); + if (found) { + return false; + } + } + return true; + }; + + DateTimePicker.prototype._parseInputDate = function _parseInputDate(inputDate) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$isPickerShow = _ref.isPickerShow, + isPickerShow = _ref$isPickerShow === undefined ? false : _ref$isPickerShow; + + if (this._options.parseInputDate === undefined || isPickerShow) { + if (!moment.isMoment(inputDate)) { + inputDate = this.getMoment(inputDate); + } + } else { + inputDate = this._options.parseInputDate(inputDate); + } + //inputDate.locale(this.options.locale); + return inputDate; + }; + + DateTimePicker.prototype._keydown = function _keydown(e) { + var handler = null, + index = void 0, + index2 = void 0, + keyBindKeys = void 0, + allModifiersPressed = void 0; + var pressedKeys = [], + pressedModifiers = {}, + currentKey = e.which, + pressed = 'p'; + + keyState[currentKey] = pressed; + + for (index in keyState) { + if (keyState.hasOwnProperty(index) && keyState[index] === pressed) { + pressedKeys.push(index); + if (parseInt(index, 10) !== currentKey) { + pressedModifiers[index] = true; + } + } + } + + for (index in this._options.keyBinds) { + if (this._options.keyBinds.hasOwnProperty(index) && typeof this._options.keyBinds[index] === 'function') { + keyBindKeys = index.split(' '); + if (keyBindKeys.length === pressedKeys.length && KeyMap[currentKey] === keyBindKeys[keyBindKeys.length - 1]) { + allModifiersPressed = true; + for (index2 = keyBindKeys.length - 2; index2 >= 0; index2--) { + if (!(KeyMap[keyBindKeys[index2]] in pressedModifiers)) { + allModifiersPressed = false; + break; + } + } + if (allModifiersPressed) { + handler = this._options.keyBinds[index]; + break; + } + } + } + } + + if (handler) { + if (handler.call(this)) { + e.stopPropagation(); + e.preventDefault(); + } + } + }; + + //noinspection JSMethodCanBeStatic,SpellCheckingInspection + + + DateTimePicker.prototype._keyup = function _keyup(e) { + keyState[e.which] = 'r'; + if (keyPressHandled[e.which]) { + keyPressHandled[e.which] = false; + e.stopPropagation(); + e.preventDefault(); + } + }; + + DateTimePicker.prototype._indexGivenDates = function _indexGivenDates(givenDatesArray) { + // Store given enabledDates and disabledDates as keys. + // This way we can check their existence in O(1) time instead of looping through whole array. + // (for example: options.enabledDates['2014-02-27'] === true) + var givenDatesIndexed = {}, + self = this; + $.each(givenDatesArray, function () { + var dDate = self._parseInputDate(this); + if (dDate.isValid()) { + givenDatesIndexed[dDate.format('YYYY-MM-DD')] = true; + } + }); + return Object.keys(givenDatesIndexed).length ? givenDatesIndexed : false; + }; + + DateTimePicker.prototype._indexGivenHours = function _indexGivenHours(givenHoursArray) { + // Store given enabledHours and disabledHours as keys. + // This way we can check their existence in O(1) time instead of looping through whole array. + // (for example: options.enabledHours['2014-02-27'] === true) + var givenHoursIndexed = {}; + $.each(givenHoursArray, function () { + givenHoursIndexed[this] = true; + }); + return Object.keys(givenHoursIndexed).length ? givenHoursIndexed : false; + }; + + DateTimePicker.prototype._initFormatting = function _initFormatting() { + var format = this._options.format || 'L LT', + self = this; + + this.actualFormat = format.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) { + return (self.isInitFormatting && self._options.date === null ? self.getMoment() : self._dates[0]).localeData().longDateFormat(formatInput) || formatInput; //todo taking the first date should be ok + }); + + this.parseFormats = this._options.extraFormats ? this._options.extraFormats.slice() : []; + if (this.parseFormats.indexOf(format) < 0 && this.parseFormats.indexOf(this.actualFormat) < 0) { + this.parseFormats.push(this.actualFormat); + } + + this.use24Hours = this.actualFormat.toLowerCase().indexOf('a') < 1 && this.actualFormat.replace(/\[.*?]/g, '').indexOf('h') < 1; + + if (this._isEnabled('y')) { + this.MinViewModeNumber = 2; + } + if (this._isEnabled('M')) { + this.MinViewModeNumber = 1; + } + if (this._isEnabled('d')) { + this.MinViewModeNumber = 0; + } + + this.currentViewMode = Math.max(this.MinViewModeNumber, this.currentViewMode); + + if (!this.unset) { + this._setValue(this._dates[0], 0); + } + }; + + DateTimePicker.prototype._getLastPickedDate = function _getLastPickedDate() { + var lastPickedDate = this._dates[this._getLastPickedDateIndex()]; + if (!lastPickedDate && this._options.allowMultidate) { + lastPickedDate = moment(new Date()); + } + return lastPickedDate; + }; + + DateTimePicker.prototype._getLastPickedDateIndex = function _getLastPickedDateIndex() { + return this._dates.length - 1; + }; + + //public + + + DateTimePicker.prototype.getMoment = function getMoment(d) { + var returnMoment = void 0; + + if (d === undefined || d === null) { + // TODO: Should this use format? + returnMoment = moment().clone().locale(this._options.locale); + } else if (this._hasTimeZone()) { + // There is a string to parse and a default time zone + // parse with the tz function which takes a default time zone if it is not in the format string + returnMoment = moment.tz(d, this.parseFormats, this._options.locale, this._options.useStrict, this._options.timeZone); + } else { + returnMoment = moment(d, this.parseFormats, this._options.locale, this._options.useStrict); + } + + if (this._hasTimeZone()) { + returnMoment.tz(this._options.timeZone); + } + + return returnMoment; + }; + + DateTimePicker.prototype.toggle = function toggle() { + return this.widget ? this.hide() : this.show(); + }; + + DateTimePicker.prototype.readonly = function readonly(_readonly) { + if (arguments.length === 0) { + return this._options.readonly; + } + if (typeof _readonly !== 'boolean') { + throw new TypeError('readonly() expects a boolean parameter'); + } + this._options.readonly = _readonly; + if (this.input !== undefined) { + this.input.prop('readonly', this._options.readonly); + } + if (this.widget) { + this.hide(); + this.show(); + } + }; + + DateTimePicker.prototype.ignoreReadonly = function ignoreReadonly(_ignoreReadonly) { + if (arguments.length === 0) { + return this._options.ignoreReadonly; + } + if (typeof _ignoreReadonly !== 'boolean') { + throw new TypeError('ignoreReadonly() expects a boolean parameter'); + } + this._options.ignoreReadonly = _ignoreReadonly; + }; + + DateTimePicker.prototype.options = function options(newOptions) { + if (arguments.length === 0) { + return $.extend(true, {}, this._options); + } + + if (!(newOptions instanceof Object)) { + throw new TypeError('options() this.options parameter should be an object'); + } + $.extend(true, this._options, newOptions); + var self = this, + optionsKeys = Object.keys(this._options).sort(optionsSortFn); + $.each(optionsKeys, function (i, key) { + var value = self._options[key]; + if (self[key] !== undefined) { + if (self.isInit && key === 'date') { + self.hasInitDate = true; + self.initDate = value; + return; + } + self[key](value); + } + }); + }; + + DateTimePicker.prototype.date = function date(newDate, index) { + index = index || 0; + if (arguments.length === 0) { + if (this.unset) { + return null; + } + if (this._options.allowMultidate) { + return this._dates.join(this._options.multidateSeparator); + } else { + return this._dates[index].clone(); + } + } + + if (newDate !== null && typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) { + throw new TypeError('date() parameter must be one of [null, string, moment or Date]'); + } + + if (typeof newDate === 'string' && isValidDateTimeStr(newDate)) { + newDate = new Date(newDate); + } + + this._setValue(newDate === null ? null : this._parseInputDate(newDate), index); + }; + + DateTimePicker.prototype.updateOnlyThroughDateOption = function updateOnlyThroughDateOption(_updateOnlyThroughDateOption) { + if (typeof _updateOnlyThroughDateOption !== 'boolean') { + throw new TypeError('updateOnlyThroughDateOption() expects a boolean parameter'); + } + + this._options.updateOnlyThroughDateOption = _updateOnlyThroughDateOption; + }; + + DateTimePicker.prototype.format = function format(newFormat) { + if (arguments.length === 0) { + return this._options.format; + } + + if (typeof newFormat !== 'string' && (typeof newFormat !== 'boolean' || newFormat !== false)) { + throw new TypeError('format() expects a string or boolean:false parameter ' + newFormat); + } + + this._options.format = newFormat; + if (this.actualFormat) { + this._initFormatting(); // reinitialize formatting + } + }; + + DateTimePicker.prototype.timeZone = function timeZone(newZone) { + if (arguments.length === 0) { + return this._options.timeZone; + } + + if (typeof newZone !== 'string') { + throw new TypeError('newZone() expects a string parameter'); + } + + this._options.timeZone = newZone; + }; + + DateTimePicker.prototype.dayViewHeaderFormat = function dayViewHeaderFormat(newFormat) { + if (arguments.length === 0) { + return this._options.dayViewHeaderFormat; + } + + if (typeof newFormat !== 'string') { + throw new TypeError('dayViewHeaderFormat() expects a string parameter'); + } + + this._options.dayViewHeaderFormat = newFormat; + }; + + DateTimePicker.prototype.extraFormats = function extraFormats(formats) { + if (arguments.length === 0) { + return this._options.extraFormats; + } + + if (formats !== false && !(formats instanceof Array)) { + throw new TypeError('extraFormats() expects an array or false parameter'); + } + + this._options.extraFormats = formats; + if (this.parseFormats) { + this._initFormatting(); // reinit formatting + } + }; + + DateTimePicker.prototype.disabledDates = function disabledDates(dates) { + if (arguments.length === 0) { + return this._options.disabledDates ? $.extend({}, this._options.disabledDates) : this._options.disabledDates; + } + + if (!dates) { + this._options.disabledDates = false; + this._update(); + return true; + } + if (!(dates instanceof Array)) { + throw new TypeError('disabledDates() expects an array parameter'); + } + this._options.disabledDates = this._indexGivenDates(dates); + this._options.enabledDates = false; + this._update(); + }; + + DateTimePicker.prototype.enabledDates = function enabledDates(dates) { + if (arguments.length === 0) { + return this._options.enabledDates ? $.extend({}, this._options.enabledDates) : this._options.enabledDates; + } + + if (!dates) { + this._options.enabledDates = false; + this._update(); + return true; + } + if (!(dates instanceof Array)) { + throw new TypeError('enabledDates() expects an array parameter'); + } + this._options.enabledDates = this._indexGivenDates(dates); + this._options.disabledDates = false; + this._update(); + }; + + DateTimePicker.prototype.daysOfWeekDisabled = function daysOfWeekDisabled(_daysOfWeekDisabled) { + if (arguments.length === 0) { + return this._options.daysOfWeekDisabled.splice(0); + } + + if (typeof _daysOfWeekDisabled === 'boolean' && !_daysOfWeekDisabled) { + this._options.daysOfWeekDisabled = false; + this._update(); + return true; + } + + if (!(_daysOfWeekDisabled instanceof Array)) { + throw new TypeError('daysOfWeekDisabled() expects an array parameter'); + } + this._options.daysOfWeekDisabled = _daysOfWeekDisabled.reduce(function (previousValue, currentValue) { + currentValue = parseInt(currentValue, 10); + if (currentValue > 6 || currentValue < 0 || isNaN(currentValue)) { + return previousValue; + } + if (previousValue.indexOf(currentValue) === -1) { + previousValue.push(currentValue); + } + return previousValue; + }, []).sort(); + if (this._options.useCurrent && !this._options.keepInvalid) { + for (var i = 0; i < this._dates.length; i++) { + var tries = 0; + while (!this._isValid(this._dates[i], 'd')) { + this._dates[i].add(1, 'd'); + if (tries === 31) { + throw 'Tried 31 times to find a valid date'; + } + tries++; + } + this._setValue(this._dates[i], i); + } + } + this._update(); + }; + + DateTimePicker.prototype.maxDate = function maxDate(_maxDate) { + if (arguments.length === 0) { + return this._options.maxDate ? this._options.maxDate.clone() : this._options.maxDate; + } + + if (typeof _maxDate === 'boolean' && _maxDate === false) { + this._options.maxDate = false; + this._update(); + return true; + } + + if (typeof _maxDate === 'string') { + if (_maxDate === 'now' || _maxDate === 'moment') { + _maxDate = this.getMoment(); + } + } + + var parsedDate = this._parseInputDate(_maxDate); + + if (!parsedDate.isValid()) { + throw new TypeError('maxDate() Could not parse date parameter: ' + _maxDate); + } + if (this._options.minDate && parsedDate.isBefore(this._options.minDate)) { + throw new TypeError('maxDate() date parameter is before this.options.minDate: ' + parsedDate.format(this.actualFormat)); + } + this._options.maxDate = parsedDate; + for (var i = 0; i < this._dates.length; i++) { + if (this._options.useCurrent && !this._options.keepInvalid && this._dates[i].isAfter(_maxDate)) { + this._setValue(this._options.maxDate, i); + } + } + if (this._viewDate.isAfter(parsedDate)) { + this._viewDate = parsedDate.clone().subtract(this._options.stepping, 'm'); + } + this._update(); + }; + + DateTimePicker.prototype.minDate = function minDate(_minDate) { + if (arguments.length === 0) { + return this._options.minDate ? this._options.minDate.clone() : this._options.minDate; + } + + if (typeof _minDate === 'boolean' && _minDate === false) { + this._options.minDate = false; + this._update(); + return true; + } + + if (typeof _minDate === 'string') { + if (_minDate === 'now' || _minDate === 'moment') { + _minDate = this.getMoment(); + } + } + + var parsedDate = this._parseInputDate(_minDate); + + if (!parsedDate.isValid()) { + throw new TypeError('minDate() Could not parse date parameter: ' + _minDate); + } + if (this._options.maxDate && parsedDate.isAfter(this._options.maxDate)) { + throw new TypeError('minDate() date parameter is after this.options.maxDate: ' + parsedDate.format(this.actualFormat)); + } + this._options.minDate = parsedDate; + for (var i = 0; i < this._dates.length; i++) { + if (this._options.useCurrent && !this._options.keepInvalid && this._dates[i].isBefore(_minDate)) { + this._setValue(this._options.minDate, i); + } + } + if (this._viewDate.isBefore(parsedDate)) { + this._viewDate = parsedDate.clone().add(this._options.stepping, 'm'); + } + this._update(); + }; + + DateTimePicker.prototype.defaultDate = function defaultDate(_defaultDate) { + if (arguments.length === 0) { + return this._options.defaultDate ? this._options.defaultDate.clone() : this._options.defaultDate; + } + if (!_defaultDate) { + this._options.defaultDate = false; + return true; + } + + if (typeof _defaultDate === 'string') { + if (_defaultDate === 'now' || _defaultDate === 'moment') { + _defaultDate = this.getMoment(); + } else { + _defaultDate = this.getMoment(_defaultDate); + } + } + + var parsedDate = this._parseInputDate(_defaultDate); + if (!parsedDate.isValid()) { + throw new TypeError('defaultDate() Could not parse date parameter: ' + _defaultDate); + } + if (!this._isValid(parsedDate)) { + throw new TypeError('defaultDate() date passed is invalid according to component setup validations'); + } + + this._options.defaultDate = parsedDate; + + if (this._options.defaultDate && this._options.inline || this.input !== undefined && this.input.val().trim() === '') { + this._setValue(this._options.defaultDate, 0); + } + }; + + DateTimePicker.prototype.locale = function locale(_locale) { + if (arguments.length === 0) { + return this._options.locale; + } + + if (!moment.localeData(_locale)) { + throw new TypeError('locale() locale ' + _locale + ' is not loaded from moment locales!'); + } + + this._options.locale = _locale; + + for (var i = 0; i < this._dates.length; i++) { + this._dates[i].locale(this._options.locale); + } + this._viewDate.locale(this._options.locale); + + if (this.actualFormat) { + this._initFormatting(); // reinitialize formatting + } + if (this.widget) { + this.hide(); + this.show(); + } + }; + + DateTimePicker.prototype.stepping = function stepping(_stepping) { + if (arguments.length === 0) { + return this._options.stepping; + } + + _stepping = parseInt(_stepping, 10); + if (isNaN(_stepping) || _stepping < 1) { + _stepping = 1; + } + this._options.stepping = _stepping; + }; + + DateTimePicker.prototype.useCurrent = function useCurrent(_useCurrent) { + var useCurrentOptions = ['year', 'month', 'day', 'hour', 'minute']; + if (arguments.length === 0) { + return this._options.useCurrent; + } + + if (typeof _useCurrent !== 'boolean' && typeof _useCurrent !== 'string') { + throw new TypeError('useCurrent() expects a boolean or string parameter'); + } + if (typeof _useCurrent === 'string' && useCurrentOptions.indexOf(_useCurrent.toLowerCase()) === -1) { + throw new TypeError('useCurrent() expects a string parameter of ' + useCurrentOptions.join(', ')); + } + this._options.useCurrent = _useCurrent; + }; + + DateTimePicker.prototype.collapse = function collapse(_collapse) { + if (arguments.length === 0) { + return this._options.collapse; + } + + if (typeof _collapse !== 'boolean') { + throw new TypeError('collapse() expects a boolean parameter'); + } + if (this._options.collapse === _collapse) { + return true; + } + this._options.collapse = _collapse; + if (this.widget) { + this.hide(); + this.show(); + } + }; + + DateTimePicker.prototype.icons = function icons(_icons) { + if (arguments.length === 0) { + return $.extend({}, this._options.icons); + } + + if (!(_icons instanceof Object)) { + throw new TypeError('icons() expects parameter to be an Object'); + } + + $.extend(this._options.icons, _icons); + + if (this.widget) { + this.hide(); + this.show(); + } + }; + + DateTimePicker.prototype.tooltips = function tooltips(_tooltips) { + if (arguments.length === 0) { + return $.extend({}, this._options.tooltips); + } + + if (!(_tooltips instanceof Object)) { + throw new TypeError('tooltips() expects parameter to be an Object'); + } + $.extend(this._options.tooltips, _tooltips); + if (this.widget) { + this.hide(); + this.show(); + } + }; + + DateTimePicker.prototype.useStrict = function useStrict(_useStrict) { + if (arguments.length === 0) { + return this._options.useStrict; + } + + if (typeof _useStrict !== 'boolean') { + throw new TypeError('useStrict() expects a boolean parameter'); + } + this._options.useStrict = _useStrict; + }; + + DateTimePicker.prototype.sideBySide = function sideBySide(_sideBySide) { + if (arguments.length === 0) { + return this._options.sideBySide; + } + + if (typeof _sideBySide !== 'boolean') { + throw new TypeError('sideBySide() expects a boolean parameter'); + } + this._options.sideBySide = _sideBySide; + if (this.widget) { + this.hide(); + this.show(); + } + }; + + DateTimePicker.prototype.viewMode = function viewMode(_viewMode) { + if (arguments.length === 0) { + return this._options.viewMode; + } + + if (typeof _viewMode !== 'string') { + throw new TypeError('viewMode() expects a string parameter'); + } + + if (DateTimePicker.ViewModes.indexOf(_viewMode) === -1) { + throw new TypeError('viewMode() parameter must be one of (' + DateTimePicker.ViewModes.join(', ') + ') value'); + } + + this._options.viewMode = _viewMode; + this.currentViewMode = Math.max(DateTimePicker.ViewModes.indexOf(_viewMode) - 1, this.MinViewModeNumber); + + this._showMode(); + }; + + DateTimePicker.prototype.calendarWeeks = function calendarWeeks(_calendarWeeks) { + if (arguments.length === 0) { + return this._options.calendarWeeks; + } + + if (typeof _calendarWeeks !== 'boolean') { + throw new TypeError('calendarWeeks() expects parameter to be a boolean value'); + } + + this._options.calendarWeeks = _calendarWeeks; + this._update(); + }; + + DateTimePicker.prototype.buttons = function buttons(_buttons) { + if (arguments.length === 0) { + return $.extend({}, this._options.buttons); + } + + if (!(_buttons instanceof Object)) { + throw new TypeError('buttons() expects parameter to be an Object'); + } + + $.extend(this._options.buttons, _buttons); + + if (typeof this._options.buttons.showToday !== 'boolean') { + throw new TypeError('buttons.showToday expects a boolean parameter'); + } + if (typeof this._options.buttons.showClear !== 'boolean') { + throw new TypeError('buttons.showClear expects a boolean parameter'); + } + if (typeof this._options.buttons.showClose !== 'boolean') { + throw new TypeError('buttons.showClose expects a boolean parameter'); + } + + if (this.widget) { + this.hide(); + this.show(); + } + }; + + DateTimePicker.prototype.keepOpen = function keepOpen(_keepOpen) { + if (arguments.length === 0) { + return this._options.keepOpen; + } + + if (typeof _keepOpen !== 'boolean') { + throw new TypeError('keepOpen() expects a boolean parameter'); + } + + this._options.keepOpen = _keepOpen; + }; + + DateTimePicker.prototype.focusOnShow = function focusOnShow(_focusOnShow) { + if (arguments.length === 0) { + return this._options.focusOnShow; + } + + if (typeof _focusOnShow !== 'boolean') { + throw new TypeError('focusOnShow() expects a boolean parameter'); + } + + this._options.focusOnShow = _focusOnShow; + }; + + DateTimePicker.prototype.inline = function inline(_inline) { + if (arguments.length === 0) { + return this._options.inline; + } + + if (typeof _inline !== 'boolean') { + throw new TypeError('inline() expects a boolean parameter'); + } + + this._options.inline = _inline; + }; + + DateTimePicker.prototype.clear = function clear() { + this._setValue(null); //todo + }; + + DateTimePicker.prototype.keyBinds = function keyBinds(_keyBinds) { + if (arguments.length === 0) { + return this._options.keyBinds; + } + + this._options.keyBinds = _keyBinds; + }; + + DateTimePicker.prototype.debug = function debug(_debug) { + if (typeof _debug !== 'boolean') { + throw new TypeError('debug() expects a boolean parameter'); + } + + this._options.debug = _debug; + }; + + DateTimePicker.prototype.allowInputToggle = function allowInputToggle(_allowInputToggle) { + if (arguments.length === 0) { + return this._options.allowInputToggle; + } + + if (typeof _allowInputToggle !== 'boolean') { + throw new TypeError('allowInputToggle() expects a boolean parameter'); + } + + this._options.allowInputToggle = _allowInputToggle; + }; + + DateTimePicker.prototype.keepInvalid = function keepInvalid(_keepInvalid) { + if (arguments.length === 0) { + return this._options.keepInvalid; + } + + if (typeof _keepInvalid !== 'boolean') { + throw new TypeError('keepInvalid() expects a boolean parameter'); + } + this._options.keepInvalid = _keepInvalid; + }; + + DateTimePicker.prototype.datepickerInput = function datepickerInput(_datepickerInput) { + if (arguments.length === 0) { + return this._options.datepickerInput; + } + + if (typeof _datepickerInput !== 'string') { + throw new TypeError('datepickerInput() expects a string parameter'); + } + + this._options.datepickerInput = _datepickerInput; + }; + + DateTimePicker.prototype.parseInputDate = function parseInputDate(_parseInputDate2) { + if (arguments.length === 0) { + return this._options.parseInputDate; + } + + if (typeof _parseInputDate2 !== 'function') { + throw new TypeError('parseInputDate() should be as function'); + } + + this._options.parseInputDate = _parseInputDate2; + }; + + DateTimePicker.prototype.disabledTimeIntervals = function disabledTimeIntervals(_disabledTimeIntervals) { + if (arguments.length === 0) { + return this._options.disabledTimeIntervals ? $.extend({}, this._options.disabledTimeIntervals) : this._options.disabledTimeIntervals; + } + + if (!_disabledTimeIntervals) { + this._options.disabledTimeIntervals = false; + this._update(); + return true; + } + if (!(_disabledTimeIntervals instanceof Array)) { + throw new TypeError('disabledTimeIntervals() expects an array parameter'); + } + this._options.disabledTimeIntervals = _disabledTimeIntervals; + this._update(); + }; + + DateTimePicker.prototype.disabledHours = function disabledHours(hours) { + if (arguments.length === 0) { + return this._options.disabledHours ? $.extend({}, this._options.disabledHours) : this._options.disabledHours; + } + + if (!hours) { + this._options.disabledHours = false; + this._update(); + return true; + } + if (!(hours instanceof Array)) { + throw new TypeError('disabledHours() expects an array parameter'); + } + this._options.disabledHours = this._indexGivenHours(hours); + this._options.enabledHours = false; + if (this._options.useCurrent && !this._options.keepInvalid) { + for (var i = 0; i < this._dates.length; i++) { + var tries = 0; + while (!this._isValid(this._dates[i], 'h')) { + this._dates[i].add(1, 'h'); + if (tries === 24) { + throw 'Tried 24 times to find a valid date'; + } + tries++; + } + this._setValue(this._dates[i], i); + } + } + this._update(); + }; + + DateTimePicker.prototype.enabledHours = function enabledHours(hours) { + if (arguments.length === 0) { + return this._options.enabledHours ? $.extend({}, this._options.enabledHours) : this._options.enabledHours; + } + + if (!hours) { + this._options.enabledHours = false; + this._update(); + return true; + } + if (!(hours instanceof Array)) { + throw new TypeError('enabledHours() expects an array parameter'); + } + this._options.enabledHours = this._indexGivenHours(hours); + this._options.disabledHours = false; + if (this._options.useCurrent && !this._options.keepInvalid) { + for (var i = 0; i < this._dates.length; i++) { + var tries = 0; + while (!this._isValid(this._dates[i], 'h')) { + this._dates[i].add(1, 'h'); + if (tries === 24) { + throw 'Tried 24 times to find a valid date'; + } + tries++; + } + this._setValue(this._dates[i], i); + } + } + this._update(); + }; + + DateTimePicker.prototype.viewDate = function viewDate(newDate) { + if (arguments.length === 0) { + return this._viewDate.clone(); + } + + if (!newDate) { + this._viewDate = (this._dates[0] || this.getMoment()).clone(); + return true; + } + + if (typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) { + throw new TypeError('viewDate() parameter must be one of [string, moment or Date]'); + } + + this._viewDate = this._parseInputDate(newDate); + this._update(); + this._viewUpdate(DatePickerModes[this.currentViewMode] && DatePickerModes[this.currentViewMode].NAV_FUNCTION); + }; + + DateTimePicker.prototype._fillDate = function _fillDate() {}; + + DateTimePicker.prototype._useFeatherIcons = function _useFeatherIcons() { + return this._options.icons.type === 'feather'; + }; + + DateTimePicker.prototype.allowMultidate = function allowMultidate(_allowMultidate) { + if (typeof _allowMultidate !== 'boolean') { + throw new TypeError('allowMultidate() expects a boolean parameter'); + } + + this._options.allowMultidate = _allowMultidate; + }; + + DateTimePicker.prototype.multidateSeparator = function multidateSeparator(_multidateSeparator) { + if (arguments.length === 0) { + return this._options.multidateSeparator; + } + + if (typeof _multidateSeparator !== 'string') { + throw new TypeError('multidateSeparator expects a string parameter'); + } + + this._options.multidateSeparator = _multidateSeparator; + }; + + _createClass(DateTimePicker, null, [{ + key: 'NAME', + get: function get() { + return NAME; + } + + /** + * @return {string} + */ + + }, { + key: 'DATA_KEY', + get: function get() { + return DATA_KEY; + } + + /** + * @return {string} + */ + + }, { + key: 'EVENT_KEY', + get: function get() { + return EVENT_KEY; + } + + /** + * @return {string} + */ + + }, { + key: 'DATA_API_KEY', + get: function get() { + return DATA_API_KEY; + } + }, { + key: 'DatePickerModes', + get: function get() { + return DatePickerModes; + } + }, { + key: 'ViewModes', + get: function get() { + return ViewModes; + } + }, { + key: 'Event', + get: function get() { + return Event; + } + }, { + key: 'Selector', + get: function get() { + return Selector; + } + }, { + key: 'Default', + get: function get() { + return Default; + }, + set: function set(value) { + Default = value; + } + }, { + key: 'ClassName', + get: function get() { + return ClassName; + } + }]); + + return DateTimePicker; + }(); + + return DateTimePicker; +}(jQuery, moment); diff --git a/build/js/tempusdominus-core.min.js b/build/js/tempusdominus-core.min.js new file mode 100644 index 0000000..f3d30a6 --- /dev/null +++ b/build/js/tempusdominus-core.min.js @@ -0,0 +1 @@ +var _createClass=function(){function o(t,e){for(var i=0;i div").hide().filter(".datepicker-"+l[this.currentViewMode].CLASS_NAME).show())},D.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},D.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},D.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},D.prototype._isValid=function(t,e){if(!t||!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(n.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},D.prototype._parseInputDate=function(t,e){var i=(1 - {{ config.site_name }} + {{ config.site_name }} @@ -26,14 +26,14 @@ {% else %}
  • - {{ nav_item.title }} + {{ nav_item.title }}
  • {% endif %} {% endfor %} diff --git a/src/js/tempusdominus.js b/src/js/tempusdominus-core.js similarity index 100% rename from src/js/tempusdominus.js rename to src/js/tempusdominus-core.js diff --git a/tasks/bump-version.js b/tasks/bump-version.js index 6125584..6d40088 100644 --- a/tasks/bump-version.js +++ b/tasks/bump-version.js @@ -3,7 +3,7 @@ module.exports = function (grunt) { if (!version || version.split('.').length !== 3) { grunt.fail.fatal('malformed version. Use\n\n grunt bump_version:1.2.3'); } - + grunt.config('string-replace.package-json', { files: {'package.json': 'package.json'}, options: { @@ -41,7 +41,7 @@ module.exports = function (grunt) { }); grunt.config('string-replace.js', { - files: { 'src/js/tempusdominus.js': 'src/js/empusdominus-core.js' }, + files: { 'src/js/tempusdominus-core.js': 'src/js/empusdominus-core.js' }, options: { replacements: [ {