Sha256: ad6cf259fc1cd627e038d299616daca62400f40583cff86935fdc0108925bf98

Contents?: true

Size: 1.65 KB

Versions: 12

Compression:

Stored size: 1.65 KB

Contents

$('.dropdown-toggle').dropdown();
$('.dpicker').livequery(function(){
    $(this).datepicker({ format : 'dd/mm/yyyy', language : $('html').attr("lang") }).on('changeDate', function(ev){
        idday   = '#' + $('#' + ev.currentTarget.id).data('id') + '_3i';
        idmonth = '#' + $('#' + ev.currentTarget.id).data('id') + '_2i';
        idyear  = '#' + $('#' + ev.currentTarget.id).data('id') + '_1i';
        $(idday).val(ev.date.getDate());
        $(idmonth).val(ev.date.getMonth()+1);
        $(idyear).val(ev.date.getFullYear());
    });
    $(this).change(function(){
        if( !$(this).val() ){
            id = '#' + $(this).data('id');
            $(id + '_3i').val("");
            $(id + '_2i').val("");
            $(id + '_1i').val("");
        }
    });
});
$('.add-on').live('click', function(){
    try{
        dpick = $(this).parent().find('.dpicker');
        dpick.trigger('focus');
        dpick.trigger('select');
    }catch (e){
    }
});
$('.tpicker').livequery(function(){
    $(this).timepicker({ template: 'modal', showMeridian: false, minuteStep: 1, defaultTime: false, showInputs: false, disableFocus: true }).on('change', function(ev){
        tpickerdate = new Date("01/01/1970 " + ev.currentTarget.value);
        idhour   = '#' + $('#' + ev.currentTarget.id).data('id') + '_4i';
        idmin    = '#' + $('#' + ev.currentTarget.id).data('id') + '_5i';
        $(idhour).val(tpickerdate.getHours());
        $(idmin).val(tpickerdate.getMinutes());
    });
    $(this).change(function(){
        if( !$(this).val() ){
            id = '#' + $(this).data('id');
            $(id + '_4i').val("");
            $(id + '_5i').val("");
        }
    });
});

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
beautiful_scaffold-0.2.7 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.2.6 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.2.5 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.2.4 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.2.3 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.2.2 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.2.1 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.2.0 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.1.9 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.1.8 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.1.7 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
beautiful_scaffold-0.1.5 lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js