Code Monkey home page Code Monkey logo

react-moment-countdown's Introduction

Thiago Zanetti (barba)

barba status javascript python pirate status

20+ years on software development, I’ve done a lot of things and I love what I do. I also love to learn and to teach. I like to be in touch with new and bleeding edge technologies and to try new philosophies and paradigms. I don’t accept the “because I said so” and things must make sense for me and for you. I think unanimity is dangerous but I truly believe in consensus. People before processes but I believe processes can lead to freedom sometimes. Without continuous improvement the agility is only utopia. Feel free to question me, I’ll certainly question you.

profile for Thiago Zanetti on Stack Exchange, a network of free, community-driven Q&A sites

react-moment-countdown's People

Contributors

achmadk avatar darth-knoppix avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar thiagozanetti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-moment-countdown's Issues

Memory Leak

Does this countdown component has memory leak issues when its being re-rendered due to change to props and state ?

Incorrect countdown in both desktop and mobile browser

Excuse me, sir @thiagozanetti . I have used your package in my project. I attached one of the screenshot of my project

localhost-8080-

the countdown above is the result from your package, and the other one is expected result. Comparison between its two countdowns is very different.

I have updated your package (dependency version, README.md, index.jsx, and format-date.js file) that can display better countdown result. You can view the difference in this link

fromDate prop?

Hello,

First of all, sorry because I am new to using React / React Native.

A colleague used this forked package in our mobile app. There is no issue board in that forked package so I thought to write the issue here.

In computers and mobile devices, there is an option in the settings to manually change the time of the device. Our problem is that when the user exactly does that, the countdown adjusts. Although it is just an UI issue and I can still check if the requests are valid in the API server, it still annoys our users (and they are right to be annoyed). To solve the problem, I'm thinking that a fromDate prop is needed but sadly, we have none.

Help will be greatly appreciated, thanks.

Incorrect calculation

Today date : 2018-02-28
Future date : 2020-04-01

Code:

const dateInFuture = moment('2020-04-01', 'YYYY-MM-DD');
<ReactMomentCountDown toDate={dateInFuture} targetFormatMask="YY-MM-DD" />

Expected:
02-01-01

Result:
02-02-01

Can't resolve 'react-moment-proptypes'

./node_modules/react-moment-countdown/dist/index.js
Module not found: Can't resolve 'react-moment-proptypes' in '...\node_modules\react-moment-countdown\dist'

When counting down to same day, targetFormatMask is one day off

I have 2 moments. One moment I add x seconds. When using the targetFormatMask to show the number of remaining days it always shows 1.
OnTick shows correct number of seconds left and onCountdownEnd is called when time is over.

I'm using this format "DD [days] - HH:mm:ss" but it's the same with "DD:HH:mm:ss"

const dateInFuture = moment().add(60, "seconds");

<ReactMomentCountDown
	toDate={dateInFuture}
	targetFormatMask="DD [days] - HH:mm:ss"
	onTick={onTick}
	onCountdownEnd={onCountdownEnd}
/>

Shows 01 DAYS - 00:00:59 counting down to 01 DAYS - 00:00:00

Probably because you convert to UTC time which is 1st of january 1970 so D will always show 1. Subsquentially 25hrs in the future will say it's 2 days and 1 hour because it converts to 1/2/1970

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.