Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 106
  • Last Modified:

Date Subtraction issue

Any idea why line 10 in jsfiddle is not executing?

http://jsfiddle.net/2q0zjbdo/1/
0
Isaac
Asked:
Isaac
1 Solution
 
leakim971PluritechnicianCommented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now