michael-hack / bulma-calendar

Bulma's extension to display a calendar
MIT License
286 stars 165 forks source link

time format for time picker does not work #292

Closed pcherna closed 2 years ago

pcherna commented 2 years ago

Bug Report

Environment

Current Behavior My plain HTML input has a time whose format is HH:MM:ss, with a non-zero value (e.g. "01:25:00"), but when I call bulmaCalendar.attach(), the initial value show in the time picker is zero. Upon save, the result back in the field is shifted (hours->minutes, minutes->seconds), e.g. changing to "02:30" and Save produces a value of "00:02:30".

Possible Solution By inspection, src/js/index.js has an obvious copy/paste bug:

    // Set timeFormat (set to HH:MM:SS by default)
    set timeFormat(timeFormat) {
        this.timePicker.dateFormat = timeFormat;
        //              ^^^^^^^^^^
        return this;
    }

Which should be this.timePicker.timeFormat = timeFormat;

I'm assuming this is the only problem, was not in a great position to test.

michael-hack commented 2 years ago

Thank you for your help. I've merged the pull request.