Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Bugs and suggestions #76

Closed
remaerd opened this Issue · 3 comments

3 participants

@remaerd

Thanks for your codes. Really appreciate your works.

Here's the bug: when I try to use timePicker with the following codes, The value will turn 00:00 when I finished.

$('#showFrequencyTime').timepicker
                minuteStep: 5
                showInputs: false
                showMeridian: false
                disableFocus: true

when showInputs is true. It'll works fine.

And I have two suggestions:

This plugins is too depending on Bootstrap. Is making it difficult to do custom styling. The DOM structure is pretty complicated, too. It can be simpler but a huge table. I think ChosenJS is doing great. It's just a jQuery plugin without Bootstrap. So I don't have to use those Bootstrap stylesheets which I don't need. Because of the complicated stylesheets. I'm having trouble from dealing with some layer problems.

If you think this is a bad idea. It's not a big deal. But I'm hoping you can change the way to implement the plugin:

I spend a day to figure out why my code doesn't work. And Finally, the problem is that I haven't create a parent div with 'timepicker' class name for the input.
When we use bootstrap components, For example, tooltip. It's should be one line of code instead of two. It's okay, but It can be better.

Thats all. I'd like to help if you'd like to redesign a new style for this components.

@tkompare

I too am having trouble with the 'showInputs: false' option.

$('#time-picker').timepicker({
    minuteStep: 5,
    showInputs: false,
    disableFocus: true,
    template: 'modal',
    modalBackdrop: true
});
@tkompare

I think I've found a solution in 'updateFromWidgetInputs' about line #475. Add if(this.showInputs) with an 'else' clause for the span .text() values.

    updateFromWidgetInputs: function() {
      if (this.$widget === false) {
        return;
      }
      if (this.showInputs) {
        var time = $('input.bootstrap-timepicker-hour', this.$widget).val() + ':' +
        $('input.bootstrap-timepicker-minute', this.$widget).val() +
        (this.showSeconds ? ':' + $('input.bootstrap-timepicker-second', this.$widget).val() : '') +
        (this.showMeridian ? ' ' + $('input.bootstrap-timepicker-meridian', this.$widget).val() : '');
        this.setTime(time);
      } else {
        var time = $('span.bootstrap-timepicker-hour', this.$widget).text() + ':' +
        $('span.bootstrap-timepicker-minute', this.$widget).text() +
        (this.showSeconds ? ':' + $('span.bootstrap-timepicker-second', this.$widget).text() : '') +
        (this.showMeridian ? ' ' + $('span.bootstrap-timepicker-meridian', this.$widget).text() : '');
        this.setTime(time);
      }
    },
@remaerd

@tkompare problem solved. Thanks for your contribution.

@jdewit jdewit referenced this issue from a commit
@jdewit try to cover #76 3113ce0
@jdewit jdewit closed this in bbce32d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.