Bergrebell / CyberCoach

1 stars 1 forks source link

datepicker is two times initialized #56

Closed lexruee closed 9 years ago

lexruee commented 9 years ago

The following code part introduces a bug in apllication.js:


// script for calendar date pick
// The main code
$(function() {
    $( "#datepicker" ).datepicker();
});
// This makes the pop-up show the actual db date by fixing a format difference.
    $(function (){
        var dateInput = $("#datepicker");
        var format = 'yy-mm-dd';
        dateInput.datepicker({dateFormat: format});
        dateInput.datepicker('setDate', $.datepicker.parseDate(format, dateInput.val()));
    });

The jquery datepicker is two times initialized, so the second initialized datepicker has no effect. Thus the default settings are used instead of the format 'yy-mm-dd'.

Remove the first part in apllication.js:

$(function() {
    $( "#datepicker" ).datepicker();
});
lexruee commented 9 years ago

Commit 172f970f91bde1b5c19991b01f1b5697e8544829 fixes #56