AnsweredAssumed Answered

Compare dates in Javascript

Question asked by KeithWeaver6631 on Mar 16, 2016
Latest reply on Mar 16, 2016 by KeithWeaver6631

I am trying to compare two dates the dateAvailable and the last successful run date.  My objective is to only map the availableDate if it is later than the LastsuccessfulRun date.  See my map function below


Screen Shot 2016-03-15 at 9.31.29 PM.png


In the scripting step I am using this script:


dateAvailableOut = null;

if(dateAvailable > lastsuccessfulRun){

dateAvailableOut = dateAvailable;



However No matter what date I pass into my dateAvailable variable it always maps to the output.  Here is the data that is being passed through the connector:

LastsuccessfulRun =  20160315 213946.286

dateAvailable = 20141231 000000.000


I can not figure out why this script returns 20141231 000000.000 rather than null.