bootstrap-datetimepicker-rails 0.0.7 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -2
- data/lib/bootstrap-datetimepicker-rails/version.rb +1 -1
- data/vendor/assets/javascripts/bootstrap-datetimepicker.js +198 -92
- data/vendor/assets/javascripts/locales/bootstrap-datetimepicker.fa-IR.js +14 -0
- data/vendor/assets/javascripts/locales/bootstrap-datetimepicker.rs-latin.js +1 -1
- data/vendor/assets/stylesheets/bootstrap-datetimepicker.css +8 -0
- metadata +5 -4
- data/vendor/assets/stylesheets/bootstrap-datetimepicker.less +0 -141
data/README.md
CHANGED
@@ -16,9 +16,12 @@ If you want to include a localization file, also add the following directive:
|
|
16
16
|
|
17
17
|
//= require locales/bootstrap-datetimepicker.<locale>.js>
|
18
18
|
|
19
|
-
Add the following line to your stylesheet file (
|
19
|
+
Add the following line to your stylesheet file (`bootstrap_and_overrides.scss`):
|
20
20
|
|
21
|
-
|
21
|
+
```scss
|
22
|
+
@import 'bootstrap';
|
23
|
+
@import 'bootstrap-datetimepicker';
|
24
|
+
```
|
22
25
|
|
23
26
|
## Usage
|
24
27
|
|
@@ -32,6 +32,13 @@
|
|
32
32
|
this.id = dpgId++;
|
33
33
|
this.init(element, options);
|
34
34
|
};
|
35
|
+
|
36
|
+
var dateToDate = function(dt) {
|
37
|
+
if (typeof dt === 'string') {
|
38
|
+
return new Date(dt);
|
39
|
+
}
|
40
|
+
return dt;
|
41
|
+
};
|
35
42
|
|
36
43
|
DateTimePicker.prototype = {
|
37
44
|
constructor: DateTimePicker,
|
@@ -46,7 +53,9 @@
|
|
46
53
|
this.pickDate = options.pickDate;
|
47
54
|
this.pickTime = options.pickTime;
|
48
55
|
this.isInput = this.$element.is('input');
|
49
|
-
this.component =
|
56
|
+
this.component = false;
|
57
|
+
if (this.$element.is('.input-append') || this.$element.is('.input-prepend'))
|
58
|
+
this.component = this.$element.find('.add-on');
|
50
59
|
this.format = options.format;
|
51
60
|
if (!this.format) {
|
52
61
|
if (this.isInput) this.format = this.$element.data('format');
|
@@ -68,7 +77,7 @@
|
|
68
77
|
icon.removeClass(this.timeIcon);
|
69
78
|
icon.addClass(this.dateIcon);
|
70
79
|
}
|
71
|
-
this.widget = $(getTemplate(this.timeIcon, options.pickDate, options.pickTime, options.pick12HourFormat)).appendTo('body');
|
80
|
+
this.widget = $(getTemplate(this.timeIcon, options.pickDate, options.pickTime, options.pick12HourFormat, options.pickSeconds)).appendTo('body');
|
72
81
|
this.minViewMode = options.minViewMode||this.$element.data('date-minviewmode')||0;
|
73
82
|
if (typeof this.minViewMode === 'string') {
|
74
83
|
switch (this.minViewMode) {
|
@@ -100,6 +109,8 @@
|
|
100
109
|
this.startViewMode = this.viewMode;
|
101
110
|
this.weekStart = options.weekStart||this.$element.data('date-weekstart')||0;
|
102
111
|
this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
|
112
|
+
this.setStartDate(options.startDate || this.$element.data('date-startdate'));
|
113
|
+
this.setEndDate(options.endDate || this.$element.data('date-enddate'));
|
103
114
|
this.fillDow();
|
104
115
|
this.fillMonths();
|
105
116
|
this.fillHours();
|
@@ -125,6 +136,15 @@
|
|
125
136
|
}
|
126
137
|
},
|
127
138
|
|
139
|
+
disable: function(){
|
140
|
+
this.$element.find('input').prop('disabled',true);
|
141
|
+
this._detachDatePickerEvents();
|
142
|
+
},
|
143
|
+
enable: function(){
|
144
|
+
this.$element.find('input').prop('disabled',false);
|
145
|
+
this._attachDatePickerEvents();
|
146
|
+
},
|
147
|
+
|
128
148
|
hide: function() {
|
129
149
|
// Ignore event if in the middle of a picker transition
|
130
150
|
var collapse = this.widget.find('.collapse')
|
@@ -168,7 +188,7 @@
|
|
168
188
|
}
|
169
189
|
if (typeof newDate === 'string') {
|
170
190
|
this._date = this.parseDate(newDate);
|
171
|
-
} else {
|
191
|
+
} else if(newDate) {
|
172
192
|
this._date = new Date(newDate);
|
173
193
|
}
|
174
194
|
this.set();
|
@@ -186,6 +206,38 @@
|
|
186
206
|
if (!date) this.setValue(null);
|
187
207
|
else this.setValue(date.valueOf());
|
188
208
|
},
|
209
|
+
|
210
|
+
setStartDate: function(date) {
|
211
|
+
if (date instanceof Date) {
|
212
|
+
this.startDate = date;
|
213
|
+
} else if (typeof date === 'string') {
|
214
|
+
this.startDate = new UTCDate(date);
|
215
|
+
if (! this.startDate.getUTCFullYear()) {
|
216
|
+
this.startDate = -Infinity;
|
217
|
+
}
|
218
|
+
} else {
|
219
|
+
this.startDate = -Infinity;
|
220
|
+
}
|
221
|
+
if (this.viewDate) {
|
222
|
+
this.update();
|
223
|
+
}
|
224
|
+
},
|
225
|
+
|
226
|
+
setEndDate: function(date) {
|
227
|
+
if (date instanceof Date) {
|
228
|
+
this.endDate = date;
|
229
|
+
} else if (typeof date === 'string') {
|
230
|
+
this.endDate = new UTCDate(date);
|
231
|
+
if (! this.endDate.getUTCFullYear()) {
|
232
|
+
this.endDate = Infinity;
|
233
|
+
}
|
234
|
+
} else {
|
235
|
+
this.endDate = Infinity;
|
236
|
+
}
|
237
|
+
if (this.viewDate) {
|
238
|
+
this.update();
|
239
|
+
}
|
240
|
+
},
|
189
241
|
|
190
242
|
getLocalDate: function() {
|
191
243
|
if (this._unset) return null;
|
@@ -277,13 +329,30 @@
|
|
277
329
|
this._date.getUTCDate(),
|
278
330
|
0, 0, 0, 0
|
279
331
|
);
|
332
|
+
var startYear = typeof this.startDate === 'object' ? this.startDate.getUTCFullYear() : -Infinity;
|
333
|
+
var startMonth = typeof this.startDate === 'object' ? this.startDate.getUTCMonth() : -1;
|
334
|
+
var endYear = typeof this.endDate === 'object' ? this.endDate.getUTCFullYear() : Infinity;
|
335
|
+
var endMonth = typeof this.endDate === 'object' ? this.endDate.getUTCMonth() : 12;
|
336
|
+
|
337
|
+
this.widget.find('.datepicker-days').find('.disabled').removeClass('disabled');
|
338
|
+
this.widget.find('.datepicker-months').find('.disabled').removeClass('disabled');
|
339
|
+
this.widget.find('.datepicker-years').find('.disabled').removeClass('disabled');
|
340
|
+
|
280
341
|
this.widget.find('.datepicker-days th:eq(1)').text(
|
281
342
|
dates[this.language].months[month] + ' ' + year);
|
343
|
+
|
282
344
|
var prevMonth = UTCDate(year, month-1, 28, 0, 0, 0, 0);
|
283
345
|
var day = DPGlobal.getDaysInMonth(
|
284
346
|
prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
|
285
347
|
prevMonth.setUTCDate(day);
|
286
348
|
prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.weekStart + 7) % 7);
|
349
|
+
if ((year == startYear && month <= startMonth) || year < startYear) {
|
350
|
+
this.widget.find('.datepicker-days th:eq(0)').addClass('disabled');
|
351
|
+
}
|
352
|
+
if ((year == endYear && month >= endMonth) || year > endYear) {
|
353
|
+
this.widget.find('.datepicker-days th:eq(2)').addClass('disabled');
|
354
|
+
}
|
355
|
+
|
287
356
|
var nextMonth = new Date(prevMonth.valueOf());
|
288
357
|
nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
|
289
358
|
nextMonth = nextMonth.valueOf();
|
@@ -306,6 +375,12 @@
|
|
306
375
|
if (prevMonth.valueOf() === currentDate.valueOf()) {
|
307
376
|
clsName += ' active';
|
308
377
|
}
|
378
|
+
if ((prevMonth.valueOf() + 86400000) <= this.startDate) {
|
379
|
+
clsName += ' disabled';
|
380
|
+
}
|
381
|
+
if (prevMonth.valueOf() > this.endDate) {
|
382
|
+
clsName += ' disabled';
|
383
|
+
}
|
309
384
|
html.push('<td class="day' + clsName + '">' + prevMonth.getUTCDate() + '</td>');
|
310
385
|
if (prevMonth.getUTCDay() === this.weekEnd) {
|
311
386
|
html.push('</tr>');
|
@@ -320,14 +395,34 @@
|
|
320
395
|
if (currentYear === year) {
|
321
396
|
months.eq(this._date.getUTCMonth()).addClass('active');
|
322
397
|
}
|
398
|
+
if (currentYear - 1 < startYear) {
|
399
|
+
this.widget.find('.datepicker-months th:eq(0)').addClass('disabled');
|
400
|
+
}
|
401
|
+
if (currentYear + 1 > endYear) {
|
402
|
+
this.widget.find('.datepicker-months th:eq(2)').addClass('disabled');
|
403
|
+
}
|
404
|
+
for (var i = 0; i < 12; i++) {
|
405
|
+
if ((year == startYear && startMonth > i) || (year < startYear)) {
|
406
|
+
$(months[i]).addClass('disabled');
|
407
|
+
} else if ((year == endYear && endMonth < i) || (year > endYear)) {
|
408
|
+
$(months[i]).addClass('disabled');
|
409
|
+
}
|
410
|
+
}
|
323
411
|
|
324
412
|
html = '';
|
325
413
|
year = parseInt(year/10, 10) * 10;
|
326
414
|
var yearCont = this.widget.find('.datepicker-years').find(
|
327
415
|
'th:eq(1)').text(year + '-' + (year + 9)).end().find('td');
|
416
|
+
this.widget.find('.datepicker-years').find('th').removeClass('disabled');
|
417
|
+
if (startYear > year) {
|
418
|
+
this.widget.find('.datepicker-years').find('th:eq(0)').addClass('disabled');
|
419
|
+
}
|
420
|
+
if (endYear < year+9) {
|
421
|
+
this.widget.find('.datepicker-years').find('th:eq(2)').addClass('disabled');
|
422
|
+
}
|
328
423
|
year -= 1;
|
329
424
|
for (var i = -1; i < 11; i++) {
|
330
|
-
html += '<span class="year' + (i === -1 || i === 10 ? ' old' : '') + (currentYear === year ? ' active' : '') + '">' + year + '</span>';
|
425
|
+
html += '<span class="year' + (i === -1 || i === 10 ? ' old' : '') + (currentYear === year ? ' active' : '') + ((year < startYear || year > endYear) ? ' disabled' : '') + '">' + year + '</span>';
|
331
426
|
year += 1;
|
332
427
|
}
|
333
428
|
yearCont.html(html);
|
@@ -426,84 +521,87 @@
|
|
426
521
|
click: function(e) {
|
427
522
|
e.stopPropagation();
|
428
523
|
e.preventDefault();
|
524
|
+
this._unset = false;
|
429
525
|
var target = $(e.target).closest('span, td, th');
|
430
526
|
if (target.length === 1) {
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
if (this.viewMode !== 0) {
|
458
|
-
this._date = UTCDate(
|
459
|
-
this.viewDate.getUTCFullYear(),
|
460
|
-
this.viewDate.getUTCMonth(),
|
461
|
-
this.viewDate.getUTCDate(),
|
462
|
-
this._date.getUTCHours(),
|
463
|
-
this._date.getUTCMinutes(),
|
464
|
-
this._date.getUTCSeconds(),
|
465
|
-
this._date.getUTCMilliseconds()
|
466
|
-
);
|
467
|
-
this.notifyChange();
|
468
|
-
}
|
469
|
-
this.showMode(-1);
|
470
|
-
this.fillDate();
|
471
|
-
this.set();
|
472
|
-
break;
|
473
|
-
case 'td':
|
474
|
-
if (target.is('.day')) {
|
475
|
-
var day = parseInt(target.text(), 10) || 1;
|
476
|
-
var month = this.viewDate.getUTCMonth();
|
477
|
-
var year = this.viewDate.getUTCFullYear();
|
478
|
-
if (target.is('.old')) {
|
479
|
-
if (month === 0) {
|
480
|
-
month = 11;
|
481
|
-
year -= 1;
|
482
|
-
} else {
|
483
|
-
month -= 1;
|
484
|
-
}
|
485
|
-
} else if (target.is('.new')) {
|
486
|
-
if (month == 11) {
|
487
|
-
month = 0;
|
488
|
-
year += 1;
|
489
|
-
} else {
|
490
|
-
month += 1;
|
491
|
-
}
|
527
|
+
if (! target.is('.disabled')) {
|
528
|
+
switch(target[0].nodeName.toLowerCase()) {
|
529
|
+
case 'th':
|
530
|
+
switch(target[0].className) {
|
531
|
+
case 'switch':
|
532
|
+
this.showMode(1);
|
533
|
+
break;
|
534
|
+
case 'prev':
|
535
|
+
case 'next':
|
536
|
+
var vd = this.viewDate;
|
537
|
+
var navFnc = DPGlobal.modes[this.viewMode].navFnc;
|
538
|
+
var step = DPGlobal.modes[this.viewMode].navStep;
|
539
|
+
if (target[0].className === 'prev') step = step * -1;
|
540
|
+
vd['set' + navFnc](vd['get' + navFnc]() + step);
|
541
|
+
this.fillDate();
|
542
|
+
this.set();
|
543
|
+
break;
|
544
|
+
}
|
545
|
+
break;
|
546
|
+
case 'span':
|
547
|
+
if (target.is('.month')) {
|
548
|
+
var month = target.parent().find('span').index(target);
|
549
|
+
this.viewDate.setUTCMonth(month);
|
550
|
+
} else {
|
551
|
+
var year = parseInt(target.text(), 10) || 0;
|
552
|
+
this.viewDate.setUTCFullYear(year);
|
492
553
|
}
|
493
|
-
this.
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
554
|
+
if (this.viewMode !== 0) {
|
555
|
+
this._date = UTCDate(
|
556
|
+
this.viewDate.getUTCFullYear(),
|
557
|
+
this.viewDate.getUTCMonth(),
|
558
|
+
this.viewDate.getUTCDate(),
|
559
|
+
this._date.getUTCHours(),
|
560
|
+
this._date.getUTCMinutes(),
|
561
|
+
this._date.getUTCSeconds(),
|
562
|
+
this._date.getUTCMilliseconds()
|
563
|
+
);
|
564
|
+
this.notifyChange();
|
565
|
+
}
|
566
|
+
this.showMode(-1);
|
502
567
|
this.fillDate();
|
503
568
|
this.set();
|
504
|
-
|
505
|
-
|
506
|
-
|
569
|
+
break;
|
570
|
+
case 'td':
|
571
|
+
if (target.is('.day')) {
|
572
|
+
var day = parseInt(target.text(), 10) || 1;
|
573
|
+
var month = this.viewDate.getUTCMonth();
|
574
|
+
var year = this.viewDate.getUTCFullYear();
|
575
|
+
if (target.is('.old')) {
|
576
|
+
if (month === 0) {
|
577
|
+
month = 11;
|
578
|
+
year -= 1;
|
579
|
+
} else {
|
580
|
+
month -= 1;
|
581
|
+
}
|
582
|
+
} else if (target.is('.new')) {
|
583
|
+
if (month == 11) {
|
584
|
+
month = 0;
|
585
|
+
year += 1;
|
586
|
+
} else {
|
587
|
+
month += 1;
|
588
|
+
}
|
589
|
+
}
|
590
|
+
this._date = UTCDate(
|
591
|
+
year, month, day,
|
592
|
+
this._date.getUTCHours(),
|
593
|
+
this._date.getUTCMinutes(),
|
594
|
+
this._date.getUTCSeconds(),
|
595
|
+
this._date.getUTCMilliseconds()
|
596
|
+
);
|
597
|
+
this.viewDate = UTCDate(
|
598
|
+
year, month, Math.min(28, day) , 0, 0, 0, 0);
|
599
|
+
this.fillDate();
|
600
|
+
this.set();
|
601
|
+
this.notifyChange();
|
602
|
+
}
|
603
|
+
break;
|
604
|
+
}
|
507
605
|
}
|
508
606
|
}
|
509
607
|
},
|
@@ -684,6 +782,7 @@
|
|
684
782
|
// unset the date when the input is
|
685
783
|
// erased
|
686
784
|
this.notifyChange();
|
785
|
+
this._unset = true;
|
687
786
|
}
|
688
787
|
}
|
689
788
|
this._resetMaskPos(input);
|
@@ -849,7 +948,7 @@
|
|
849
948
|
if (this.isInput) {
|
850
949
|
this.$element.on({
|
851
950
|
'focus': $.proxy(this.show, this),
|
852
|
-
'change': $.proxy(this.change, this)
|
951
|
+
'change': $.proxy(this.change, this)
|
853
952
|
});
|
854
953
|
if (this.options.maskInput) {
|
855
954
|
this.$element.on({
|
@@ -859,7 +958,7 @@
|
|
859
958
|
}
|
860
959
|
} else {
|
861
960
|
this.$element.on({
|
862
|
-
'change': $.proxy(this.change, this)
|
961
|
+
'change': $.proxy(this.change, this)
|
863
962
|
}, 'input');
|
864
963
|
if (this.options.maskInput) {
|
865
964
|
this.$element.on({
|
@@ -894,7 +993,7 @@
|
|
894
993
|
if (this.isInput) {
|
895
994
|
this.$element.off({
|
896
995
|
'focus': this.show,
|
897
|
-
'change': this.change
|
996
|
+
'change': this.change
|
898
997
|
});
|
899
998
|
if (this.options.maskInput) {
|
900
999
|
this.$element.off({
|
@@ -904,7 +1003,7 @@
|
|
904
1003
|
}
|
905
1004
|
} else {
|
906
1005
|
this.$element.off({
|
907
|
-
'change': this.change
|
1006
|
+
'change': this.change
|
908
1007
|
}, 'input');
|
909
1008
|
if (this.options.maskInput) {
|
910
1009
|
this.$element.off({
|
@@ -942,10 +1041,13 @@
|
|
942
1041
|
};
|
943
1042
|
|
944
1043
|
$.fn.datetimepicker.defaults = {
|
945
|
-
maskInput:
|
1044
|
+
maskInput: false,
|
946
1045
|
pickDate: true,
|
947
1046
|
pickTime: true,
|
948
|
-
pick12HourFormat: false
|
1047
|
+
pick12HourFormat: false,
|
1048
|
+
pickSeconds: true,
|
1049
|
+
startDate: -Infinity,
|
1050
|
+
endDate: Infinity
|
949
1051
|
};
|
950
1052
|
$.fn.datetimepicker.Constructor = DateTimePicker;
|
951
1053
|
var dpgId = 0;
|
@@ -994,7 +1096,7 @@
|
|
994
1096
|
else return Array(l - s.length + 1).join(c || ' ') + s;
|
995
1097
|
}
|
996
1098
|
|
997
|
-
function getTemplate(timeIcon, pickDate, pickTime, is12Hours) {
|
1099
|
+
function getTemplate(timeIcon, pickDate, pickTime, is12Hours, showSeconds) {
|
998
1100
|
if (pickDate && pickTime) {
|
999
1101
|
return (
|
1000
1102
|
'<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
|
@@ -1007,7 +1109,7 @@
|
|
1007
1109
|
'<li class="picker-switch"><a class="accordion-toggle"><i class="' + timeIcon + '"></i></a></li>' +
|
1008
1110
|
'<li class="collapse">' +
|
1009
1111
|
'<div class="timepicker">' +
|
1010
|
-
TPGlobal.getTemplate(is12Hours) +
|
1112
|
+
TPGlobal.getTemplate(is12Hours, showSeconds) +
|
1011
1113
|
'</div>' +
|
1012
1114
|
'</li>' +
|
1013
1115
|
'</ul>' +
|
@@ -1017,7 +1119,7 @@
|
|
1017
1119
|
return (
|
1018
1120
|
'<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
|
1019
1121
|
'<div class="timepicker">' +
|
1020
|
-
TPGlobal.getTemplate(is12Hours) +
|
1122
|
+
TPGlobal.getTemplate(is12Hours, showSeconds) +
|
1021
1123
|
'</div>' +
|
1022
1124
|
'</div>'
|
1023
1125
|
);
|
@@ -1091,9 +1193,9 @@
|
|
1091
1193
|
var TPGlobal = {
|
1092
1194
|
hourTemplate: '<span data-action="showHours" data-time-component="hours" class="timepicker-hour"></span>',
|
1093
1195
|
minuteTemplate: '<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',
|
1094
|
-
secondTemplate: '<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"></span>'
|
1196
|
+
secondTemplate: '<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"></span>'
|
1095
1197
|
};
|
1096
|
-
TPGlobal.getTemplate = function(is12Hours) {
|
1198
|
+
TPGlobal.getTemplate = function(is12Hours, showSeconds) {
|
1097
1199
|
return (
|
1098
1200
|
'<div class="timepicker-picker">' +
|
1099
1201
|
'<table class="table-condensed"' +
|
@@ -1103,16 +1205,18 @@
|
|
1103
1205
|
'<td><a href="#" class="btn" data-action="incrementHours"><i class="icon-chevron-up"></i></a></td>' +
|
1104
1206
|
'<td class="separator"></td>' +
|
1105
1207
|
'<td><a href="#" class="btn" data-action="incrementMinutes"><i class="icon-chevron-up"></i></a></td>' +
|
1208
|
+
(showSeconds ?
|
1106
1209
|
'<td class="separator"></td>' +
|
1107
|
-
'<td><a href="#" class="btn" data-action="incrementSeconds"><i class="icon-chevron-up"></i></a></td>' +
|
1210
|
+
'<td><a href="#" class="btn" data-action="incrementSeconds"><i class="icon-chevron-up"></i></a></td>': '')+
|
1108
1211
|
(is12Hours ? '<td class="separator"></td>' : '') +
|
1109
1212
|
'</tr>' +
|
1110
1213
|
'<tr>' +
|
1111
1214
|
'<td>' + TPGlobal.hourTemplate + '</td> ' +
|
1112
1215
|
'<td class="separator">:</td>' +
|
1113
1216
|
'<td>' + TPGlobal.minuteTemplate + '</td> ' +
|
1217
|
+
(showSeconds ?
|
1114
1218
|
'<td class="separator">:</td>' +
|
1115
|
-
'<td>' + TPGlobal.secondTemplate + '</td>' +
|
1219
|
+
'<td>' + TPGlobal.secondTemplate + '</td>' : '') +
|
1116
1220
|
(is12Hours ?
|
1117
1221
|
'<td class="separator"></td>' +
|
1118
1222
|
'<td>' +
|
@@ -1123,8 +1227,9 @@
|
|
1123
1227
|
'<td><a href="#" class="btn" data-action="decrementHours"><i class="icon-chevron-down"></i></a></td>' +
|
1124
1228
|
'<td class="separator"></td>' +
|
1125
1229
|
'<td><a href="#" class="btn" data-action="decrementMinutes"><i class="icon-chevron-down"></i></a></td>' +
|
1230
|
+
(showSeconds ?
|
1126
1231
|
'<td class="separator"></td>' +
|
1127
|
-
'<td><a href="#" class="btn" data-action="decrementSeconds"><i class="icon-chevron-down"></i></a></td>' +
|
1232
|
+
'<td><a href="#" class="btn" data-action="decrementSeconds"><i class="icon-chevron-down"></i></a></td>': '') +
|
1128
1233
|
(is12Hours ? '<td class="separator"></td>' : '') +
|
1129
1234
|
'</tr>' +
|
1130
1235
|
'</table>' +
|
@@ -1137,10 +1242,11 @@
|
|
1137
1242
|
'<table class="table-condensed">' +
|
1138
1243
|
'</table>'+
|
1139
1244
|
'</div>'+
|
1245
|
+
(showSeconds ?
|
1140
1246
|
'<div class="timepicker-seconds" data-action="selectSecond">' +
|
1141
1247
|
'<table class="table-condensed">' +
|
1142
1248
|
'</table>'+
|
1143
|
-
'</div>'
|
1249
|
+
'</div>': '')
|
1144
1250
|
);
|
1145
1251
|
}
|
1146
1252
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* Persian translation for bootstrap-datetimepicker
|
3
|
+
* Mohammad Abdoli Rad <m.abdolirad@gmail.com>
|
4
|
+
*/
|
5
|
+
(function($) {
|
6
|
+
$.fn.datetimepicker.dates['fa-IR'] = {
|
7
|
+
days: ["یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه", "یکشنبه"],
|
8
|
+
daysShort: ["یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه", "یکشنبه"],
|
9
|
+
daysMin: ["ش۱ ۱", "۲ ش", "۳ ش", "۴ ش", "۵ ش", "ج", "ش", "۱ ش"],
|
10
|
+
months: ["ژانویه", "فوریه", "مارس", "آوریل", "می", "ژوئن", "جولای", "آگوست", "سپتامبر", "اکتبر", "نوامبر", "دسامبر"],
|
11
|
+
monthsShort: ["ژانویه", "فوریه", "مارس", "آوریل", "می", "ژوئن", "جولای", "آگوست", "سپتامبر", "اکتبر", "نوامبر", "دسامبر"],
|
12
|
+
today: "امروز"
|
13
|
+
};
|
14
|
+
}(jQuery));
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Bojan Milosavlević <milboj@gmail.com>
|
4
4
|
*/
|
5
5
|
;(function($){
|
6
|
-
$.fn.datetimepicker.dates['rs'] = {
|
6
|
+
$.fn.datetimepicker.dates['rs-latin'] = {
|
7
7
|
days: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota", "Nedelja"],
|
8
8
|
daysShort: ["Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub", "Ned"],
|
9
9
|
daysMin: ["N", "Po", "U", "Sr", "Č", "Pe", "Su", "N"],
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/*!
|
2
|
+
* Datepicker for Bootstrap
|
3
|
+
*
|
4
|
+
* Copyright 2012 Stefan Petre
|
5
|
+
* Licensed under the Apache License v2.0
|
6
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
*
|
8
|
+
*/.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-datetimepicker-widget{top:0;left:0;width:250px;padding:4px;margin-top:1px;z-index:3000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.bootstrap-datetimepicker-widget:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,0.2);position:absolute;top:-7px;left:6px}.bootstrap-datetimepicker-widget:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.bootstrap-datetimepicker-widget>ul{list-style-type:none;margin:0}.bootstrap-datetimepicker-widget .timepicker-hour,.bootstrap-datetimepicker-widget .timepicker-minute,.bootstrap-datetimepicker-widget .timepicker-second{width:100%;font-weight:bold;font-size:1.2em}.bootstrap-datetimepicker-widget table[data-hour-format="12"] .separator{width:4px;padding:0;margin:0}.bootstrap-datetimepicker-widget .datepicker>div{display:none}.bootstrap-datetimepicker-widget .picker-switch{text-align:center}.bootstrap-datetimepicker-widget table{width:100%;margin:0}.bootstrap-datetimepicker-widget td,.bootstrap-datetimepicker-widget th{text-align:center;width:20px;height:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.bootstrap-datetimepicker-widget td.day:hover,.bootstrap-datetimepicker-widget td.hour:hover,.bootstrap-datetimepicker-widget td.minute:hover,.bootstrap-datetimepicker-widget td.second:hover{background:#eee;cursor:pointer}.bootstrap-datetimepicker-widget td.old,.bootstrap-datetimepicker-widget td.new{color:#999}.bootstrap-datetimepicker-widget td.active,.bootstrap-datetimepicker-widget td.active:hover{color:#fff;background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.bootstrap-datetimepicker-widget td.active:hover,.bootstrap-datetimepicker-widget td.active:hover:hover,.bootstrap-datetimepicker-widget td.active:active,.bootstrap-datetimepicker-widget td.active:hover:active,.bootstrap-datetimepicker-widget td.active.active,.bootstrap-datetimepicker-widget td.active:hover.active,.bootstrap-datetimepicker-widget td.active.disabled,.bootstrap-datetimepicker-widget td.active:hover.disabled,.bootstrap-datetimepicker-widget td.active[disabled],.bootstrap-datetimepicker-widget td.active:hover[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.bootstrap-datetimepicker-widget td.active:active,.bootstrap-datetimepicker-widget td.active:hover:active,.bootstrap-datetimepicker-widget td.active.active,.bootstrap-datetimepicker-widget td.active:hover.active{background-color:#039 \9}.bootstrap-datetimepicker-widget td.disabled,.bootstrap-datetimepicker-widget td.disabled:hover{background:0;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget td span{display:block;width:47px;height:54px;line-height:54px;float:left;margin:2px;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.bootstrap-datetimepicker-widget td span:hover{background:#eee}.bootstrap-datetimepicker-widget td span.active{color:#fff;background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.bootstrap-datetimepicker-widget td span.active:hover,.bootstrap-datetimepicker-widget td span.active:active,.bootstrap-datetimepicker-widget td span.active.active,.bootstrap-datetimepicker-widget td span.active.disabled,.bootstrap-datetimepicker-widget td span.active[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.bootstrap-datetimepicker-widget td span.active:active,.bootstrap-datetimepicker-widget td span.active.active{background-color:#039 \9}.bootstrap-datetimepicker-widget td span.old{color:#999}.bootstrap-datetimepicker-widget td span.disabled,.bootstrap-datetimepicker-widget td span.disabled:hover{background:0;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget th.switch{width:145px}.bootstrap-datetimepicker-widget th.next,.bootstrap-datetimepicker-widget th.prev{font-size:21px}.bootstrap-datetimepicker-widget th.disabled,.bootstrap-datetimepicker-widget th.disabled:hover{background:0;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget thead tr:first-child th{cursor:pointer}.bootstrap-datetimepicker-widget thead tr:first-child th:hover{background:#eee}.input-append.date .add-on i,.input-prepend.date .add-on i{display:block;cursor:pointer;width:16px;height:16px}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-datetimepicker-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-09 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: This gem packages the bootstrap-datetimepicker (JavaScripts & stylesheets)
|
15
15
|
for Rails 3.1+ asset pipeline
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.da.js
|
28
28
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.de.js
|
29
29
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.es.js
|
30
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.fa-IR.js
|
30
31
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.fi.js
|
31
32
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.fr.js
|
32
33
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.hr.js
|
@@ -55,7 +56,7 @@ files:
|
|
55
56
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.tr.js
|
56
57
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.zh-CN.js
|
57
58
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.zh-TW.js
|
58
|
-
- vendor/assets/stylesheets/bootstrap-datetimepicker.
|
59
|
+
- vendor/assets/stylesheets/bootstrap-datetimepicker.css
|
59
60
|
- LICENSE.txt
|
60
61
|
- README.md
|
61
62
|
homepage: https://github.com/lubieniebieski/bootstrap-datetimepicker-rails
|
@@ -78,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
79
|
version: '0'
|
79
80
|
requirements: []
|
80
81
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.8.
|
82
|
+
rubygems_version: 1.8.25
|
82
83
|
signing_key:
|
83
84
|
specification_version: 3
|
84
85
|
summary: bootstrap-datetimepicker's JavaScripts & stylesheets for Rails 3.1+ asset
|
@@ -1,141 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Datepicker for Bootstrap
|
3
|
-
*
|
4
|
-
* Copyright 2012 Stefan Petre
|
5
|
-
* Licensed under the Apache License v2.0
|
6
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
7
|
-
*
|
8
|
-
*/
|
9
|
-
@import "variables.less";
|
10
|
-
@import "mixins.less";
|
11
|
-
.bootstrap-datetimepicker-widget {
|
12
|
-
top: 0;
|
13
|
-
left: 0;
|
14
|
-
width: 250px;
|
15
|
-
padding: 4px;
|
16
|
-
margin-top: 1px;
|
17
|
-
z-index: 1050;
|
18
|
-
.border-radius(4px);
|
19
|
-
&:before {
|
20
|
-
content: '';
|
21
|
-
display: inline-block;
|
22
|
-
border-left: 7px solid transparent;
|
23
|
-
border-right: 7px solid transparent;
|
24
|
-
border-bottom: 7px solid #ccc;
|
25
|
-
border-bottom-color: rgba(0,0,0,.2);
|
26
|
-
position: absolute;
|
27
|
-
top: -7px;
|
28
|
-
left: 6px;
|
29
|
-
}
|
30
|
-
&:after {
|
31
|
-
content: '';
|
32
|
-
display: inline-block;
|
33
|
-
border-left: 6px solid transparent;
|
34
|
-
border-right: 6px solid transparent;
|
35
|
-
border-bottom: 6px solid @white;
|
36
|
-
position: absolute;
|
37
|
-
top: -6px;
|
38
|
-
left: 7px;
|
39
|
-
}
|
40
|
-
>ul {
|
41
|
-
list-style-type: none;
|
42
|
-
margin: 0;
|
43
|
-
}
|
44
|
-
.timepicker-hour, .timepicker-minute, .timepicker-second {
|
45
|
-
font-weight: bold;
|
46
|
-
font-size: 1.2em;
|
47
|
-
}
|
48
|
-
table[data-hour-format="12"] .separator {
|
49
|
-
width: 4px;
|
50
|
-
padding: 0;
|
51
|
-
margin: 0;
|
52
|
-
}
|
53
|
-
.datepicker > div {
|
54
|
-
display: none;
|
55
|
-
}
|
56
|
-
.picker-switch {
|
57
|
-
text-align: center;
|
58
|
-
}
|
59
|
-
table{
|
60
|
-
width: 100%;
|
61
|
-
margin: 0;
|
62
|
-
}
|
63
|
-
td,
|
64
|
-
th{
|
65
|
-
text-align: center;
|
66
|
-
width: 20px;
|
67
|
-
height: 20px;
|
68
|
-
.border-radius(4px);
|
69
|
-
}
|
70
|
-
td {
|
71
|
-
&.day:hover,
|
72
|
-
&.hour:hover,
|
73
|
-
&.minute:hover,
|
74
|
-
&.second:hover, {
|
75
|
-
background: @grayLighter;
|
76
|
-
cursor: pointer;
|
77
|
-
}
|
78
|
-
&.old,
|
79
|
-
&.new {
|
80
|
-
color: @grayLight;
|
81
|
-
}
|
82
|
-
&.active,
|
83
|
-
&.active:hover {
|
84
|
-
.buttonBackground(@btnPrimaryBackground, spin(@btnPrimaryBackground, 20));
|
85
|
-
color: #fff;
|
86
|
-
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
87
|
-
}
|
88
|
-
span {
|
89
|
-
display: block;
|
90
|
-
width: 47px;
|
91
|
-
height: 54px;
|
92
|
-
line-height: 54px;
|
93
|
-
float: left;
|
94
|
-
margin: 2px;
|
95
|
-
cursor: pointer;
|
96
|
-
.border-radius(4px);
|
97
|
-
&:hover {
|
98
|
-
background: @grayLighter;
|
99
|
-
}
|
100
|
-
&.active {
|
101
|
-
.buttonBackground(@btnPrimaryBackground, spin(@btnPrimaryBackground, 20));
|
102
|
-
color: #fff;
|
103
|
-
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
104
|
-
}
|
105
|
-
&.old {
|
106
|
-
color: @grayLight;
|
107
|
-
}
|
108
|
-
}
|
109
|
-
}
|
110
|
-
|
111
|
-
th {
|
112
|
-
&.switch {
|
113
|
-
width: 145px;
|
114
|
-
}
|
115
|
-
&.next,
|
116
|
-
&.prev {
|
117
|
-
font-size: @baseFontSize * 1.5;
|
118
|
-
}
|
119
|
-
}
|
120
|
-
|
121
|
-
thead tr:first-child th {
|
122
|
-
cursor: pointer;
|
123
|
-
&:hover{
|
124
|
-
background: @grayLighter;
|
125
|
-
}
|
126
|
-
}
|
127
|
-
/*.dow {
|
128
|
-
border-top: 1px solid #ddd !important;
|
129
|
-
}*/
|
130
|
-
}
|
131
|
-
.input-append,
|
132
|
-
.input-prepend {
|
133
|
-
&.date {
|
134
|
-
.add-on i {
|
135
|
-
display: block;
|
136
|
-
cursor: pointer;
|
137
|
-
width: 16px;
|
138
|
-
height: 16px;
|
139
|
-
}
|
140
|
-
}
|
141
|
-
}
|