BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
939 stars 327 forks source link

I can't set Sunday as the first day of the week #183

Closed rogerdribeiro closed 4 years ago

rogerdribeiro commented 4 years ago

I want to set Sunday as the first day of the week in the CalendarStrip component, but it doesn't work. how did i try?

....
import CalendarStrip from 'react-native-calendar-strip';

const locale = {
  name: 'pt',
  config: {
    months: 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split(
      '_',
    ),
    monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
    weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sab'.split('_'),
    weekdaysMin: 'Do_Se_Te_Qa_Qi_Se_Sa'.split('_'),
    week: {
      dow: 0,
      doy: 3,
    },
  },
};

function CalendarWeek(){
.... //somes functions
 return (
  <CalendarStrip 
   ... //somes props
   locale={locale}
   /> 
  );
}

What result do I have? the language works like pt, but Monday continues as the first day of the week

peacechen commented 4 years ago

Setting useIsoWeekday={false} allows you to start on any day of the week.

useIsoWeekday | start week on ISO day of week (default true). If false, starts week on startingDate parameter.

https://github.com/BugiDev/react-native-calendar-strip#initial-data-and-ondateselected-handler

rogerdribeiro commented 4 years ago

Setting useIsoWeekday={false} allows you to start on any day of the week.

useIsoWeekday | start week on ISO day of week (default true). If false, starts week on startingDate parameter.

https://github.com/BugiDev/react-native-calendar-strip#initial-data-and-ondateselected-handler

Thanks!