[#BloombergLP-bdlt-CalendarUtil-shiftIfValid-0df]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/CalendarUtil.adoc[CalendarUtil]::shiftIfValid
:relfileprefix: ../../../
:mrdocs:

`shiftIfValid` overloads

== Synopses

Declared in `&lt;bdlt&lowbar;calendarutil&period;h&gt;`

Load, into the specified `result`, the date of the business day that is derived from the specified `original` date based on the specified `calendar` according to the specified date&hyphen;shifting `convention`&period; Return 0 on success, and a non&hyphen;zero value, without modifying `&ast;result`, if a valid business date cannot be found according to the `convention` within the valid range of `calendar`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlt/CalendarUtil/shiftIfValid-09.adoc[shiftIfValid](
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date]* result,
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& original,
    xref:BloombergLP/bdlt/Calendar.adoc[bdlt::Calendar] const& calendar,
    xref:BloombergLP/bdlt/CalendarUtil/ShiftConvention.adoc[ShiftConvention] convention);
----

[.small]#xref:BloombergLP/bdlt/CalendarUtil/shiftIfValid-09.adoc[_» more&period;&period;&period;_]#

Load, into the specified `result`, the date of the business day that is derived from the specified `original` date based on the specified `calendar` according to the specified date&hyphen;shifting `convention`, except when the `original` is either the specified `specialDay` of the week, or &hyphen; if the specified `extendSpecialDay` is `true` &hyphen; one of the (possibly empty) set of contiguous non&hyphen;business days immediately _preceding_ a `specialDay` according to the `calendar`, in which case the `result` is determined using the specified `specialConvention`&period; Return 0 on success, and a non&hyphen;zero value, without modifying `&ast;result`, if a valid business date cannot be found according to the above algorithm within the valid range of `calendar`&period; Note that this method is useful for computing, for example, Korean bond coupon payment dates&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlt/CalendarUtil/shiftIfValid-0d7.adoc[shiftIfValid](
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date]* result,
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& original,
    xref:BloombergLP/bdlt/Calendar.adoc[bdlt::Calendar] const& calendar,
    xref:BloombergLP/bdlt/CalendarUtil/ShiftConvention.adoc[ShiftConvention] convention,
    xref:BloombergLP/bdlt/DayOfWeek/Enum.adoc[bdlt::DayOfWeek::Enum] specialDay,
    bool extendSpecialDay,
    xref:BloombergLP/bdlt/CalendarUtil/ShiftConvention.adoc[ShiftConvention] specialConvention);
----

[.small]#xref:BloombergLP/bdlt/CalendarUtil/shiftIfValid-0d7.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
