So I'm working on a sort of plant simulator using pure Javascript, HTML, and CSS. Using cookies and drag and drop, I have a function that detects how many times the plant has been clicked on, and changes the state based on that. However, I want to implement time as well. For example, if the plant was last fed yesterday, no change. However, if it was last fed two days ago, it begins to wilt. How would I do this? Here is my code: https://gist.github.com/kura99/de7a9a0d3f1a419eb3900c875822d52f
Asked
Active
Viewed 19 times
0
-
Your question should be reduced to a specific issue and code should be posted here, see [*How do I ask a good question?*](http://stackoverflow.com/help/how-to-ask) – RobG Dec 11 '17 at 20:25
-
Probably a duplicate of [*What's the best way to calculate date difference in Javascript*](https://stackoverflow.com/questions/327429/whats-the-best-way-to-calculate-date-difference-in-javascript) – RobG Dec 11 '17 at 22:44