Skip to content

Setting a default time with 58 or 59 minutes makes the picker fail to open #153

Description

@pinklady6

When I use the configuration options to set a default time and that time rounds up to 60 minutes the picker fails to open because this line

this.$('.js-clock-minutes .' + this.options.styles.clockNum + '[data-number="' + minuteAsInt + '"]').classList.add(this.options.styles.clockNum + '--active');

Is looking for a component where minutesAsInt is 60 when it really should be 0

I hacked around this by adding another set for the minutes after they are reset on m

  var m = moment(time);
  var minuteAsInt = Math.round(parseInt(m.format('mm'), 10) / 5) * 5;
  m.minutes(minuteAsInt);
  minuteAsInt = parseInt(m.format('mm')); //Work around rounding to 60, this sets minuteAsInt to 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions