How do I calculate the difference between two date widgets?

582 views
Skip to first unread message

mosa.gh...@gmail.com

unread,
Feb 8, 2017, 5:36:28 AM2/8/17
to Fujitsu RunMyProcess Developer Community
How do I calculate the difference between two date widgets?

P.S Those date widgets are defined on Web interface.

Ghanshyam Mule

unread,
Feb 8, 2017, 7:05:47 AM2/8/17
to suppor...@runmyprocess.com, mosa.gh...@gmail.com
Hi Mosa,

Good day.

1.I hope you have taken two date widget  & one textfield (for displaying difference between dates) on web interface .

2.The two date values are retrieved in date1 & date2 variable  using RMPApplication.get() method.

3. The next step is to calculate difference two dates. Take a javascript widget & write js code as shown in attached screenshot.

Let us know if you have any concern.

Thanks & regards
Ghanshyam

On Wed, Feb 8, 2017 at 4:06 PM, <mosa.gh...@gmail.com> wrote:
How do I calculate the difference between two date widgets?

P.S Those date widgets are defined on Web interface.

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/8690ad72-0d48-45eb-8075-4d555a28d54d%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

js_to_calculate_difference.PNG

mosa.gh...@gmail.com

unread,
Feb 8, 2017, 7:16:02 AM2/8/17
to Fujitsu RunMyProcess Developer Community, mosa.gh...@gmail.com
Hi Ghanshyam,

I will test and will update you.

Thanks a lot for you support.

one quick question please

is it start_date refer to the "Numeric Date value" for the date widget?

Regards,
Mousa Gharaibeh

mosa.gh...@gmail.com

unread,
Feb 8, 2017, 7:17:45 AM2/8/17
to Fujitsu RunMyProcess Developer Community, mosa.gh...@gmail.com

Hi Ghanshyam,

sorry I mean , is it refer to the numeric date variable?

mosa gharaibeh

unread,
Feb 8, 2017, 7:55:57 AM2/8/17
to Fujitsu RunMyProcess Developer Community, mosa gharaibeh
Hi Ghanshyam,

I've tested, and It's working fine.

Many thanks for your support.

Final code as below as I am trying round to 3 decimals (used toFixed(3) method :

var Date1= RMPApplication.get("pv_FirstDate");
var Date2= RMPApplication.get("pv_SecondDate");
var Difference=(Date2 - Date1)/ (60*60*24);
var x=Difference.toFixed(3);
RMPApplication.set("pv_Difference",x);

Regards,
Mousa Gharaibeh
--
 
 
 
 
Regrads,
Mousa Gharaibeh
Reply all
Reply to author
Forward
0 new messages