0

Given two dates how to return the month difference in IDE?

d1 = (d.getMonth()+1) +'/'+ (d.getFullYear());
d2 = (d.getMonth()+1) +'/'+ (d.getFullYear()+1);

Ex:
Input:
d1 = 5/2013
d2 = 7/2014

Output: (d2-d1) = 14

I tried to use javascript functions from the net but could not get any to work with IDE, tried both ways using function & storeEval.

Mike
  • 75
  • 7

1 Answers1

0

There are a lot of answers on this question in stackoverflow (e.g. this one ).

Community
  • 1
  • 1
Andrey Egorov
  • 1,249
  • 1
  • 12
  • 9
  • As I mentioned in the question I have tried javascript functions but I cannot get them to work with IDE. I tried both ways of creating new functions and by using inline javascript but neither works. So the issue is not the JS per say but getting this to work with IDE correctly. – Mike Aug 26 '14 at 20:54