fengstack commented on PR #18726:
URL: 
https://github.com/apache/dolphinscheduler/pull/18726#issuecomment-6336567840

   Thanks for the review @SbloodyS! Updated in commit 58ba40b7f7 to address 
this:
   
   1. **Quote-aware operator scanning ()**: Parses format expressions tracking 
single quote state () and escaped single quotes (). Any `+` or `-` operator 
inside single quotes (such as `'+0800'`, `'-0500'`, or `'T'`) is ignored as a 
literal character rather than an arithmetic operator.
   2. **Timezone literal preservation ()**: Distinguishes date offsets from 
timezone offset literals (e.g. `+0800`, `-0500`, `+08:00`) using pattern 
matching (`^(\\d{4}|\\d{2}:\\d{2})$` / `:`).
   3. **Safe fallback**: If no unquoted operator is found or if parsing fails, 
`calcMinutes` safely returns the original date and format unchanged.
   4. **Regression test coverage**: Added test assertions in 
`TimePlaceholderUtilsTest` covering unquoted and single-quoted timezone 
literals (`+0800`, `-0500`, `+08:00`), ISO `'T'` literals, and verified across 
`month_first_day`, `month_begin`, `week_first_day`, `add_months`, and standard 
placeholders. All unit tests and spotless checks pass cleanly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to