Difference between revisions of "Calculated Value - busdateadd Function"

From SmartWiki
Jump to: navigation, search
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A new javascript function "busdateadd" is available. '''busdateadd''' (start date,number of days) It skips Saturday and Sunday and Canadian public holidays (not banking holidays). We will have a US version as well later. This is not related to any [[SmartSimple]] calendar.
+
{{JavaScript Syntax}}
 +
The JavaScript "busdateadd" function adds a specific number of '''business days''' to a given date.
 +
*Syntax: ''busdateadd(datefield,business days to be added)''
 +
datefield could be a Standard Field or a [[Custom Field]]
  
'''Impact''':  The client can then do a calculation in a [[Custom Fields|custom field]] based on business days instead of real days.
+
It skips Saturday and Sunday and Canadian public holidays (not banking holidays).  
  
Example,
+
This is not related to any [[SmartSimple]] calendar.
 +
 
 +
 
 +
'''Impact''':  This allows a calculation in a [[Custom Fields|custom field]] based on business days instead of real days.
 +
 
 +
'''Example''',
 
Lets say field frm.startdate.value = 07/11/2008,Friday  
 
Lets say field frm.startdate.value = 07/11/2008,Friday  
  
 
busdateadd(frm.startdate.value,1) returns 10/11/2008, Monday
 
busdateadd(frm.startdate.value,1) returns 10/11/2008, Monday
  
[[Category:System Management]][[Category:Enhancements]][[Category:Custom Fields]]
+
frm.startdate is a standard field. To calculate using [[Custom Field]] use frm.cf_fieldid.value.
 +
 
 +
==See Also==
 +
* [[Manipulating Dates]]
 +
* [[isHoliday]]
 +
* [[Custom Defined Holidays]]
 +
* [[Adding a given number of days to a date based on the value of a dropdown]]
 +
 
 +
[[Category:JavaScript]][[Category:Date Formats]]

Latest revision as of 14:48, 13 May 2014

This feature uses JavaScript syntax
Text code javascript.gif

The JavaScript "busdateadd" function adds a specific number of business days to a given date.

  • Syntax: busdateadd(datefield,business days to be added)
datefield could be a Standard Field or a Custom Field

It skips Saturday and Sunday and Canadian public holidays (not banking holidays).

This is not related to any SmartSimple calendar.


Impact: This allows a calculation in a custom field based on business days instead of real days.

Example, Lets say field frm.startdate.value = 07/11/2008,Friday

busdateadd(frm.startdate.value,1) returns 10/11/2008, Monday

frm.startdate is a standard field. To calculate using Custom Field use frm.cf_fieldid.value.

See Also