Solved

Date Subtraction issue

Posted on 2014-12-29
1
80 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

810 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