Quantcast
Channel: CRM Development Forum
Viewing all articles
Browse latest Browse all 888

JavaScript - Math with Dates/Formatting Dates

$
0
0

I am new to dates in JavaScript so please bear with me.  I have a requirement which involves math using dates.  I have 2 date fields (dateA and dateB) and 1 integer field (X).  When the form loads, dateB will always be null so I will need a null check.  When any dateA is selected, it should perform this calculation:

// Perform calculation with dates and integers dateB = dateA - ((X * 7) + 14);

// Set Date value Xrm.Page.getAttribute("new_dateb").setValue(dateB);


I am just not sure where to begin with these date calculations since date is captured in an object.  Is my above calculation possible?  If so, what sort of methods/formatting am I missing in order to acheive the dateB result?  Thanks!




Viewing all articles
Browse latest Browse all 888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>