fieldname 14 : Start Date fieldname 15 : End Date It expresses.
My 1st question = Printing error message if fieldname 14 field is greater than fieldname 15 field.
My 2nd question: How do we calculate business days NETWORKDAYS by adding the number of days from the start date (fieldname24) to the criterion = (fieldname 23 === ‘B’)? Can you help me complete the formula?
(function() {
var kriter3;
if (DATEOBJ(fieldname14, 'dd/mm/yyyy').getTime() > DATEOBJ(fieldname15, 'dd/mm/yyyy').getTime()) {
jQuery('#calculation-kriter3').html('Seçilen tarih ileri bir tarihdir.');
return 'Seçilen tarih ileri bir tarihdir.';
} else {
if (fieldname23 === 'A') {
kriter3 = NETWORKDAYS(fieldname15, fieldname14, "dd/mm/yyyy");
jQuery('#calculation-kriter3').html(kriter3);
jQuery('.kriter3-aciklama').html('İş Günü Sayısı : ');
jQuery('.kriter3-sonuc').html(kriter3 + ' gün');
}
if (fieldname23 === 'B') {
kriter3 = DATETIMESUM(fieldname14, 'dd/mm/yyyy', fieldname24, 'd');
jQuery('#calculation-kriter3').html(kriter3);
jQuery('.kriter3-aciklama').html('İş Günü Sonrası Tarih : ');
jQuery('.kriter3-sonuc').html(kriter3);
}
return [kriter3];
})();
However, if you have a date field, for example, fieldname1, and you want to sum a number of days, fieldname2, and calculate the network days between fieldname1 and the result of fieldname1+fieldname2, you can enter the following piece of code:
I explain the second question as follows. For example: User selected date. fieldname25 : 01/01/2023 then the user added +5 days to the number field (fieldname24).
The criterion here is 01/01/2023 + 5 days. It will write the date by counting 5 business days after 01/01/2023. Thanks.
This already works, my formula is correct. When we add +5 days, I want it to count as the number of days (WORKING DAYS). Sample: 24/11/2023 + 5 work day
27/11/2023 28/11/2023 29/11/2023 30/11/2023 01/12/2023 (+5 work day)
You sample: 24/11/2023 + 5 DAYS 25/11/2023 26/11/2023 27/11/2023 28/11/2023 29/11/2023
Thanks
This reply was modified 2 years, 6 months ago by klingbeil.