Code Monkey home page Code Monkey logo

Comments (9)

bryanjacquot avatar bryanjacquot commented on May 21, 2024

I took a look at this using IE and Chrome on Windows and Chrome on Mac and all work correctly. I'm wondering if there's something going on with your browser/system locale. What is your primary language set to on your computer/browser?

from grommet.

ericsoderberghp avatar ericsoderberghp commented on May 21, 2024

It sounds like it might be a timezone issue.

from grommet.

klipinski avatar klipinski commented on May 21, 2024

Language is English, timezone is UTC+01:00. I changed also to German, makes no difference. A colleague here in Germany could observe the same, so it is not related only to my machine. Checked it on my machine with Chrome 43.0, Firefox 38.0, Opera 30.0, IE11 in combination with Win7. Also with Android 4.4.2 and Chrome (language in that case German). All show the same effect.

from grommet.

klipinski avatar klipinski commented on May 21, 2024

The effect can only be observed in one direction:

  1. change the day in the input field, call the datepicker and look to the calendar: the correct date is marked in green. In that direction it works.
  2. Other direction: call the datepicker, choose a date and close the calendar: the input field shows the day before the selected day.

There is a JS-warning: "ReferenceError: reference to undefined property this._resizeTimer" in index.js, line 40, col 8596.

from grommet.

klipinski avatar klipinski commented on May 21, 2024

Firebug output while executing like described before (case 2):
ReferenceError: reference to undefined property e.fromElement index.js:16:30404
ReferenceError: reference to undefined property r[e] index.js:2:19826
ReferenceError: reference to undefined property r._dispatchListeners index.js:16:22899
ReferenceError: reference to undefined property t[2] index.js:49:3775
ReferenceError: reference to undefined property t._owner index.js:1:19622

from grommet.

klipinski avatar klipinski commented on May 21, 2024

Eric, you're right! I changed the timezone to Pacific Time (UTC-08:00). And now it works ... !

from grommet.

mirsilstan avatar mirsilstan commented on May 21, 2024

The bug is caused by the method toISOString, which returns a string representation of a date having the timezone zero UTC offset, as denoted by the suffix "Z".
On the other hand, the calendar is populated with dates having the timezone of the user's machine.
That's why Tue Jul 07 2015 00:00:00 GMT+0300 becomes 2015-07-06T21:00:00.000Z.
I replaced date.toISOString().slice(0, 10) with moment(date).format('YYYY-MM-DD') and it works ok right now.

from grommet.

bryanjacquot avatar bryanjacquot commented on May 21, 2024

thanks @mirsilstan, would you mind submitting a PR with your fix?

from grommet.

mirsilstan avatar mirsilstan commented on May 21, 2024

Sure, no problem, I created the pull request #133.

from grommet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.