diff --git a/increments/OCPS-increment-1.3.md b/increments/OCPS-increment-1.3.md index 4bfa940..8f99934 100644 --- a/increments/OCPS-increment-1.3.md +++ b/increments/OCPS-increment-1.3.md @@ -62,3 +62,17 @@ The `W` character can be used in the `Day of Month` field to find the closest we * If the 1st is a Saturday, it triggers on **Monday the 3rd**, as moving to the previous month is not allowed. * **Constraint:** The `W` character is a modifier for a single day and cannot be used with ranges or lists. For example, `1-15W` is an invalid pattern. + +#### 4.3.1. Behavior with Non-Existing Days + +When the `W` modifier is used with a day number that does not exist in a particular month (e.g., `31W` in February), the pattern **will not match any date in that month**. The job will simply not be scheduled to run during those months. + +* **Example:** `0 12 31W * *` triggers at noon on the nearest weekday to the 31st. + * In months with 31 days (Jan, Mar, May, Jul, Aug, Oct, Dec), it triggers as expected. + * In months with fewer days (Feb, Apr, Jun, Sep, Nov), the pattern does not match and the job does not run. + +To schedule on the last weekday of every month regardless of month length, combine `L` and `W` as `LW`: + +* **Example:** `0 12 LW * *` triggers at noon on the last weekday of the month. + * If the last day is a weekday, it triggers on that day. + * If the last day is a weekend, it triggers on the preceding Friday.