Adds a specified number of working days to a date.
NAMESPACE
`xmlns:AS=“http://schema.advantages.cz/AsapFunctions”``
SYNTAX
string AddWorkingDays(string date, string days, string calendarId)
PARAMETERS
Name | Description |
---|---|
date | Date to which days will be added. |
days | Number of days to add (if the number is negative, days will be deducted). |
calendarId | ID of the calendar by which the working days will be calculated. The calendar (entity Calendar ) allows you to specify which weekdays are working days and a list of holidays. |
REMARKS
If the date has a time part, the time is not touched.
EXAMPLE
This example adds 1 working day to a source date. The calendar is stored in a constant DefaultCalendarId
.
Source XML
<ROOT>
<test date="2012-03-23"/>
</ROOT>
Stylesheet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:AS="http://schema.advantages.cz/AsapFunctions"
xmlns:date="http://exslt.org/dates-and-times"
exclude-result-prefixes="AS date">
<xsl:template match="/">
<test test="{AS:AddWorkingDays(/ROOT/test/@date, 1, AS:GetConstant('DefaultCalendarId'))}"/>
</xsl:template>
</xsl:stylesheet>