Skip to content
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

Using daysInHours but hours won't go over 24 #51

Closed
Lukereonal opened this issue Sep 4, 2019 · 5 comments · Fixed by #100
Closed

Using daysInHours but hours won't go over 24 #51

Lukereonal opened this issue Sep 4, 2019 · 5 comments · Fixed by #100

Comments

@Lukereonal
Copy link

Lukereonal commented Sep 4, 2019

Hey I tried to show countdown for approx 2 days like this for example 42:50:31 but seems like the hours part can only show it to 24 so if the hours value go past 24 it will fill days value

is this expected? since props daysInHours supposed to count days as hours

@Lukereonal Lukereonal changed the title Using daysInHours but hours can't be > 24 Using daysInHours but hours won't go over 24 Sep 4, 2019
@ndresx
Copy link
Owner

ndresx commented Sep 4, 2019

Hi @Lukereonal, it seems to be working in the sandbox (https://codesandbox.io/s/flamboyant-dirac-vquv9). What props are you passing in?

@ndresx ndresx added the question label Sep 4, 2019
@ndresx ndresx closed this as completed Sep 11, 2019
@xi1570-krupeshanadkat
Copy link

Nope, it isnt working for me :(

<Countdown date={new Date(1602588600000)} daysInHours renderer={MiddleComp} />,

it shows 3 days 6 hours ...

@xi1570-krupeshanadkat
Copy link

xi1570-krupeshanadkat commented Oct 10, 2020

Hi @Lukereonal, it seems to be working in the sandbox (https://codesandbox.io/s/flamboyant-dirac-vquv9). What props are you passing in?

@ndresx here is the sandbox link where it shows its not working : https://codesandbox.io/s/react-countdown-days-to-hours-wguzf?file=/src/index.js

I saw your link too.. in your case there is no renderer, i guess that is causing the issue?

@ndresx
Copy link
Owner

ndresx commented Oct 10, 2020

Hi @xi1570-krupeshanadkat, thanks for bringing this up again. I've checked your example and the problem is that not the formatted object (which is also part of the renderer function props) values are used, but the "raw" ones that basically ignore all formatting options.

Here the working example:
https://codesandbox.io/s/react-countdown-days-to-hours-forked-6lcku?file=/src/App.js

Although it's briefly mentioned in the docs, it's not part of the props' representation there yet, thanks again!

@ndresx ndresx reopened this Oct 10, 2020
@xi1570-krupeshanadkat
Copy link

I see, I was missing the formatted object wrapping. Really appreciate your quick response with solution. Thanks for helping out :)

@ndresx ndresx mentioned this issue Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants