New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Before/after modifiers issue with timezone #307

Closed
ghost opened this Issue Apr 25, 2017 · 11 comments

Comments

2 participants
@ghost

ghost commented Apr 25, 2017

I want to disable all days from current day, for that I have used
const range = { before: new Date() } <DayPicker initialMonth={ new Date() } disabledDays={range} selectedDays={ new Date() } onDayClick={this.handleDayClick} />

But it disabled current day as well, i.e. if today is 25th of april then all days before 25th should get disabled and current date i.e. 25th should get selected.
Can anyone please help me what went wrong here?

@gpbl

This comment has been minimized.

Show comment
Hide comment
@gpbl

gpbl Apr 25, 2017

Owner

Could you please replicate your issue in a jsfiddle?

https://jsfiddle.net/pkdcqvpk/

thanks!

Owner

gpbl commented Apr 25, 2017

Could you please replicate your issue in a jsfiddle?

https://jsfiddle.net/pkdcqvpk/

thanks!

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Apr 25, 2017

@gpbl I have just open your JSfiddle link and I was able to replicate this issue. Please see this screenshot.

date

Today is 25th of april but still it is shown disabled.

ghost commented Apr 25, 2017

@gpbl I have just open your JSfiddle link and I was able to replicate this issue. Please see this screenshot.

date

Today is 25th of april but still it is shown disabled.

@gpbl

This comment has been minimized.

Show comment
Hide comment
@gpbl

gpbl Apr 25, 2017

Owner

interesting ! thanks. what is your timezone?

Owner

gpbl commented Apr 25, 2017

interesting ! thanks. what is your timezone?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Apr 25, 2017

@gpbl My timezone is IST

ghost commented Apr 25, 2017

@gpbl My timezone is IST

@gpbl

This comment has been minimized.

Show comment
Hide comment
@gpbl

gpbl Apr 25, 2017

Owner

Thanks, I can replicate it! Until I don't publish the fix, as workaround you can use:

 <DayPicker 
    disabledDays={ { 
        before: new Date().setHours(0,0,0,0)  
    }} 
/>

See the updated jsfiddle.

Owner

gpbl commented Apr 25, 2017

Thanks, I can replicate it! Until I don't publish the fix, as workaround you can use:

 <DayPicker 
    disabledDays={ { 
        before: new Date().setHours(0,0,0,0)  
    }} 
/>

See the updated jsfiddle.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Apr 25, 2017

@gpbl Thanks for workaround, I will use it for development now, and I will wait for proper fix.

ghost commented Apr 25, 2017

@gpbl Thanks for workaround, I will use it for development now, and I will wait for proper fix.

@gpbl gpbl self-assigned this Apr 25, 2017

@gpbl gpbl added this to the v5.3.0 milestone Apr 25, 2017

@gpbl gpbl changed the title from Before modifer is not working correctly. to Before/after modifiers issue with timezone Apr 25, 2017

@gpbl gpbl closed this in #308 Apr 25, 2017

@gpbl

This comment has been minimized.

Show comment
Hide comment
@gpbl

gpbl Apr 25, 2017

Owner

@ktusharprdxn please upgrade to v5.3.0

Owner

gpbl commented Apr 25, 2017

@ktusharprdxn please upgrade to v5.3.0

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Apr 26, 2017

Hey @gpbl Thanks for the quick fix. 👍

ghost commented Apr 26, 2017

Hey @gpbl Thanks for the quick fix. 👍

@martin-svk

This comment has been minimized.

Show comment
Hide comment
@martin-svk

martin-svk May 4, 2017

This fix broke my code (v5.2.3 works good), and what was before indicated as disabled is no longer working.

martin-svk commented May 4, 2017

This fix broke my code (v5.2.3 works good), and what was before indicated as disabled is no longer working.

@gpbl

This comment has been minimized.

Show comment
Hide comment
@gpbl

gpbl May 4, 2017

Owner

@martin-svk could you please replicate your problem https://jsfiddle.net/gpbl/cggxvq6t/ and eventually open a new issue? thanks

Owner

gpbl commented May 4, 2017

@martin-svk could you please replicate your problem https://jsfiddle.net/gpbl/cggxvq6t/ and eventually open a new issue? thanks

@martin-svk

This comment has been minimized.

Show comment
Hide comment
@martin-svk

martin-svk commented May 4, 2017

@gpbl Ok, i created #324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment