Changes

Jump to: navigation, search

Counting Business Days between Two Dates

374 bytes added, 13:11, 28 April 2009
no edit summary
To count business days between two dates (''startdate'' and ''enddate''), the following code can be used in a [[Custom Field Type: Special – Browser Script|Special Browser script]] field that will populate a [[Custom Field Type: Special – Calculated Value|Calculated Value Custom Field]] with the number of business days between two given dates.
In the [[Custom Field Type: Special – Browser Script|Special Browser script]] field you define the function that calculates the difference:
<pre>
</pre>
In the '''Expression''' section of the [[Custom Field Type: Special – Calculated Value|Calculated Value Custom Field]] you would put call the followingfunction:
bus_date_diff()
Note: The function definition can be changed to accept parameters (fields containing dates) that are passed at the time of calling the function from any [[Custom Field Type: Special – Calculated Value|Calculated Value Custom Field]].
[[Category:Custom Fields]][[Category:JavaScript Examples]]
Smartstaff
137
edits

Navigation menu