Skip to content

fix: bare L day-of-week means every Saturday (#716) - #721

Open
arimu1 wants to merge 1 commit into
jmrozanec:masterfrom
arimu1:fix/716-bare-l-day-of-week
Open

fix: bare L day-of-week means every Saturday (#716)#721
arimu1 wants to merge 1 commit into
jmrozanec:masterfrom
arimu1:fix/716-bare-l-day-of-week

Conversation

@arimu1

@arimu1 arimu1 commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Fixes #716

Bare L in the day-of-week field (as opposed to nL) has two defects:

  1. Description always said last Sunday of every month (wrong day and wrong “last of month” semantics). Bare L means every Saturday ("7" / "SAT").
  2. Scheduling was only correct for Quartz numbering. OnDayOfWeekValueGenerator held Saturday as Quartz 7, then mapped that value with the definition’s day-of-week scheme, so SPRING53 (mondayDoWValue = 1, 7→0) scheduled every Sunday instead of every Saturday.

Changes

  • OnDayOfWeekValueGenerator: for bare L, map ON_SATURDAY (value 7) from ConstantsMapper.QUARTZ_WEEK_DAY → JAVA8, not from the definition’s mondayDoWValue. nL / NONE paths unchanged.
  • DescriptionStrategyFactory (used by CronDescriptor): bare L describes as every Saturday; nL still describes as last <weekday> of every month.

Tests

  • Issue716Test: Quartz + SPRING53 description and next five executions from 2025-06-01 (all Saturday, matching issue table); nL regression.
mvn -Dtest=Issue716Test,OnDayOfWeekValueGenerator*,CronDescriptor*,ExecutionTime* test

Temurin 21 — green.

Map bare L from Quartz numbering (7/SAT) instead of the definition's
scheme so SPRING53 and similar 0-7 Monday=1 ranges schedule Saturday.
Describe bare L as every Saturday; keep nL as last weekday of month.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bare L in day of week: description is wrong for all cron types, and the wrong day is scheduled for 0-7 definitions

1 participant