Changes

Custom Field Type: Special – Browser Script

467 bytes added, 18:55, 24 March 2009
no edit summary
}
</pre>
 
'''NOTE:''' If you want the total to display at the bottom of the dynamic field, you need to create a new field and assign the value of the original total to the new custom field that you just create.
 
'''2. Count business days between two dates'''
function busdatediff(){ var frm=document.form1; var formatdate="dd/mm/yyyy"; var start=ConvertDateStr(frm.startdate.value,formatdate); var end=ConvertDateStr(frm.enddate.value,formatdate); var diff=datediff(start,end, "D"); var i=0; var busdays=0; for(i=0;i<diff;i++) { var cdate=dateadd(start,'D''NOTE:''' If you want the total to display at the bottom of the dynamic field, you need to create a new field and assign the i); if(!isHoliday(cdate)) busdays++; } frm.cf_fieldid.value of the original total to the new custom field that you just create. =busdays;}busdatediff();
Smartstaff
137
edits