1

Why I see this page is in wrong month, it should init to show August instead of September , I am from cambodia

enter image description here http://react-day-picker.js.org/examples/months-initial

tree em
  • 20,379
  • 30
  • 92
  • 130

2 Answers2

5

From MDN docs: The argument month is 0-based. This means that January = 0 and December = 11.

var startOfYear =  new Date(2017,0)
console.log(startOfYear.toLocaleString())

Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

Tudor Ilisoi
  • 2,934
  • 23
  • 25
3

I've been looking around your site for a couple of minutes, and I noticed that the month number is capped at 11 (so December equals 11). That must be because of common code basics, where the first item of an array starts with an index of 0 (= January). Your timezone has nothing to do with the site so don't worry ! (tested from France)

Ryo Shiina
  • 548
  • 4
  • 13