felixakiragreen / react-kronos

A fast, intuitive, and elegant date and time picker for React.
https://felixakiragreen.github.io/react-kronos/
MIT License
90 stars 28 forks source link

Fixed day label cells generation on calendar header #56

Closed abarani closed 7 years ago

abarani commented 7 years ago

Day labels in calendar header now respect moment dow locale setting. Updated default moment settings accordingly, weekdaysMin array should always start with Sunday.


You can test the wrong behavior using a locale different than "en" with a dow setting different than "0". Below is an attached screenshot using Italian locale for reference: image You can notice that 06/04/2017 is wrongly reported as Wednesday ("me") instead of Thursday ("gi").

abarani commented 7 years ago

@dubert Any feedback? Can you merge this?

felixakiragreen commented 7 years ago

@abarani this was caused by another problem (not setting the locale properly). I just fixed it and will be pushing a new release shortly. In order to get your desired outcome simply pass these props:

<Kronos
    {...props}
    options={ locale: {
          lang: 'it',
          settings: {
            week: { dow: 0 },
          },
        }
    }
/>
nebaz commented 7 years ago

it is bad solution. The weekdaysMin parameter in the moment must begin with "Sunday" You break moment.

@abarani is right.