BloombergLP::bdlt::DateUtil::earliestDayOfWeekInMonth

Return the earliest dayOfWeek in the given month and year.

Synopsis

Declared in <bdlt_dateutil.h>

static
Date
earliestDayOfWeekInMonth(
    int year,
    int month,
    DayOfWeek::Enum dayOfWeek);

Description

Return the earliest date in the specified month of the specified year that falls on the specified dayOfWeek. The behavior is undefined unless 1 <= year <= 9999 and 1 <= month <= 12.

Return Value

earliest matching date in the month

Parameters

NameDescription
yearcalendar year
monthmonth of year in [1 .. 12]
dayOfWeekdesired day of week