Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Eonasdan committed Mar 15, 2018
1 parent d2c9cf2 commit aaa4b3b
Show file tree
Hide file tree
Showing 35 changed files with 10,965 additions and 577 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function (grunt) {
jqueryVersionCheck: '+function ($) {\n' +
' var version = $.fn.jquery.split(\' \')[0].split(\'.\');\n' +
' if ((version[0] < 2 && version[1] < 9) || (version[0] === 1 && version[1] === 9 && version[2] < 1) || (version[0] >= 4)) {\n' +
' throw new Error(\'Tempus Dominus Bootstrap4\\\'s requires at least jQuery v1.9.1 but less than v4.0.0\');\n' +
' throw new Error(\'Tempus Dominus Bootstrap4\\\'s requires at least jQuery v3.0.0 but less than v4.0.0\');\n' +
' }\n' +
'}(jQuery);\n\n',
momentCheck: 'if (typeof moment === \'undefined\') {\n' +
Expand Down
2 changes: 1 addition & 1 deletion build/css/tempusdominus-bootstrap-4.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*@preserve
* Tempus Dominus Bootstrap4 v5.0.0-alpha17 (https://tempusdominus.github.io/bootstrap-4/)
* Tempus Dominus Bootstrap4 v5.0.0-alpha18 (https://tempusdominus.github.io/bootstrap-4/)
* Copyright 2016-2018 Jonathan Peterson
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion build/css/tempusdominus-bootstrap-4.min.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*@preserve
* Tempus Dominus Bootstrap4 v5.0.0-alpha17 (https://tempusdominus.github.io/bootstrap-4/)
* Tempus Dominus Bootstrap4 v5.0.0-alpha18 (https://tempusdominus.github.io/bootstrap-4/)
* Copyright 2016-2018 Jonathan Peterson
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
*/
Expand Down
155 changes: 76 additions & 79 deletions build/js/tempusdominus-bootstrap-4.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*@preserve
* Tempus Dominus Bootstrap4 v5.0.0-alpha17 (https://tempusdominus.github.io/bootstrap-4/)
* Tempus Dominus Bootstrap4 v5.0.0-alpha18 (https://tempusdominus.github.io/bootstrap-4/)
* Copyright 2016-2018 Jonathan Peterson
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
*/
Expand All @@ -11,7 +11,7 @@ if (typeof jQuery === 'undefined') {
+function ($) {
var version = $.fn.jquery.split(' ')[0].split('.');
if ((version[0] < 2 && version[1] < 9) || (version[0] === 1 && version[1] === 9 && version[2] < 1) || (version[0] >= 4)) {
throw new Error('Tempus Dominus Bootstrap4\'s requires at least jQuery v1.9.1 but less than v4.0.0');
throw new Error('Tempus Dominus Bootstrap4\'s requires at least jQuery v3.0.0 but less than v4.0.0');
}
}(jQuery);

Expand All @@ -38,12 +38,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
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) {
var DateTimePicker = function ($) {
// ReSharper disable InconsistentNaming
var NAME = 'datetimepicker',
VERSION = '5.0.0-alpha15',
VERSION = '5.0.0-alpha7',
DATA_KEY = '' + NAME,
EVENT_KEY = '.' + DATA_KEY,
EMIT_EVENT_KEY = DATA_KEY + '.',
DATA_API_KEY = '.data-api',
Selector = {
DATA_TOGGLE: '[data-toggle="' + DATA_KEY + '"]'
Expand All @@ -59,63 +60,11 @@ var DateTimePicker = function ($, moment) {
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
UPDATE: EMIT_EVENT_KEY + 'update',
ERROR: EMIT_EVENT_KEY + 'error',
HIDE: EMIT_EVENT_KEY + 'hide',
SHOW: EMIT_EVENT_KEY + 'show'
},
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 = {};

var MinViewModeNumber = 0,
Default = {
timeZone: '',
format: false,
Expand All @@ -126,7 +75,7 @@ var DateTimePicker = function ($, moment) {
maxDate: false,
useCurrent: true,
collapse: true,
locale: moment.locale(),
locale: window.moment.locale(),
defaultDate: false,
disabledDates: false,
enabledDates: false,
Expand Down Expand Up @@ -320,8 +269,59 @@ var DateTimePicker = function ($, moment) {
viewDate: false,
allowMultidate: false,
multidateSeparator: ','
};
},
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 = {};

var MinViewModeNumber = 0;
// ReSharper restore InconsistentNaming

// ReSharper disable once DeclarationHides
Expand Down Expand Up @@ -380,9 +380,9 @@ var DateTimePicker = function ($, moment) {
this._initFormatting();

if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) {
this._setValue(this._parseInputDate(this.input.val().trim()), 0);
this._setValue(this._parseInputDate(this.input.val().trim()));
} else if (this._options.defaultDate && this.input !== undefined && this.input.attr('placeholder') === undefined) {
this._setValue(this._options.defaultDate, 0);
this._setValue(this._options.defaultDate);
}
if (this._options.inline) {
this.show();
Expand Down Expand Up @@ -499,7 +499,7 @@ var DateTimePicker = function ($, moment) {
};

DateTimePicker.prototype._hasTimeZone = function _hasTimeZone() {
return moment.tz !== undefined && this._options.timeZone !== undefined && this._options.timeZone !== null && this._options.timeZone !== '';
return window.moment.tz !== undefined && this._options.timeZone !== undefined && this._options.timeZone !== null && this._options.timeZone !== '';
};

DateTimePicker.prototype._isEnabled = function _isEnabled(granularity) {
Expand All @@ -520,9 +520,6 @@ var DateTimePicker = function ($, moment) {
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;
}
Expand Down Expand Up @@ -641,7 +638,7 @@ var DateTimePicker = function ($, moment) {

DateTimePicker.prototype._parseInputDate = function _parseInputDate(inputDate) {
if (this._options.parseInputDate === undefined) {
if (!moment.isMoment(inputDate)) {
if (!window.moment.isMoment(inputDate)) {
inputDate = this.getMoment(inputDate);
}
} else {
Expand Down Expand Up @@ -785,13 +782,13 @@ var DateTimePicker = function ($, moment) {
var returnMoment = void 0;

if (d === undefined || d === null) {
returnMoment = moment(); //TODO should this use format? and locale?
returnMoment = window.moment(); //TODO should this use format? and 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.useStrict, this._options.timeZone);
returnMoment = window.moment.tz(d, this.parseFormats, this._options.useStrict, this._options.timeZone);
} else {
returnMoment = moment(d, this.parseFormats, this._options.useStrict);
returnMoment = window.moment(d, this.parseFormats, this._options.useStrict);
}

if (this._hasTimeZone()) {
Expand Down Expand Up @@ -845,14 +842,17 @@ var DateTimePicker = function ($, moment) {
}
}

if (newDate !== null && typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
if (newDate !== null && typeof newDate !== 'string' && !window.moment.isMoment(newDate) && !(newDate instanceof Date)) {
throw new TypeError('date() parameter must be one of [null, string, moment or Date]');
}

this._setValue(newDate === null ? null : this._parseInputDate(newDate), index);
};

DateTimePicker.prototype.format = function format(newFormat) {
///<summary>test su</summary>
///<param name="newFormat">info about para</param>
///<returns type="string|boolean">returns foo</returns>
if (arguments.length === 0) {
return this._options.format;
}
Expand Down Expand Up @@ -1093,7 +1093,7 @@ var DateTimePicker = function ($, moment) {
return this._options.locale;
}

if (!moment.localeData(_locale)) {
if (!window.moment.localeData(_locale)) {
throw new TypeError('locale() locale ' + _locale + ' is not loaded from moment locales!');
}

Expand Down Expand Up @@ -1465,7 +1465,7 @@ var DateTimePicker = function ($, moment) {
return true;
}

if (typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
if (typeof newDate !== 'string' && !window.moment.isMoment(newDate) && !(newDate instanceof Date)) {
throw new TypeError('viewDate() parameter must be one of [string, moment or Date]');
}

Expand Down Expand Up @@ -1572,9 +1572,6 @@ var DateTimePicker = function ($, moment) {
key: 'Default',
get: function get() {
return Default;
},
set: function set(value) {
Default = value;
}
}, {
key: 'ClassName',
Expand All @@ -1587,7 +1584,7 @@ var DateTimePicker = function ($, moment) {
}();

return DateTimePicker;
}(jQuery, moment);
}(jQuery);

//noinspection JSUnusedGlobalSymbols
/* global DateTimePicker */
Expand Down
4 changes: 2 additions & 2 deletions build/js/tempusdominus-bootstrap-4.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tempusdominus/bootstrap-4",
"type": "component",
"version": "5.0.0-alpha17",
"version": "5.0.0-alpha18",
"description": "Date/time picker widget based on twitter bootstrap",
"keywords": [
"bootstrap",
Expand All @@ -11,9 +11,9 @@
"license": "MIT",
"require": {
"robloach/component-installer": "*",
"components/jquery": ">=1.9.1",
"components/jquery": ">=3.0.0",
"moment": ">=2.10.5",
"tempusdominus-core": "5.0.0-alpha15"
"tempusdominus-core": "5.0.0-alpha17"
},
"extra": {
"component": {
Expand Down
Loading

0 comments on commit aaa4b3b

Please sign in to comment.