[#BloombergLP-bdlt-CalendarUtil-shiftPrecedingIfValid]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/CalendarUtil.adoc[CalendarUtil]::shiftPrecedingIfValid
:relfileprefix: ../../../
:mrdocs:

Shift `original` to the next valid business day (preceding)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
shiftPrecedingIfValid(
    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);
----

== Description

Load, into the specified `result`, the date of the chronologically latest business day that is on or before the specified `original` date based on the specified `calendar`&period; Return 0 on success, and a non&hyphen;zero value, without modifying `&ast;result`, if the `original` date is not within the valid range of `calendar` or the preceding business day cannot be found within the valid range of `calendar`&period;

== Return Value

0 on success, non&hyphen;zero on failure

== Parameters

[cols="1,4"]
|===
| Name| Description
| *result*
| destination for the shifted date
| *original*
| starting date
| *calendar*
| calendar used for business&hyphen;day determination
|===


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