Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Javascript to Formcalc conversion

Avatar

Level 2

Hi experts

I am trying to convert the below javascript code to farmcalc code. I am  new to formcalc script. can anyone help me out this conversion

var today = new Date();
var dateParts = user_date.rawValue.split("-");
var date_1 = new Date(dateParts[0], dateParts[1]-1, dateParts[2]);
if(date_1.getTime() < today.getTime())
   {
     app.alert("some alerting text");
   }

Thanks in advance

Regards

arul

1 Reply

Avatar

Level 10

Hi Arul,

See an example here for comparing two dates using FormCalc: http://assure.ly/frjYW5.

While it is slightly different, it hopefully will give you a direction,

Niall