I am trying to calculate difference between two dates and display the days difference in text field using Bonita BPM Community 7 Version 7.3.1. I am new to Bonita give me some idea that on which event i have to calculate Date difference and display in text field. There is no onselect like events for input type Date in Bonita?
You’re right. Bonitasoft don’t allow us the ability to give names to widgets which would allow us this facility with a piece of JavaScript.
Please add your voice to the following post in ideas so that we can get this facility:
http://community.bonitasoft.com/ideas/give-developers-ability-add-ids-form-elements-ui-designer
In this case the only option I can suggest is to create a Custom Widget that will allow you to do this.
You could in fact combine all three fields into one widget so they are grouped and can be reused where necessary. Something like:
datefield1
datefield2
No-of-Days
onchange(“datefield2”){
//for setting start and end dates
stopevents;
No-of-Days=datefield2-datefield1+1; //+1 for same day start and end
startevents;
}
onchange(“No-of-Days”){
//for setting start and No-of-Days (ex. start date of holiday and I want 10 days off)
stopevents;
datefield2=datefield1+No-of-Days+regulatory(); //make sure you add weekends and other holidays as appropriate - function regulatory
startevents;
}
Hope this helps
regards
Seán
PS: As this reply answers your question, please mark a resolved by clicking the tick mark on the left.