Skip to content

Commit

Permalink
update assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerian committed Mar 29, 2012
1 parent e83fba4 commit 85065bb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/bootstrap-datepicker-rails/version.rb
@@ -1,5 +1,5 @@
module BootstrapDatepickerRails
module Rails
VERSION = "0.5.1"
VERSION = "0.6.0"
end
end
62 changes: 38 additions & 24 deletions vendor/assets/javascripts/bootstrap-datepicker.js
@@ -1,5 +1,5 @@
/* =========================================================
* bootstrap-datepicker.js
* bootstrap-datepicker.js
* http://www.eyecon.ro/bootstrap-datepicker
* =========================================================
* Copyright 2012 Stefan Petre
Expand All @@ -17,11 +17,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */

!function( $ ) {

// Picker object

var Datepicker = function(element, options){
this.element = $(element);
this.language = options.language in dates ? options.language : "en";
Expand All @@ -34,7 +34,7 @@
});
this.isInput = this.element.is('input');
this.component = this.element.is('.date') ? this.element.find('.add-on') : false;

if (this.isInput) {
this.element.on({
focus: $.proxy(this.show, this),
Expand Down Expand Up @@ -69,7 +69,7 @@
this.update();
this.showMode();
};

Datepicker.prototype = {
constructor: Datepicker,

Expand Down Expand Up @@ -97,25 +97,25 @@
// event triggers a hide before the click event can stop propagation.
if ($.browser.msie) {
var t = this, args = arguments;

function cancel_hide(){
clearTimeout(hide_timeout);
e.target.focus();
t.picker.off('click', cancel_hide);
}

function do_hide(){
t.hide.apply(t, args);
t.picker.off('click', cancel_hide);
}

this.picker.on('click', cancel_hide);
var hide_timeout = setTimeout(do_hide, 100);
} else {
return this.hide.apply(this, arguments);
}
},

hide: function(e){
this.picker.hide();
$(window).off('resize', this.place);
Expand All @@ -131,7 +131,7 @@
date: this.date
});
},

setValue: function() {
var formated = DPGlobal.formatDate(this.date, this.format, this.language);
if (!this.isInput) {
Expand All @@ -143,7 +143,7 @@
this.element.prop('value', formated);
}
},

setStartDate: function(startDate){
this.startDate = startDate||-Infinity;
if (this.startDate !== -Infinity) {
Expand All @@ -152,7 +152,7 @@
this.update();
this.updateNavArrows();
},

setEndDate: function(endDate){
this.endDate = endDate||Infinity;
if (this.endDate !== Infinity) {
Expand All @@ -161,15 +161,15 @@
this.update();
this.updateNavArrows();
},

place: function(){
var offset = this.component ? this.component.offset() : this.element.offset();
this.picker.css({
top: offset.top + this.height,
left: offset.left
});
},

update: function(){
this.date = DPGlobal.parseDate(
this.isInput ? this.element.prop('value') : this.element.data('date'),
Expand All @@ -184,7 +184,7 @@
}
this.fill();
},

fillDow: function(){
var dowCnt = this.weekStart;
var html = '<tr>';
Expand All @@ -194,7 +194,7 @@
html += '</tr>';
this.picker.find('.datepicker-days thead').append(html);
},

fillMonths: function(){
var html = '';
var i = 0
Expand All @@ -203,7 +203,7 @@
}
this.picker.find('.datepicker-months td').html(html);
},

fill: function() {
var d = new Date(this.viewDate),
year = d.getFullYear(),
Expand Down Expand Up @@ -250,7 +250,7 @@
}
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
var currentYear = this.date.getFullYear();

var months = this.picker.find('.datepicker-months')
.find('th:eq(1)')
.text(year)
Expand Down Expand Up @@ -316,7 +316,7 @@
break;
}
},

click: function(e) {
e.stopPropagation();
e.preventDefault();
Expand All @@ -332,7 +332,7 @@
case 'next':
this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
this.viewDate,
this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
DPGlobal.modes[this.viewMode].navStep * (target[0].className == 'prev' ? -1 : 1)
);
this.fill();
Expand Down Expand Up @@ -397,7 +397,7 @@
}
}
},

mousedown: function(e){
e.stopPropagation();
e.preventDefault();
Expand Down Expand Up @@ -499,7 +499,7 @@
break;
}
},

showMode: function(dir) {
if (dir) {
this.viewMode = Math.max(0, Math.min(2, this.viewMode + dir));
Expand All @@ -508,7 +508,7 @@
this.updateNavArrows();
}
};

$.fn.datepicker = function ( option ) {
var args = Array.apply(null, arguments);
args.shift();
Expand Down Expand Up @@ -540,6 +540,20 @@
daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],
months: ["Januar", "Februar", "M\xe4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
monthsShort: ["Jan", "Feb", "M\xe4r", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"]
},
br: {
days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"],
daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"],
daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],
months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"]
},
es: {
days: ["Domingo", "Lunes", "Martes", "Mi\xE9rcoles", "Jueves", "Viernes", "Sábado", "Domingo"],
daysShort: ["Dom", "Lun", "Mar", "Mi\xE9", "Jue", "Vie", "Sáb", "Dom"],
daysMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"],
months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"]
}
}

Expand Down

0 comments on commit 85065bb

Please sign in to comment.