adopted-ember-addons / ember-pikaday

A datepicker component for Ember CLI projects.
MIT License
159 stars 169 forks source link

Uncaught Error: infinite rendering invalidation detected, with ember-pikaday 2.2.2 #141

Open mariowilde opened 7 years ago

mariowilde commented 7 years ago

On ember 2.12 ember-pikaday 2.2.2 still causes the infinite rendering invalidation that first appeared in version 2.2.1. Downgrading to 2.2.0 resolves the issue. Seems like #140 did not fix the error.

duizendnegen commented 7 years ago

Welcoming another PR

corrspt commented 7 years ago

In case anyone get's here, I had a situation where I was using a "maxDate" to be equal to "today" in ember-pikaday and when the user selected that day it would blow up with this error. To work-around it I did the following:

template.hbs

{{pikaday-input value=value maxDate=currentDate}}

components.js

currentDate: computed(function() {
    let today = moment(new Date()).endOf('day');
    return today.toDate();
  }),

By setting the currentDate to the end of the day (23:59:59) it seems that whatever is triggering the error does not happen.

gabrielle-ong commented 6 years ago

+1 for this, downgrading to 2.2.0 resolves this error for me. This only occured for users whose timezone is behind UTC time, regardless if I set useUTC=true. Details:

{{pikaday-input onSelection=(action 'changedDateValue')
                           value=order.shipAt
                           minDate=minDate
                           useUTC=true}}
//component.js
minDate: new Date(),
actions:
  changedDateValue(date) {
      // debugging log:
      // new Date() => Sun Sep 17 2017 22:34:56 GMT-0700 (PDT)
      // date => Sat Sep 16 2017 17:00:00 GMT-0700 (PDT)
      // this.get('minDate') => Sun Sep 17 2017 00:00:00 GMT-0700 (PDT)
      this.set('order.shipAt', date); //infinite loop occurs
   },
duizendnegen commented 6 years ago

Welcoming a PR :)