guiqui / react-timeline-gantt

A react Timeline component with virtual rendering
MIT License
548 stars 132 forks source link

supporting jalali-date #26

Open RZsam opened 5 years ago

RZsam commented 5 years ago

I'm trying to use gantt chart with Jalali calendar with moment-jalali. I've changed getFormat and so far it's ok, except Jalali year month starts in March so I had to change getStartDate function.

getStartDate = (date, mode) => {
    let year = null;
    switch (mode) {
        case 'year':
            return date.startOf('jYear');
        case 'month':
            return date.startOf('jMonth');
        case 'week':
            return date.subtract(date.day(), 'days');
        default:
            return date
    }
}

but now I'm getting bugs in the calender... on scrolling chart month and year not showing and disappears... is there any other function I should change?

guiqui commented 5 years ago

Can you share the code in codesandbox?

On Wed, May 29, 2019 at 7:21 PM RZsam notifications@github.com wrote:

I'm trying to use gantt chart with Jalali calendar with moment-jalali https://github.com/jalaali/moment-jalaali. I've changed getFormat and so far it's ok, except Jalali year month starts in March so I had to change getStartDate function.

getStartDate = (date, mode) => { let year = null; switch (mode) { case 'year': return date.startOf('jYear'); case 'month': return date.startOf('jMonth'); case 'week': return date.subtract(date.day(), 'days'); default: return date } }

but now I'm getting bugs in the calender... on scrolling chart month and year not showing and disappears... is there any other function I should change?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/guiqui/react-timeline-gantt/issues/26?email_source=notifications&email_token=ADMV2DVI2ZDCGMQRZLOSPULPXYVHBA5CNFSM4HQJZOF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GWM6KAQ, or mute the thread https://github.com/notifications/unsubscribe-auth/ADMV2DT3AENJSIGBEB2ICPDPXYVHBANCNFSM4HQJZOFQ .

RZsam commented 5 years ago

@guiqui I forked your sandbox yesterday but it seems like sandbox dependencies only are added from npm and couldn't find a way to use my git fork as a dependency .I've added my fork url in package.json but it gives error. sorry but I hope it helps sandbox