Share ideas, ask questions, and get feedback about developing for ProcessMaker

Moderator: amosbatto

Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By HelenG
#783973
Hello,

I have set three fields: one for start_date, second for trial period date and a last one for trial period(months).
When a user insert the start date and the trial period(months) i would like the trial period date will be filed automatically.
Does anybody have any idea about that?

Thanks in advance for any help!!!!
By cpomares
#814296
Hi HelenG,
as far as I understand, you want to achieve something similar to this:
Selection_008.png
Selection_008.png (7.29 KiB) Viewed 50 times
ProcessMaker 3 uses Moment.js to manage dates, you can take a look to its documentation at the following link: https://momentjs.com/docs/
Here you have the javascript code i used:
Code: Select all
function difdates(newValue, oldValue){
	var date1=moment($("#date01").getValue());
	var date2=moment($("#date02").getValue());
	var period=date2.diff(date1,'days');
	$("#periodo").setValue(period);
}
  
$("#date02").setOnchange(difdates);
Where "date01" is the id for the start date, "date02" is the id for the trial period date and "periodo" is the id for the textbox where i display the remaining trial days.

Hope you find this helpful, regards
Carlos
Currency Format in Textbox

I have it working but I noticed that it does not a[…]

I am having an issue with summing the values in a […]

Cancel Cases

Hello, I´m not sure if this would help with […]

Hello, The similar topic has been discussed here:[…]