fgelinas / timepicker

A jQuery UI Time Picker
http://fgelinas.com/code/timepicker
GNU General Public License v2.0
266 stars 84 forks source link

.timepicker('option', 'xxx') seems to be broken #69

Open phazei opened 11 years ago

phazei commented 11 years ago

EDIT: my bad, disregard. I was using it like so: .timepicker('option','getTime') but since that's not an actual option, it returned "undefined"

Near line 1405 you have:

        if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')
            return $.timepicker['_' + options + 'Timepicker'].
                apply($.timepicker, [this[0]].concat(otherArgs));

This returns undefined since:

    $.timepicker['_' + options + 'Timepicker']

always evals to $.timepicker['_optionTimepicker'] so should probably be:

    $.timepicker['_' + arguments[1] + 'Timepicker']

EDIT: Seems I'm wrong, after playing with it for a while and have figured it out. Unfortunately I wasn't able to find the documentation for that.

michael-zock commented 10 years ago

Seems I'm wrong, after playing with it for a while and have figured it out. Unfortunately I wasn't able to find the documentation for that.

Could you please be a bit more specific? I've run into the same problem and without a bit more detail, something as ambiguous as a short "I've figured it out" actually adds to the problem instead of being helpful.

Solution: Turns out that he was talking about figuring out that the last section of the constructor function allows the use of a shorthand along the lines of $("#startTime").timepicker("destroy");