diff options
| author | YDBot <[email protected]> | 2026-07-02 18:29:58 +0000 |
|---|---|---|
| committer | YDBot <[email protected]> | 2026-07-02 18:29:58 +0000 |
| commit | a52ffb856a584a5099e37b9c060da3ba4a3db5fb (patch) | |
| tree | 59c7f09bdc9e52d11ce6ddf8b6fabdfe1e73a8d6 /library/cpp/cron_expression/cron_expression.cpp | |
| parent | 6faa15e1fbe202f0fddb7c1ffe9886dc81a0425f (diff) | |
| parent | d5cfc51dd97284c59104c50bb156d1a8d9a09dac (diff) | |
Merge pull request #45225 from ydb-platform/merge-rightlib-260701-1735
Diffstat (limited to 'library/cpp/cron_expression/cron_expression.cpp')
| -rw-r--r-- | library/cpp/cron_expression/cron_expression.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/cpp/cron_expression/cron_expression.cpp b/library/cpp/cron_expression/cron_expression.cpp index 55b64ee6d24..31a538a0766 100644 --- a/library/cpp/cron_expression/cron_expression.cpp +++ b/library/cpp/cron_expression/cron_expression.cpp @@ -1060,12 +1060,15 @@ private: } value = GetField(calendar, ECronField::CF_DAY_OF_MONTH); + // FindDay may cross a month/year boundary keeping the same day number (e.g. 'L-1'), check them too + const auto prevMonth = calendar.month(); + const auto prevYear = calendar.year(); updateValue = FindDay(calendar, Target_.GetDayInMonth(), value, GetWeekday(calendar), Target_.GetFlags(), resets, offset); if (updateValue.Empty()) { ythrow yexception() << ErrorDateNotExists; } - if (value == updateValue) { + if (value == updateValue && prevMonth == calendar.month() && prevYear == calendar.year()) { resets.Set(static_cast<uint32_t>(ECronField::CF_DAY_OF_MONTH)); } else { continue; |
