Solved

Date Subtraction issue

Posted on 2014-12-29
1
85 Views
Last Modified: 2014-12-29
Any idea why line 10 in jsfiddle is not executing?

http://jsfiddle.net/2q0zjbdo/1/
0
Comment
Question by:Isaac
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40522294
because dueDate is a string
a tring don't have getDate function prototype so it fail

new Date(dueDate) is a Date
(new Date(dueDate) - new Date()) is a number of millisecond between the two date

nb_millisecond / (60 * 60 * 1000 * 24) give you the number of day...
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question