React-dates: Start first day of month in UI

Created on 4 May 2017  路  10Comments  路  Source: airbnb/react-dates

Hi,
Please advice me how to change first day of month in react-date in persian jalali month?
in storybook sample :
Here
you can see that is not correct.
please look to my attached file in the blow. the first date of the month start from 11 in the sample.
how to change it?
react-date error

Most helpful comment

Is there any update regarding this issue?

All 10 comments

it also shows duplicate month (TIR)
image

Is there any update regarding this issue?

I need to fix this issue. It's been open several months ago.With this problem there, It's practically impossible to use it.

Hi @savalanpour

for fix bug that @a-jahanshahlo said, follow below
You must import momentJalaali from 'moment-jalaali'; in CalendarMonth.jsx
and follow below instruction

This Line --> CalendarMonth.jsx change to momentJalaali(props.month)

This Line --> CalendarMonth.jsx change to isOutsideDay: !day || momentJalaali(day).startOf('jMonth').format("jMM") !== momentJalaali(month).startOf('jMonth').format("jMM") ,

This line --> getCalendarMonthWeeks.js change to const firstOfMonth = month.clone().startOf('jMonth').hour(12);

This line --> getCalendarMonthWeeks.js change to const lastOfMonth = month.clone().endOf('jMonth').hour(12);

and last thing you should pass isOutsideRange={() => false} in DateRangePicker compnent

but this bug that @alireza-mh said, still on it.

any better way discovered?

any better way discovered?

use it #755
best solution from @mmarkelov

I have created a fork to fix this.
calendarSystem prop added toDateRangePicker andSingleDatePicker components for supporting JALALI calendar system.

You can see a working range picker here:

https://mohsensaremi.github.io/react-dates/?path=/story/daterangepicker-drp--non-english-locale-persian

Please don鈥檛 spam issues.

Please don鈥檛 spam issues.

It was not spam!

I found a solution and I was explaining my solution.

I mean pasting the same comment on 5-6 issues at once, even if it鈥檚 a helpful one.

Was this page helpful?
0 / 5 - 0 ratings