Skip to content

Commit

Permalink
build: release 0.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Nov 24, 2017
1 parent beac234 commit 5ea7f5d
Show file tree
Hide file tree
Showing 13 changed files with 1,083 additions and 590 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.6.4 (Nov 24, 2017)

- Support to load in node environment.
- Add 3 new languages for i18n.
- Add example for using datepicker in modal.

## 0.6.3 (Sep 29, 2017)

- Update view year when the month over the current year.
Expand Down
108 changes: 52 additions & 56 deletions dist/datepicker.common.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*!
* Datepicker v0.6.3
* Datepicker v0.6.4
* https://github.com/fengyuanchen/datepicker
*
* Copyright (c) 2014-2017 Fengyuan Chen
* Copyright (c) 2014-2017 Chen Fengyuan
* Released under the MIT license
*
* Date: 2017-09-29T14:28:06.767Z
* Date: 2017-11-24T14:38:23.820Z
*/

'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
Expand Down Expand Up @@ -109,6 +110,7 @@ var DEFAULTS = {
pick: null
};

var WINDOW = typeof window !== 'undefined' ? window : {};
var NAMESPACE = 'datepicker';
var EVENT_CLICK = 'click.' + NAMESPACE;
var EVENT_FOCUS = 'focus.' + NAMESPACE;
Expand Down Expand Up @@ -136,7 +138,7 @@ function isString(value) {
return typeof value === 'string';
}

var isNaN = Number.isNaN || window.isNaN;
var isNaN = Number.isNaN || WINDOW.isNaN;

function isNumber(value) {
return typeof value === 'number' && !isNaN(value);
Expand Down Expand Up @@ -219,11 +221,6 @@ function parseFormat(format) {
return format;
}

var _window$1 = window;
var document$2 = _window$1.document;

var $window = $(window);
var $document$1 = $(document$2);
var REGEXP_DIGITS = /\d+/g;

var methods = {
Expand All @@ -246,9 +243,9 @@ var methods = {
this.showView(this.options.startView);

if (!this.inline) {
$window.on(EVENT_RESIZE, this.onResize = proxy(this.place, this));
$document$1.on(EVENT_CLICK, this.onGlobalClick = proxy(this.globalClick, this));
$document$1.on(EVENT_KEYUP, this.onGlobalKeyup = proxy(this.globalKeyup, this));
$(window).on(EVENT_RESIZE, this.onResize = proxy(this.place, this));
$(document).on(EVENT_CLICK, this.onGlobalClick = proxy(this.globalClick, this));
$(document).on(EVENT_KEYUP, this.onGlobalKeyup = proxy(this.globalKeyup, this));
this.place();
}
},
Expand All @@ -268,9 +265,9 @@ var methods = {
this.$picker.addClass(CLASS_HIDE).off(EVENT_CLICK, this.click);

if (!this.inline) {
$window.off(EVENT_RESIZE, this.onResize);
$document$1.off(EVENT_CLICK, this.onGlobalClick);
$document$1.off(EVENT_KEYUP, this.onGlobalKeyup);
$(window).off(EVENT_RESIZE, this.onResize);
$(document).off(EVENT_CLICK, this.onGlobalClick);
$(document).off(EVENT_KEYUP, this.onGlobalKeyup);
}
},
toggle: function toggle() {
Expand Down Expand Up @@ -1074,11 +1071,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"); } }

var _window = window;
var document$1 = _window.document;

var $document = $(document$1);

// Classes
var CLASS_TOP_LEFT = NAMESPACE + '-top-left';
var CLASS_TOP_RIGHT = NAMESPACE + '-top-right';
Expand Down Expand Up @@ -1205,7 +1197,7 @@ var Datepicker = function () {
if (this.inline) {
$(options.container || $this).append($picker.addClass(NAMESPACE + '-inline'));
} else {
$(document$1.body).append($picker.addClass(NAMESPACE + '-dropdown'));
$(document.body).append($picker.addClass(NAMESPACE + '-dropdown'));
$picker.addClass(CLASS_HIDE);
}

Expand Down Expand Up @@ -1359,8 +1351,8 @@ var Datepicker = function () {
options = this.options,
$picker = this.$picker;

var containerWidth = $document.outerWidth();
var containerHeight = $document.outerHeight();
var containerWidth = $(document).outerWidth();
var containerHeight = $(document).outerHeight();
var elementWidth = $this.outerWidth();
var elementHeight = $this.outerHeight();
var width = $picker.width();
Expand Down Expand Up @@ -1475,48 +1467,52 @@ var Datepicker = function () {
return Datepicker;
}();

$.extend(Datepicker.prototype, render, handlers, methods);
if ($.extend) {
$.extend(Datepicker.prototype, render, handlers, methods);
}

var AnotherDatepicker = $.fn.datepicker;
if ($.fn) {
var AnotherDatepicker = $.fn.datepicker;

$.fn.datepicker = function jQueryDatepicker(option) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
$.fn.datepicker = function jQueryDatepicker(option) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}

var result = void 0;
var result = void 0;

this.each(function each() {
var $this = $(this);
var data = $this.data('datepicker');
this.each(function (i, element) {
var $element = $(element);
var data = $element.data(NAMESPACE);

if (!data) {
if (/destroy/.test(option)) {
return;
}
if (!data) {
if (/destroy/.test(option)) {
return;
}

var options = $.extend({}, $this.data(), $.isPlainObject(option) && option);
var options = $.extend({}, $element.data(), $.isPlainObject(option) && option);

data = new Datepicker(this, options);
$this.data('datepicker', data);
}
data = new Datepicker(element, options);
$element.data(NAMESPACE, data);
}

if (typeof option === 'string') {
var fn = data[option];
if (isString(option)) {
var fn = data[option];

if ($.isFunction(fn)) {
result = fn.apply(data, args);
if ($.isFunction(fn)) {
result = fn.apply(data, args);
}
}
}
});
});

return typeof result !== 'undefined' ? result : this;
};
return isUndefined(result) ? this : result;
};

$.fn.datepicker.Constructor = Datepicker;
$.fn.datepicker.languages = LANGUAGES;
$.fn.datepicker.setDefaults = Datepicker.setDefaults;
$.fn.datepicker.noConflict = function noConflict() {
$.fn.datepicker = AnotherDatepicker;
return this;
};
$.fn.datepicker.Constructor = Datepicker;
$.fn.datepicker.languages = LANGUAGES;
$.fn.datepicker.setDefaults = Datepicker.setDefaults;
$.fn.datepicker.noConflict = function noConflict() {
$.fn.datepicker = AnotherDatepicker;
return this;
};
}
11 changes: 6 additions & 5 deletions dist/datepicker.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*!
* Datepicker v0.6.3
* Datepicker v0.6.4
* https://github.com/fengyuanchen/datepicker
*
* Copyright (c) 2014-2017 Fengyuan Chen
*
* Copyright (c) 2014-2017 Chen Fengyuan
* Released under the MIT license
*
* Date: 2017-09-29T14:28:02.764Z
*
* Date: 2017-11-24T14:38:19.628Z
*/

.datepicker-container {
background-color: #fff;
direction: ltr;
Expand Down
Loading

0 comments on commit 5ea7f5d

Please sign in to comment.