uikit-sass-rails 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE.md +155 -0
- data/README.md +78 -0
- data/lib/uikit-sass-rails.rb +1 -0
- data/lib/uikit/sass/rails.rb +2 -0
- data/lib/uikit/sass/rails/engine.rb +12 -0
- data/lib/uikit/sass/rails/version.rb +7 -0
- data/uikit-sass-rails.gemspec +24 -0
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +504 -0
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/javascripts/uikit.js +14 -0
- data/vendor/assets/javascripts/uikit/addons/autocomplete.js +306 -0
- data/vendor/assets/javascripts/uikit/addons/datepicker.js +365 -0
- data/vendor/assets/javascripts/uikit/addons/form-password.js +62 -0
- data/vendor/assets/javascripts/uikit/addons/form-select.js +62 -0
- data/vendor/assets/javascripts/uikit/addons/htmleditor.js +594 -0
- data/vendor/assets/javascripts/uikit/addons/nestable.js +574 -0
- data/vendor/assets/javascripts/uikit/addons/notify.js +177 -0
- data/vendor/assets/javascripts/uikit/addons/pagination.js +146 -0
- data/vendor/assets/javascripts/uikit/addons/search.js +90 -0
- data/vendor/assets/javascripts/uikit/addons/sortable.js +494 -0
- data/vendor/assets/javascripts/uikit/addons/sticky.js +130 -0
- data/vendor/assets/javascripts/uikit/addons/timepicker.js +163 -0
- data/vendor/assets/javascripts/uikit/addons/upload.js +239 -0
- data/vendor/assets/javascripts/uikit/uikit.js +2573 -0
- data/vendor/assets/stylesheets/extra/font-awesome.scss +16 -0
- data/vendor/assets/stylesheets/uikit.scss +5 -0
- data/vendor/assets/stylesheets/uikit/addons/uikit.addons.scss +1326 -0
- data/vendor/assets/stylesheets/uikit/addons/uikit.almost-flat.addons.scss +1423 -0
- data/vendor/assets/stylesheets/uikit/addons/uikit.gradient.addons.scss +1445 -0
- data/vendor/assets/stylesheets/uikit/almost-flat.scss +5 -0
- data/vendor/assets/stylesheets/uikit/gradient.scss +5 -0
- data/vendor/assets/stylesheets/uikit/uikit.almost-flat.scss +8207 -0
- data/vendor/assets/stylesheets/uikit/uikit.gradient.scss +8264 -0
- data/vendor/assets/stylesheets/uikit/uikit.scss +7874 -0
- metadata +100 -0
Binary file
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
//= require uikit/uikit
|
2
|
+
|
3
|
+
//= require uikit/addons/datepicker
|
4
|
+
//= require uikit/addons/form-password
|
5
|
+
//= require uikit/addons/form-select
|
6
|
+
//= require uikit/addons/htmleditor
|
7
|
+
//= require uikit/addons/nestable
|
8
|
+
//= require uikit/addons/notify
|
9
|
+
//= require uikit/addons/pagination
|
10
|
+
//= require uikit/addons/search
|
11
|
+
//= require uikit/addons/sortable
|
12
|
+
//= require uikit/addons/sticky
|
13
|
+
//= require uikit/addons/timepicker
|
14
|
+
//= require uikit/addons/upload
|
@@ -0,0 +1,306 @@
|
|
1
|
+
/*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
|
3
|
+
(function(addon) {
|
4
|
+
|
5
|
+
var component;
|
6
|
+
|
7
|
+
if (jQuery && jQuery.UIkit) {
|
8
|
+
component = addon(jQuery, jQuery.UIkit);
|
9
|
+
}
|
10
|
+
|
11
|
+
if (typeof define == "function" && define.amd) {
|
12
|
+
define("uikit-autocomplete", ["uikit"], function(){
|
13
|
+
return component || addon(jQuery, jQuery.UIkit);
|
14
|
+
});
|
15
|
+
}
|
16
|
+
|
17
|
+
})(function($, UI){
|
18
|
+
|
19
|
+
UI.component('autocomplete', {
|
20
|
+
|
21
|
+
defaults: {
|
22
|
+
minLength: 3,
|
23
|
+
param: 'search',
|
24
|
+
method: 'post',
|
25
|
+
delay: 300,
|
26
|
+
loadingClass: 'uk-loading',
|
27
|
+
flipDropdown: false,
|
28
|
+
skipClass: 'uk-skip',
|
29
|
+
hoverClass: 'uk-active',
|
30
|
+
source: null,
|
31
|
+
renderer: null,
|
32
|
+
|
33
|
+
// template
|
34
|
+
|
35
|
+
template: '<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>'
|
36
|
+
},
|
37
|
+
|
38
|
+
visible : false,
|
39
|
+
value : null,
|
40
|
+
selected : null,
|
41
|
+
|
42
|
+
init: function() {
|
43
|
+
|
44
|
+
var $this = this,
|
45
|
+
select = false,
|
46
|
+
trigger = UI.Utils.debounce(function(e) {
|
47
|
+
if(select) {
|
48
|
+
return (select = false);
|
49
|
+
}
|
50
|
+
$this.handle();
|
51
|
+
}, this.options.delay);
|
52
|
+
|
53
|
+
|
54
|
+
this.dropdown = this.find('.uk-dropdown');
|
55
|
+
this.template = this.find('script[type="text/autocomplete"]').html();
|
56
|
+
this.template = UI.Utils.template(this.template || this.options.template);
|
57
|
+
this.input = this.find("input:first").attr("autocomplete", "off");
|
58
|
+
|
59
|
+
if (!this.dropdown.length) {
|
60
|
+
this.dropdown = $('<div class="uk-dropdown"></div>').appendTo(this.element);
|
61
|
+
}
|
62
|
+
|
63
|
+
if (this.options.flipDropdown) {
|
64
|
+
this.dropdown.addClass('uk-dropdown-flip');
|
65
|
+
}
|
66
|
+
|
67
|
+
this.input.on({
|
68
|
+
"keydown": function(e) {
|
69
|
+
|
70
|
+
if (e && e.which && !e.shiftKey) {
|
71
|
+
|
72
|
+
switch (e.which) {
|
73
|
+
case 13: // enter
|
74
|
+
select = true;
|
75
|
+
|
76
|
+
if ($this.selected) {
|
77
|
+
e.preventDefault();
|
78
|
+
$this.select();
|
79
|
+
}
|
80
|
+
break;
|
81
|
+
case 38: // up
|
82
|
+
e.preventDefault();
|
83
|
+
$this.pick('prev', true);
|
84
|
+
break;
|
85
|
+
case 40: // down
|
86
|
+
e.preventDefault();
|
87
|
+
$this.pick('next', true);
|
88
|
+
break;
|
89
|
+
case 27:
|
90
|
+
case 9: // esc, tab
|
91
|
+
$this.hide();
|
92
|
+
break;
|
93
|
+
default:
|
94
|
+
break;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
},
|
99
|
+
"keyup": trigger,
|
100
|
+
"blur": function(e) {
|
101
|
+
setTimeout(function() { $this.hide(); }, 200);
|
102
|
+
}
|
103
|
+
});
|
104
|
+
|
105
|
+
this.dropdown.on("click", ".uk-autocomplete-results > *", function(){
|
106
|
+
$this.select();
|
107
|
+
});
|
108
|
+
|
109
|
+
this.dropdown.on("mouseover", ".uk-autocomplete-results > *", function(){
|
110
|
+
$this.pick($(this));
|
111
|
+
});
|
112
|
+
|
113
|
+
this.triggercomplete = trigger;
|
114
|
+
},
|
115
|
+
|
116
|
+
handle: function() {
|
117
|
+
|
118
|
+
var $this = this, old = this.value;
|
119
|
+
|
120
|
+
this.value = this.input.val();
|
121
|
+
|
122
|
+
if (this.value.length < this.options.minLength) return this.hide();
|
123
|
+
|
124
|
+
if (this.value != old) {
|
125
|
+
$this.request();
|
126
|
+
}
|
127
|
+
|
128
|
+
return this;
|
129
|
+
},
|
130
|
+
|
131
|
+
pick: function(item, scrollinview) {
|
132
|
+
|
133
|
+
var $this = this,
|
134
|
+
items = this.dropdown.find('.uk-autocomplete-results').children(':not(.'+this.options.skipClass+')'),
|
135
|
+
selected = false;
|
136
|
+
|
137
|
+
if (typeof item !== "string" && !item.hasClass(this.options.skipClass)) {
|
138
|
+
selected = item;
|
139
|
+
} else if (item == 'next' || item == 'prev') {
|
140
|
+
|
141
|
+
if (this.selected) {
|
142
|
+
var index = items.index(this.selected);
|
143
|
+
|
144
|
+
if (item == 'next') {
|
145
|
+
selected = items.eq(index + 1 < items.length ? index + 1 : 0);
|
146
|
+
} else {
|
147
|
+
selected = items.eq(index - 1 < 0 ? items.length - 1 : index - 1);
|
148
|
+
}
|
149
|
+
|
150
|
+
} else {
|
151
|
+
selected = items[(item == 'next') ? 'first' : 'last']();
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
if (selected && selected.length) {
|
156
|
+
this.selected = selected;
|
157
|
+
items.removeClass(this.options.hoverClass);
|
158
|
+
this.selected.addClass(this.options.hoverClass);
|
159
|
+
|
160
|
+
// jump to selected if not in view
|
161
|
+
if (scrollinview) {
|
162
|
+
|
163
|
+
var top = selected.position().top,
|
164
|
+
scrollTop = $this.dropdown.scrollTop(),
|
165
|
+
dpheight = $this.dropdown.height();
|
166
|
+
|
167
|
+
if (top > dpheight || top < 0) {
|
168
|
+
$this.dropdown.scrollTop(scrollTop + top);
|
169
|
+
}
|
170
|
+
}
|
171
|
+
}
|
172
|
+
},
|
173
|
+
|
174
|
+
select: function() {
|
175
|
+
|
176
|
+
if(!this.selected) return;
|
177
|
+
|
178
|
+
var data = this.selected.data();
|
179
|
+
|
180
|
+
this.trigger("autocomplete-select", [data, this]);
|
181
|
+
|
182
|
+
if (data.value) {
|
183
|
+
this.input.val(data.value);
|
184
|
+
}
|
185
|
+
|
186
|
+
this.hide();
|
187
|
+
},
|
188
|
+
|
189
|
+
show: function() {
|
190
|
+
if (this.visible) return;
|
191
|
+
this.visible = true;
|
192
|
+
this.element.addClass("uk-open");
|
193
|
+
return this;
|
194
|
+
},
|
195
|
+
|
196
|
+
hide: function() {
|
197
|
+
if (!this.visible) return;
|
198
|
+
this.visible = false;
|
199
|
+
this.element.removeClass("uk-open");
|
200
|
+
return this;
|
201
|
+
},
|
202
|
+
|
203
|
+
request: function() {
|
204
|
+
|
205
|
+
var $this = this,
|
206
|
+
release = function(data) {
|
207
|
+
|
208
|
+
if(data) {
|
209
|
+
$this.render(data);
|
210
|
+
}
|
211
|
+
|
212
|
+
$this.element.removeClass($this.options.loadingClass);
|
213
|
+
};
|
214
|
+
|
215
|
+
this.element.addClass(this.options.loadingClass);
|
216
|
+
|
217
|
+
if (this.options.source) {
|
218
|
+
|
219
|
+
var source = this.options.source;
|
220
|
+
|
221
|
+
switch(typeof(this.options.source)) {
|
222
|
+
case 'function':
|
223
|
+
|
224
|
+
this.options.source.apply(this, [release]);
|
225
|
+
|
226
|
+
break;
|
227
|
+
|
228
|
+
case 'object':
|
229
|
+
|
230
|
+
if(source.length) {
|
231
|
+
|
232
|
+
var items = [];
|
233
|
+
|
234
|
+
source.forEach(function(item){
|
235
|
+
if(item.value && item.value.toLowerCase().indexOf($this.value.toLowerCase())!=-1) {
|
236
|
+
items.push(item);
|
237
|
+
}
|
238
|
+
});
|
239
|
+
|
240
|
+
release(items);
|
241
|
+
}
|
242
|
+
|
243
|
+
break;
|
244
|
+
|
245
|
+
case 'string':
|
246
|
+
|
247
|
+
var params ={};
|
248
|
+
|
249
|
+
params[this.options.param] = this.value;
|
250
|
+
|
251
|
+
$.ajax({
|
252
|
+
url: this.options.source,
|
253
|
+
data: params,
|
254
|
+
type: this.options.method,
|
255
|
+
dataType: 'json',
|
256
|
+
complete: function(xhr) {
|
257
|
+
release(xhr.responseJSON || []);
|
258
|
+
}
|
259
|
+
});
|
260
|
+
|
261
|
+
break;
|
262
|
+
|
263
|
+
default:
|
264
|
+
release(null);
|
265
|
+
}
|
266
|
+
|
267
|
+
} else {
|
268
|
+
this.element.removeClass($this.options.loadingClass);
|
269
|
+
}
|
270
|
+
},
|
271
|
+
|
272
|
+
render: function(data) {
|
273
|
+
|
274
|
+
var $this = this;
|
275
|
+
|
276
|
+
this.dropdown.empty();
|
277
|
+
|
278
|
+
this.selected = false;
|
279
|
+
|
280
|
+
if (this.options.renderer) {
|
281
|
+
|
282
|
+
this.options.renderer.apply(this, [data]);
|
283
|
+
|
284
|
+
} else if(data && data.length) {
|
285
|
+
|
286
|
+
this.dropdown.append(this.template({"items":data}));
|
287
|
+
this.show();
|
288
|
+
|
289
|
+
this.trigger('autocomplete-show');
|
290
|
+
}
|
291
|
+
|
292
|
+
return this;
|
293
|
+
}
|
294
|
+
});
|
295
|
+
|
296
|
+
// init code
|
297
|
+
$(document).on("focus.autocomplete.uikit", "[data-uk-autocomplete]", function(e) {
|
298
|
+
|
299
|
+
var ele = $(this);
|
300
|
+
if (!ele.data("autocomplete")) {
|
301
|
+
var obj = UI.autocomplete(ele, UI.Utils.options(ele.attr("data-uk-autocomplete")));
|
302
|
+
}
|
303
|
+
});
|
304
|
+
|
305
|
+
return UI.autocomplete;
|
306
|
+
});
|
@@ -0,0 +1,365 @@
|
|
1
|
+
/*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
|
3
|
+
(function(addon) {
|
4
|
+
|
5
|
+
var component;
|
6
|
+
|
7
|
+
if (jQuery && jQuery.UIkit) {
|
8
|
+
component = addon(jQuery, jQuery.UIkit);
|
9
|
+
}
|
10
|
+
|
11
|
+
if (typeof define == "function" && define.amd) {
|
12
|
+
define("uikit-datepicker", ["uikit"], function(){
|
13
|
+
return component || addon(jQuery, jQuery.UIkit);
|
14
|
+
});
|
15
|
+
}
|
16
|
+
|
17
|
+
})(function($, UI){
|
18
|
+
|
19
|
+
// Datepicker
|
20
|
+
|
21
|
+
var active = false, dropdown, moment;
|
22
|
+
|
23
|
+
UI.component('datepicker', {
|
24
|
+
|
25
|
+
defaults: {
|
26
|
+
weekstart: 1,
|
27
|
+
i18n: {
|
28
|
+
months : ['January','February','March','April','May','June','July','August','September','October','November','December'],
|
29
|
+
weekdays : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
|
30
|
+
},
|
31
|
+
format: "DD.MM.YYYY",
|
32
|
+
offsettop: 5,
|
33
|
+
maxDate: false,
|
34
|
+
minDate: false,
|
35
|
+
template: function(data, opts) {
|
36
|
+
|
37
|
+
var content = '', maxDate, minDate;
|
38
|
+
|
39
|
+
if (opts.maxDate!==false){
|
40
|
+
maxDate = isNaN(opts.maxDate) ? moment(opts.maxDate, opts.format) : moment().add('days', opts.maxDate);
|
41
|
+
}
|
42
|
+
|
43
|
+
if (opts.minDate!==false){
|
44
|
+
minDate = isNaN(opts.minDate) ? moment(opts.minDate, opts.format) : moment().add('days',opts.minDate-1);
|
45
|
+
}
|
46
|
+
|
47
|
+
content += '<div class="uk-datepicker-nav">';
|
48
|
+
content += '<a href="" class="uk-datepicker-previous"></a>';
|
49
|
+
content += '<a href="" class="uk-datepicker-next"></a>';
|
50
|
+
|
51
|
+
if (UI.formSelect) {
|
52
|
+
|
53
|
+
var i, currentyear = (new Date()).getFullYear(), options = [], months, years, minYear, maxYear;
|
54
|
+
|
55
|
+
for (i=0;i<opts.i18n.months.length;i++) {
|
56
|
+
if(i==data.month) {
|
57
|
+
options.push('<option value="'+i+'" selected>'+opts.i18n.months[i]+'</option>');
|
58
|
+
} else {
|
59
|
+
options.push('<option value="'+i+'">'+opts.i18n.months[i]+'</option>');
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
months = '<span class="uk-form-select">'+ opts.i18n.months[data.month] + '<select class="update-picker-month">'+options.join('')+'</select></span>';
|
64
|
+
|
65
|
+
// --
|
66
|
+
|
67
|
+
options = [];
|
68
|
+
|
69
|
+
minYear = minDate ? minDate.year() : currentyear - 50;
|
70
|
+
maxYear = maxDate ? maxDate.year() : currentyear + 20;
|
71
|
+
|
72
|
+
for (i=minYear;i<=maxYear;i++) {
|
73
|
+
if (i == data.year) {
|
74
|
+
options.push('<option value="'+i+'" selected>'+i+'</option>');
|
75
|
+
} else {
|
76
|
+
options.push('<option value="'+i+'">'+i+'</option>');
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
years = '<span class="uk-form-select">'+ data.year + '<select class="update-picker-year">'+options.join('')+'</select></span>';
|
81
|
+
|
82
|
+
content += '<div class="uk-datepicker-heading">'+ months + ' ' + years +'</div>';
|
83
|
+
|
84
|
+
} else {
|
85
|
+
content += '<div class="uk-datepicker-heading">'+ opts.i18n.months[data.month] +' '+ data.year+'</div>';
|
86
|
+
}
|
87
|
+
|
88
|
+
content += '</div>';
|
89
|
+
|
90
|
+
content += '<table class="uk-datepicker-table">';
|
91
|
+
content += '<thead>';
|
92
|
+
for(var i = 0; i < data.weekdays.length; i++) {
|
93
|
+
if (data.weekdays[i]) {
|
94
|
+
content += '<th>'+data.weekdays[i]+'</th>';
|
95
|
+
}
|
96
|
+
}
|
97
|
+
content += '</thead>';
|
98
|
+
|
99
|
+
content += '<tbody>';
|
100
|
+
for(var i = 0; i < data.days.length; i++) {
|
101
|
+
if (data.days[i] && data.days[i].length){
|
102
|
+
content += '<tr>';
|
103
|
+
for(var d = 0; d < data.days[i].length; d++) {
|
104
|
+
if (data.days[i][d]) {
|
105
|
+
var day = data.days[i][d],
|
106
|
+
cls = [];
|
107
|
+
|
108
|
+
if(!day.inmonth) cls.push("uk-datepicker-table-muted");
|
109
|
+
if(day.selected) cls.push("uk-active");
|
110
|
+
|
111
|
+
if (maxDate && day.day > maxDate) cls.push('uk-datepicker-date-disabled uk-datepicker-table-muted');
|
112
|
+
if (minDate && minDate > day.day) cls.push('uk-datepicker-date-disabled uk-datepicker-table-muted');
|
113
|
+
|
114
|
+
content += '<td><a href="" class="'+cls.join(" ")+'" data-date="'+day.day.format()+'">'+day.day.format("D")+'</a></td>';
|
115
|
+
}
|
116
|
+
}
|
117
|
+
content += '</tr>';
|
118
|
+
}
|
119
|
+
}
|
120
|
+
content += '</tbody>';
|
121
|
+
|
122
|
+
content += '</table>';
|
123
|
+
|
124
|
+
return content;
|
125
|
+
}
|
126
|
+
},
|
127
|
+
|
128
|
+
init: function() {
|
129
|
+
|
130
|
+
var $this = this;
|
131
|
+
|
132
|
+
this.current = this.element.val() ? moment(this.element.val(), this.options.format) : moment();
|
133
|
+
|
134
|
+
this.on("click", function(){
|
135
|
+
if(active!==$this) $this.pick(this.value);
|
136
|
+
}).on("change", function(){
|
137
|
+
|
138
|
+
if($this.element.val() && !moment($this.element.val(), $this.options.format).isValid()) {
|
139
|
+
$this.element.val(moment().format($this.options.format));
|
140
|
+
}
|
141
|
+
|
142
|
+
});
|
143
|
+
|
144
|
+
// init dropdown
|
145
|
+
if (!dropdown) {
|
146
|
+
|
147
|
+
dropdown = $('<div class="uk-dropdown uk-datepicker"></div>');
|
148
|
+
|
149
|
+
dropdown.on("click", ".uk-datepicker-next, .uk-datepicker-previous, [data-date]", function(e){
|
150
|
+
e.stopPropagation();
|
151
|
+
e.preventDefault();
|
152
|
+
|
153
|
+
var ele = $(this);
|
154
|
+
|
155
|
+
if (ele.hasClass('uk-datepicker-date-disabled')) return false;
|
156
|
+
|
157
|
+
if(ele.is('[data-date]')) {
|
158
|
+
active.element.val(moment(ele.data("date")).format(active.options.format)).trigger("change");
|
159
|
+
dropdown.hide();
|
160
|
+
active = false;
|
161
|
+
} else {
|
162
|
+
active.add("months", 1 * (ele.hasClass("uk-datepicker-next") ? 1:-1));
|
163
|
+
}
|
164
|
+
});
|
165
|
+
|
166
|
+
dropdown.on('change', '.update-picker-month, .update-picker-year', function(){
|
167
|
+
|
168
|
+
var select = $(this);
|
169
|
+
active[select.is('.update-picker-year') ? 'setYear':'setMonth'](Number(select.val()));
|
170
|
+
});
|
171
|
+
|
172
|
+
dropdown.appendTo("body");
|
173
|
+
}
|
174
|
+
},
|
175
|
+
|
176
|
+
pick: function(initdate) {
|
177
|
+
|
178
|
+
var offset = this.element.offset(),
|
179
|
+
css = {"top": offset.top + this.element.outerHeight() + this.options.offsettop, "left": offset.left, "right":""};
|
180
|
+
|
181
|
+
this.current = initdate ? moment(initdate, this.options.format):moment();
|
182
|
+
this.initdate = this.current.format("YYYY-MM-DD");
|
183
|
+
|
184
|
+
this.update();
|
185
|
+
|
186
|
+
if ($.UIkit.langdirection == 'right') {
|
187
|
+
css.right = window.innerWidth - (css.left + this.element.outerWidth());
|
188
|
+
css.left = "";
|
189
|
+
}
|
190
|
+
|
191
|
+
dropdown.css(css).show();
|
192
|
+
|
193
|
+
active = this;
|
194
|
+
},
|
195
|
+
|
196
|
+
add: function(unit, value) {
|
197
|
+
this.current.add(unit, value);
|
198
|
+
this.update();
|
199
|
+
},
|
200
|
+
|
201
|
+
setMonth: function(month) {
|
202
|
+
this.current.month(month);
|
203
|
+
this.update();
|
204
|
+
},
|
205
|
+
|
206
|
+
setYear: function(year) {
|
207
|
+
this.current.year(year);
|
208
|
+
this.update();
|
209
|
+
},
|
210
|
+
|
211
|
+
update: function() {
|
212
|
+
|
213
|
+
var data = this.getRows(this.current.year(), this.current.month()),
|
214
|
+
tpl = this.options.template(data, this.options);
|
215
|
+
|
216
|
+
dropdown.html(tpl);
|
217
|
+
},
|
218
|
+
|
219
|
+
getRows: function(year, month) {
|
220
|
+
|
221
|
+
var opts = this.options,
|
222
|
+
now = moment().format('YYYY-MM-DD'),
|
223
|
+
days = [31, (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month],
|
224
|
+
before = new Date(year, month, 1).getDay(),
|
225
|
+
data = {"month":month, "year":year,"weekdays":[],"days":[]},
|
226
|
+
row = [];
|
227
|
+
|
228
|
+
data.weekdays = (function(){
|
229
|
+
|
230
|
+
for (var i=0, arr=[]; i < 7; i++) {
|
231
|
+
|
232
|
+
var day = i + (opts.weekstart || 0);
|
233
|
+
|
234
|
+
while (day >= 7) {
|
235
|
+
day -= 7;
|
236
|
+
}
|
237
|
+
|
238
|
+
arr.push(opts.i18n.weekdays[day]);
|
239
|
+
}
|
240
|
+
|
241
|
+
return arr;
|
242
|
+
})();
|
243
|
+
|
244
|
+
if (opts.weekstart && opts.weekstart > 0) {
|
245
|
+
before -= opts.weekstart;
|
246
|
+
if (before < 0) {
|
247
|
+
before += 7;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
var cells = days + before, after = cells;
|
252
|
+
|
253
|
+
while(after > 7) { after -= 7; }
|
254
|
+
|
255
|
+
cells += 7 - after;
|
256
|
+
|
257
|
+
var day, isDisabled, isSelected, isToday, isInMonth;
|
258
|
+
|
259
|
+
for (var i = 0, r = 0; i < cells; i++) {
|
260
|
+
|
261
|
+
day = new Date(year, month, 1 + (i - before));
|
262
|
+
isDisabled = (opts.mindate && day < opts.mindate) || (opts.maxdate && day > opts.maxdate);
|
263
|
+
isInMonth = !(i < before || i >= (days + before));
|
264
|
+
|
265
|
+
day = moment(day);
|
266
|
+
|
267
|
+
isSelected = this.initdate == day.format("YYYY-MM-DD");
|
268
|
+
isToday = now == day.format("YYYY-MM-DD");
|
269
|
+
|
270
|
+
row.push({"selected": isSelected, "today": isToday, "disabled": isDisabled, "day":day, "inmonth":isInMonth});
|
271
|
+
|
272
|
+
if (++r === 7) {
|
273
|
+
data.days.push(row);
|
274
|
+
row = [];
|
275
|
+
r = 0;
|
276
|
+
}
|
277
|
+
}
|
278
|
+
|
279
|
+
return data;
|
280
|
+
}
|
281
|
+
});
|
282
|
+
|
283
|
+
|
284
|
+
// init code
|
285
|
+
$(document).on("focus.datepicker.uikit", "[data-uk-datepicker]", function(e) {
|
286
|
+
|
287
|
+
var ele = $(this);
|
288
|
+
if (!ele.data("datepicker")) {
|
289
|
+
e.preventDefault();
|
290
|
+
var obj = UI.datepicker(ele, UI.Utils.options(ele.attr("data-uk-datepicker")));
|
291
|
+
ele.trigger("focus");
|
292
|
+
}
|
293
|
+
});
|
294
|
+
|
295
|
+
$(document).on("click.datepicker.uikit", function(e) {
|
296
|
+
|
297
|
+
var target = $(e.target);
|
298
|
+
|
299
|
+
if (active && target[0] != dropdown[0] && !target.data("datepicker") && !target.parents(".uk-datepicker:first").length) {
|
300
|
+
dropdown.hide();
|
301
|
+
active = false;
|
302
|
+
}
|
303
|
+
});
|
304
|
+
|
305
|
+
//! moment.js
|
306
|
+
//! version : 2.5.1
|
307
|
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
308
|
+
//! license : MIT
|
309
|
+
//! momentjs.com
|
310
|
+
|
311
|
+
moment = (function(B){function G(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function Z(a,b){return function(c){return l(a.call(this,c),b)}}function ta(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function $(){}function H(a){aa(a);v(this,a)}function I(a){a=ba(a);var b=a.year||0,c=a.month||0,d=a.week||0,f=a.day||0;this._milliseconds=+(a.millisecond||0)+1E3*(a.second||0)+6E4*(a.minute||
|
312
|
+
0)+36E5*(a.hour||0);this._days=+f+7*d;this._months=+c+12*b;this._data={};this._bubble()}function v(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);b.hasOwnProperty("toString")&&(a.toString=b.toString);b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf);return a}function w(a){return 0>a?Math.ceil(a):Math.floor(a)}function l(a,b,c){for(var d=""+Math.abs(a);d.length<b;)d="0"+d;return(0<=a?c?"+":"":"-")+d}function J(a,b,c,d){var f=b._milliseconds,g=b._days;b=b._months;var m,h;f&&a._d.setTime(+a._d+
|
313
|
+
f*c);if(g||b)m=a.minute(),h=a.hour();g&&a.date(a.date()+g*c);b&&a.month(a.month()+b*c);f&&!d&&e.updateOffset(a,g||b);if(g||b)a.minute(m),a.hour(h)}function K(a){return"[object Array]"===Object.prototype.toString.call(a)}function ca(a,b,c){var d=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0,e;for(e=0;e<d;e++)(c&&a[e]!==b[e]||!c&&h(a[e])!==h(b[e]))&&g++;return g+f}function n(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=ua[a]||va[b]||b}return a}function ba(a){var b={},c,d;for(d in a)a.hasOwnProperty(d)&&
|
314
|
+
(c=n(d))&&(b[c]=a[d]);return b}function wa(a){var b,c;if(0===a.indexOf("week"))b=7,c="day";else if(0===a.indexOf("month"))b=12,c="month";else return;e[a]=function(d,f){var g,m,h=e.fn._lang[a],k=[];"number"===typeof d&&(f=d,d=B);m=function(a){a=e().utc().set(c,a);return h.call(e.fn._lang,a,d||"")};if(null!=f)return m(f);for(g=0;g<b;g++)k.push(m(g));return k}}function h(a){a=+a;var b=0;0!==a&&isFinite(a)&&(b=0<=a?Math.floor(a):Math.ceil(a));return b}function L(a,b){return(new Date(Date.UTC(a,b+1,0))).getUTCDate()}
|
315
|
+
function da(a,b,c){return C(e([a,11,31+b-c]),b,c).week}function M(a){return 0===a%4&&0!==a%100||0===a%400}function aa(a){var b;a._a&&-2===a._pf.overflow&&(b=0>a._a[x]||11<a._a[x]?x:1>a._a[q]||a._a[q]>L(a._a[r],a._a[x])?q:0>a._a[p]||23<a._a[p]?p:0>a._a[y]||59<a._a[y]?y:0>a._a[D]||59<a._a[D]?D:0>a._a[E]||999<a._a[E]?E:-1,a._pf._overflowDayOfYear&&(b<r||b>q)&&(b=q),a._pf.overflow=b)}function ea(a){null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&0>a._pf.overflow&&!a._pf.empty&&!a._pf.invalidMonth&&
|
316
|
+
!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length));return a._isValid}function N(a){return a?a.toLowerCase().replace("_","-"):a}function O(a,b){return b._isUTC?e(a).zone(b._offset||0):e(a).local()}function s(a){var b=0,c,d,f,g,m=function(a){if(!z[a]&&xa)try{require("./lang/"+a)}catch(b){}return z[a]};if(!a)return e.fn._lang;if(!K(a)){if(d=m(a))return d;a=[a]}for(;b<a.length;){g=N(a[b]).split("-");
|
317
|
+
c=g.length;for(f=(f=N(a[b+1]))?f.split("-"):null;0<c;){if(d=m(g.slice(0,c).join("-")))return d;if(f&&f.length>=c&&ca(g,f,!0)>=c-1)break;c--}b++}return e.fn._lang}function ya(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function za(a){var b=a.match(fa),c,d;c=0;for(d=b.length;c<d;c++)b[c]=u[b[c]]?u[b[c]]:ya(b[c]);return function(f){var g="";for(c=0;c<d;c++)g+=b[c]instanceof Function?b[c].call(f,a):b[c];return g}}function P(a,b){if(!a.isValid())return a.lang().invalidDate();
|
318
|
+
b=ga(b,a.lang());Q[b]||(Q[b]=za(b));return Q[b](a)}function ga(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(F.lastIndex=0;0<=d&&F.test(a);)a=a.replace(F,c),F.lastIndex=0,d-=1;return a}function Aa(a,b){var c=b._strict;switch(a){case "DDDD":return ha;case "YYYY":case "GGGG":case "gggg":return c?Ba:Ca;case "Y":case "G":case "g":return Da;case "YYYYYY":case "YYYYY":case "GGGGG":case "ggggg":return c?Ea:Fa;case "S":if(c)return Ga;case "SS":if(c)return ia;case "SSS":if(c)return ha;case "DDD":return Ha;
|
319
|
+
case "MMM":case "MMMM":case "dd":case "ddd":case "dddd":return Ia;case "a":case "A":return s(b._l)._meridiemParse;case "X":return Ja;case "Z":case "ZZ":return R;case "T":return Ka;case "SSSS":return La;case "MM":case "DD":case "YY":case "GG":case "gg":case "HH":case "hh":case "mm":case "ss":case "ww":case "WW":return c?ia:ja;case "M":case "D":case "d":case "H":case "h":case "m":case "s":case "w":case "W":case "e":case "E":return ja;case "Do":return Ma;default:var c=RegExp,d;d=Na(a.replace("\\","")).replace(/[-\/\\^$*+?.()|[\]{}]/g,
|
320
|
+
"\\$&");return new c(d)}}function ka(a){a=(a||"").match(R)||[];a=((a[a.length-1]||[])+"").match(Oa)||["-",0,0];var b=+(60*a[1])+h(a[2]);return"+"===a[0]?-b:b}function S(a){var b,c=[],d,f,g,m,k;if(!a._d){d=Pa(a);a._w&&null==a._a[q]&&null==a._a[x]&&(b=function(b){var c=parseInt(b,10);return b?3>b.length?68<c?1900+c:2E3+c:c:null==a._a[r]?e().weekYear():a._a[r]},f=a._w,null!=f.GG||null!=f.W||null!=f.E?b=la(b(f.GG),f.W||1,f.E,4,1):(g=s(a._l),m=null!=f.d?ma(f.d,g):null!=f.e?parseInt(f.e,10)+g._week.dow:
|
321
|
+
0,k=parseInt(f.w,10)||1,null!=f.d&&m<g._week.dow&&k++,b=la(b(f.gg),k,m,g._week.doy,g._week.dow)),a._a[r]=b.year,a._dayOfYear=b.dayOfYear);a._dayOfYear&&(b=null==a._a[r]?d[r]:a._a[r],a._dayOfYear>(M(b)?366:365)&&(a._pf._overflowDayOfYear=!0),b=T(b,0,a._dayOfYear),a._a[x]=b.getUTCMonth(),a._a[q]=b.getUTCDate());for(b=0;3>b&&null==a._a[b];++b)a._a[b]=c[b]=d[b];for(;7>b;b++)a._a[b]=c[b]=null==a._a[b]?2===b?1:0:a._a[b];c[p]+=h((a._tzm||0)/60);c[y]+=h((a._tzm||0)%60);a._d=(a._useUTC?T:Qa).apply(null,c)}}
|
322
|
+
function Pa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function U(a){a._a=[];a._pf.empty=!0;var b=s(a._l),c=""+a._i,d,f,g,e,k=c.length,l=0;f=ga(a._f,b).match(fa)||[];for(b=0;b<f.length;b++){g=f[b];if(d=(c.match(Aa(g,a))||[])[0])e=c.substr(0,c.indexOf(d)),0<e.length&&a._pf.unusedInput.push(e),c=c.slice(c.indexOf(d)+d.length),l+=d.length;if(u[g]){d?a._pf.empty=!1:a._pf.unusedTokens.push(g);e=a;var n=void 0,t=e._a;
|
323
|
+
switch(g){case "M":case "MM":null!=d&&(t[x]=h(d)-1);break;case "MMM":case "MMMM":n=s(e._l).monthsParse(d);null!=n?t[x]=n:e._pf.invalidMonth=d;break;case "D":case "DD":null!=d&&(t[q]=h(d));break;case "Do":null!=d&&(t[q]=h(parseInt(d,10)));break;case "DDD":case "DDDD":null!=d&&(e._dayOfYear=h(d));break;case "YY":t[r]=h(d)+(68<h(d)?1900:2E3);break;case "YYYY":case "YYYYY":case "YYYYYY":t[r]=h(d);break;case "a":case "A":e._isPm=s(e._l).isPM(d);break;case "H":case "HH":case "h":case "hh":t[p]=h(d);break;
|
324
|
+
case "m":case "mm":t[y]=h(d);break;case "s":case "ss":t[D]=h(d);break;case "S":case "SS":case "SSS":case "SSSS":t[E]=h(1E3*("0."+d));break;case "X":e._d=new Date(1E3*parseFloat(d));break;case "Z":case "ZZ":e._useUTC=!0;e._tzm=ka(d);break;case "w":case "ww":case "W":case "WW":case "d":case "dd":case "ddd":case "dddd":case "e":case "E":g=g.substr(0,1);case "gg":case "gggg":case "GG":case "GGGG":case "GGGGG":g=g.substr(0,2),d&&(e._w=e._w||{},e._w[g]=d)}}else a._strict&&!d&&a._pf.unusedTokens.push(g)}a._pf.charsLeftOver=
|
325
|
+
k-l;0<c.length&&a._pf.unusedInput.push(c);a._isPm&&12>a._a[p]&&(a._a[p]+=12);!1===a._isPm&&12===a._a[p]&&(a._a[p]=0);S(a);aa(a)}function Na(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,c,d,f,e){return c||d||f||e})}function Qa(a,b,c,d,f,e,h){b=new Date(a,b,c,d,f,e,h);1970>a&&b.setFullYear(a);return b}function T(a){var b=new Date(Date.UTC.apply(null,arguments));1970>a&&b.setUTCFullYear(a);return b}function ma(a,b){if("string"===typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!==
|
326
|
+
typeof a)return null}else a=parseInt(a,10);return a}function Ra(a,b,c,d,f){return f.relativeTime(b||1,!!c,a,d)}function C(a,b,c){b=c-b;c-=a.day();c>b&&(c-=7);c<b-7&&(c+=7);a=e(a).add("d",c);return{week:Math.ceil(a.dayOfYear()/7),year:a.year()}}function la(a,b,c,d,f){var e=T(a,0,1).getUTCDay();b=7*(b-1)+((null!=c?c:f)-f)+(f-e+(e>d?7:0)-(e<f?7:0))+1;return{year:0<b?a:a-1,dayOfYear:0<b?b:(M(a-1)?366:365)+b}}function na(a){var b=a._i,c=a._f;if(null===b)return e.invalid({nullInput:!0});"string"===typeof b&&
|
327
|
+
(a._i=b=s().preparse(b));if(e.isMoment(b)){a=b;var d={},f;for(f in a)a.hasOwnProperty(f)&&Sa.hasOwnProperty(f)&&(d[f]=a[f]);a=d;a._d=new Date(+b._d)}else if(c)if(K(c)){var b=a,g,h;if(0===b._f.length)b._pf.invalidFormat=!0,b._d=new Date(NaN);else{for(f=0;f<b._f.length;f++)if(c=0,d=v({},b),d._pf=G(),d._f=b._f[f],U(d),ea(d)&&(c+=d._pf.charsLeftOver,c+=10*d._pf.unusedTokens.length,d._pf.score=c,null==h||c<h))h=c,g=d;v(b,g||d)}}else U(a);else if(d=a,g=d._i,h=Ta.exec(g),g===B)d._d=new Date;else if(h)d._d=
|
328
|
+
new Date(+h[1]);else if("string"===typeof g)if(b=d._i,f=Ua.exec(b)){d._pf.iso=!0;g=0;for(h=V.length;g<h;g++)if(V[g][1].exec(b)){d._f=V[g][0]+(f[6]||" ");break}g=0;for(h=W.length;g<h;g++)if(W[g][1].exec(b)){d._f+=W[g][0];break}b.match(R)&&(d._f+="Z");U(d)}else d._d=new Date(b);else K(g)?(d._a=g.slice(0),S(d)):"[object Date]"===Object.prototype.toString.call(g)||g instanceof Date?d._d=new Date(+g):"object"===typeof g?d._d||(g=ba(d._i),d._a=[g.year,g.month,g.day,g.hour,g.minute,g.second,g.millisecond],
|
329
|
+
S(d)):d._d=new Date(g);return new H(a)}function oa(a,b){var c="date"===b||"month"===b||"year"===b;e.fn[a]=e.fn[a+"s"]=function(a,f){var g=this._isUTC?"UTC":"";null==f&&(f=c);return null!=a?(this._d["set"+g+b](a),e.updateOffset(this,f),this):this._d["get"+g+b]()}}function Va(a){e.duration.fn[a]=function(){return this._data[a]}}function pa(a,b){e.duration.fn["as"+a]=function(){return+this/b}}for(var e,A=Math.round,k,r=0,x=1,q=2,p=3,y=4,D=5,E=6,z={},Sa={_isAMomentObject:null,_i:null,_f:null,_l:null,
|
330
|
+
_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},xa="undefined"!==typeof module&&module.exports&&"undefined"!==typeof require,Ta=/^\/?Date\((\-?\d+)/i,Wa=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Xa=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,fa=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,
|
331
|
+
F=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,ja=/\d\d?/,Ha=/\d{1,3}/,Ca=/\d{1,4}/,Fa=/[+\-]?\d{1,6}/,La=/\d+/,Ia=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,R=/Z|[\+\-]\d\d:?\d\d/gi,Ka=/T/i,Ja=/[\+\-]?\d+(\.\d{1,3})?/,Ma=/\d{1,2}/,Ga=/\d/,ia=/\d\d/,ha=/\d{3}/,Ba=/\d{4}/,Ea=/[+-]?\d{6}/,Da=/[+-]?\d+/,Ua=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
|
332
|
+
V=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],W=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Oa=/([\+\-]|\d\d)/gi,X=["Date","Hours","Minutes","Seconds","Milliseconds"],Y={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6},ua={ms:"millisecond",s:"second",
|
333
|
+
m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},va={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},Q={},qa="DDD w W M D d".split(" "),ra="MDHhmswW".split(""),u={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},
|
334
|
+
DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return l(this.year()%100,2)},YYYY:function(){return l(this.year(),4)},YYYYY:function(){return l(this.year(),5)},YYYYYY:function(){var a=this.year();return(0<=a?"+":"-")+l(Math.abs(a),
|
335
|
+
6)},gg:function(){return l(this.weekYear()%100,2)},gggg:function(){return l(this.weekYear(),4)},ggggg:function(){return l(this.weekYear(),5)},GG:function(){return l(this.isoWeekYear()%100,2)},GGGG:function(){return l(this.isoWeekYear(),4)},GGGGG:function(){return l(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),
|
336
|
+
!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return h(this.milliseconds()/100)},SS:function(){return l(h(this.milliseconds()/10),2)},SSS:function(){return l(this.milliseconds(),3)},SSSS:function(){return l(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";0>a&&(a=-a,b="-");return b+l(h(a/60),2)+":"+l(h(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";0>a&&(a=-a,b="-");
|
337
|
+
return b+l(h(a/60),2)+l(h(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},sa=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];qa.length;)k=qa.pop(),u[k+"o"]=ta(u[k],k);for(;ra.length;)k=ra.pop(),u[k+k]=Z(u[k],2);u.DDDD=Z(u.DDD,3);v($.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"===typeof b?this[c]=b:this["_"+c]=b},_months:"January February March April May June July August September October November December".split(" "),
|
338
|
+
months:function(a){return this._months[a.month()]},_monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c;this._monthsParse||(this._monthsParse=[]);for(b=0;12>b;b++)if(this._monthsParse[b]||(c=e.utc([2E3,b]),c="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=RegExp(c.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
|
339
|
+
weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c;this._weekdaysParse||(this._weekdaysParse=[]);for(b=0;7>b;b++)if(this._weekdaysParse[b]||(c=e([2E3,1]).day(b),c="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,
|
340
|
+
""),this._weekdaysParse[b]=RegExp(c.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b);return b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},
|
341
|
+
_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return 11<a?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"===typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",
|
342
|
+
y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var f=this._relativeTime[c];return"function"===typeof f?f(a,b,c,d):f.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[0<a?"future":"past"];return"function"===typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return C(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",
|
343
|
+
invalidDate:function(){return this._invalidDate}});e=function(a,b,c,d){var f;"boolean"===typeof c&&(d=c,c=B);f={_isAMomentObject:!0};f._i=a;f._f=b;f._l=c;f._strict=d;f._isUTC=!1;f._pf=G();return na(f)};e.utc=function(a,b,c,d){var f;"boolean"===typeof c&&(d=c,c=B);f={_isAMomentObject:!0,_useUTC:!0,_isUTC:!0};f._l=c;f._i=a;f._f=b;f._strict=d;f._pf=G();return na(f).utc()};e.unix=function(a){return e(1E3*a)};e.duration=function(a,b){var c=a,d=null,f;if(e.isDuration(a))c={ms:a._milliseconds,d:a._days,
|
344
|
+
M:a._months};else if("number"===typeof a)c={},b?c[b]=a:c.milliseconds=a;else if(d=Wa.exec(a))f="-"===d[1]?-1:1,c={y:0,d:h(d[q])*f,h:h(d[p])*f,m:h(d[y])*f,s:h(d[D])*f,ms:h(d[E])*f};else if(d=Xa.exec(a))f="-"===d[1]?-1:1,c=function(a){a=a&&parseFloat(a.replace(",","."));return(isNaN(a)?0:a)*f},c={y:c(d[2]),M:c(d[3]),d:c(d[4]),h:c(d[5]),m:c(d[6]),s:c(d[7]),w:c(d[8])};d=new I(c);e.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang);return d};e.version="2.5.1";e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";
|
345
|
+
e.updateOffset=function(){};e.lang=function(a,b){if(!a)return e.fn._lang._abbr;if(b){var c=N(a);b.abbr=c;z[c]||(z[c]=new $);z[c].set(b)}else null===b?(delete z[a],a="en"):z[a]||s(a);return(e.duration.fn._lang=e.fn._lang=s(a))._abbr};e.langData=function(a){a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr);return s(a)};e.isMoment=function(a){return a instanceof H||null!=a&&a.hasOwnProperty("_isAMomentObject")};e.isDuration=function(a){return a instanceof I};for(k=sa.length-1;0<=k;--k)wa(sa[k]);e.normalizeUnits=
|
346
|
+
function(a){return n(a)};e.invalid=function(a){var b=e.utc(NaN);null!=a?v(b._pf,a):b._pf.userInvalidated=!0;return b};e.parseZone=function(){return e.apply(null,arguments).parseZone()};v(e.fn=H.prototype,{clone:function(){return e(this)},valueOf:function(){return+this._d+6E4*(this._offset||0)},unix:function(){return Math.floor(+this/1E3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=
|
347
|
+
e(this).utc();return 0<a.year()&&9999>=a.year()?P(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):P(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){return[this.year(),this.month(),this.date(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()]},isValid:function(){return ea(this)},isDSTShifted:function(){return this._a?this.isValid()&&0<ca(this._a,(this._isUTC?e.utc(this._a):e(this._a)).toArray()):!1},parsingFlags:function(){return v({},this._pf)},invalidAt:function(){return this._pf.overflow},
|
348
|
+
utc:function(){return this.zone(0)},local:function(){this.zone(0);this._isUTC=!1;return this},format:function(a){a=P(this,a||e.defaultFormat);return this.lang().postformat(a)},add:function(a,b){var c;c="string"===typeof a?e.duration(+b,a):e.duration(a,b);J(this,c,1);return this},subtract:function(a,b){var c;c="string"===typeof a?e.duration(+b,a):e.duration(a,b);J(this,c,-1);return this},diff:function(a,b,c){a=O(a,this);var d=6E4*(this.zone()-a.zone()),f;b=n(b);"year"===b||"month"===b?(f=432E5*(this.daysInMonth()+
|
349
|
+
a.daysInMonth()),d=12*(this.year()-a.year())+(this.month()-a.month()),d+=(this-e(this).startOf("month")-(a-e(a).startOf("month")))/f,d-=6E4*(this.zone()-e(this).startOf("month").zone()-(a.zone()-e(a).startOf("month").zone()))/f,"year"===b&&(d/=12)):(f=this-a,d="second"===b?f/1E3:"minute"===b?f/6E4:"hour"===b?f/36E5:"day"===b?(f-d)/864E5:"week"===b?(f-d)/6048E5:f);return c?d:w(d)},from:function(a,b){return e.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(e(),
|
350
|
+
a)},calendar:function(){var a=O(e(),this).startOf("day"),a=this.diff(a,"days",!0),a=-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse";return this.format(this.lang().calendar(a,this))},isLeapYear:function(){return M(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=ma(a,this.lang()),this.add({d:a-
|
351
|
+
b})):b},month:function(a){var b=this._isUTC?"UTC":"",c;if(null!=a){if("string"===typeof a&&(a=this.lang().monthsParse(a),"number"!==typeof a))return this;c=Math.min(this.date(),L(this.year(),a));this._d["set"+b+"Month"](a,c);e.updateOffset(this,!0);return this}return this._d["get"+b+"Month"]()},startOf:function(a){a=n(a);switch(a){case "year":this.month(0);case "month":this.date(1);case "week":case "isoWeek":case "day":this.hours(0);case "hour":this.minutes(0);case "minute":this.seconds(0);case "second":this.milliseconds(0)}"week"===
|
352
|
+
a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1);return this},endOf:function(a){a=n(a);return this.startOf(a).add("isoWeek"===a?"week":a,1).subtract("ms",1)},isAfter:function(a,b){b="undefined"!==typeof b?b:"millisecond";return+this.clone().startOf(b)>+e(a).startOf(b)},isBefore:function(a,b){b="undefined"!==typeof b?b:"millisecond";return+this.clone().startOf(b)<+e(a).startOf(b)},isSame:function(a,b){b=b||"ms";return+this.clone().startOf(b)===+O(a,this).startOf(b)},min:function(a){a=e.apply(null,
|
353
|
+
arguments);return a<this?this:a},max:function(a){a=e.apply(null,arguments);return a>this?this:a},zone:function(a,b){b=null==b?!0:!1;var c=this._offset||0;if(null!=a)"string"===typeof a&&(a=ka(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,c!==a&&b&&J(this,e.duration(c-a,"m"),1,!0);else return this._isUTC?c:this._d.getTimezoneOffset();return this},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){this._tzm?
|
354
|
+
this.zone(this._tzm):"string"===typeof this._i&&this.zone(this._i);return this},hasAlignedHourOffset:function(a){a=a?e(a).zone():0;return 0===(this.zone()-a)%60},daysInMonth:function(){return L(this.year(),this.month())},dayOfYear:function(a){var b=A((e(this).startOf("day")-e(this).startOf("year"))/864E5)+1;return null==a?b:this.add("d",a-b)},quarter:function(){return Math.ceil((this.month()+1)/3)},weekYear:function(a){var b=C(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?
|
355
|
+
b:this.add("y",a-b)},isoWeekYear:function(a){var b=C(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=C(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return da(this.year(),
|
356
|
+
1,4)},weeksInYear:function(){var a=this._lang._week;return da(this.year(),a.dow,a.doy)},get:function(a){a=n(a);return this[a]()},set:function(a,b){a=n(a);if("function"===typeof this[a])this[a](b);return this},lang:function(a){if(a===B)return this._lang;this._lang=s(a);return this}});for(k=0;k<X.length;k++)oa(X[k].toLowerCase().replace(/s$/,""),X[k]);oa("year","FullYear");e.fn.days=e.fn.day;e.fn.months=e.fn.month;e.fn.weeks=e.fn.week;e.fn.isoWeeks=e.fn.isoWeek;e.fn.toJSON=e.fn.toISOString;v(e.duration.fn=
|
357
|
+
I.prototype,{_bubble:function(){var a=this._milliseconds,b=this._days,c=this._months,d=this._data;d.milliseconds=a%1E3;a=w(a/1E3);d.seconds=a%60;a=w(a/60);d.minutes=a%60;a=w(a/60);d.hours=a%24;b+=w(a/24);d.days=b%30;c+=w(b/30);d.months=c%12;b=w(c/12);d.years=b},weeks:function(){return w(this.days()/7)},valueOf:function(){return this._milliseconds+864E5*this._days+this._months%12*2592E6+31536E6*h(this._months/12)},humanize:function(a){var b=+this,c;c=!a;var d=this.lang(),f=A(Math.abs(b)/1E3),e=A(f/
|
358
|
+
60),h=A(e/60),k=A(h/24),l=A(k/365),f=45>f&&["s",f]||1===e&&["m"]||45>e&&["mm",e]||1===h&&["h"]||22>h&&["hh",h]||1===k&&["d"]||25>=k&&["dd",k]||45>=k&&["M"]||345>k&&["MM",A(k/30)]||1===l&&["y"]||["yy",l];f[2]=c;f[3]=0<b;f[4]=d;c=Ra.apply({},f);a&&(c=this.lang().pastFuture(b,c));return this.lang().postformat(c)},add:function(a,b){var c=e.duration(a,b);this._milliseconds+=c._milliseconds;this._days+=c._days;this._months+=c._months;this._bubble();return this},subtract:function(a,b){var c=e.duration(a,
|
359
|
+
b);this._milliseconds-=c._milliseconds;this._days-=c._days;this._months-=c._months;this._bubble();return this},get:function(a){a=n(a);return this[a.toLowerCase()+"s"]()},as:function(a){a=n(a);return this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:e.fn.lang,toIsoString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),g=Math.abs(this.seconds()+this.milliseconds()/1E3);return this.asSeconds()?(0>
|
360
|
+
this.asSeconds()?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||g?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(g?g+"S":""):"P0D"}});for(k in Y)Y.hasOwnProperty(k)&&(pa(k,Y[k]),Va(k.toLowerCase()));pa("Weeks",6048E5);e.duration.fn.asMonths=function(){return(+this-31536E6*this.years())/2592E6+12*this.years()};e.lang("en",{ordinal:function(a){var b=a%10,b=1===h(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+b}});return e}).call(this);
|
361
|
+
|
362
|
+
UI.datepicker.moment = moment;
|
363
|
+
|
364
|
+
return UI.datepicker;
|
365
|
+
});
|