[#200] Fixed date-only field handling and simplified relative date logic.#309
[#200] Fixed date-only field handling and simplified relative date logic.#309AlexSkrypnyk merged 1 commit intomasterfrom
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 36 minutes and 37 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…implified relative date logic. Co-authored-by: Eric Smith <ericsmith@catalyst.net.nz>
682d6e8 to
2e513ef
Compare
Summary
DATE_STORAGE_FORMATin the site timezone, rather than incorrectly treating them as datetime values.datetime_typesetting.\DateTimewithDrupalDateTimefor both date-only and datetime values, ensuring proper timezone handling via Drupal's API.DrupalDateTimeandDateTimeItemto support the new logic.Problem
The original
expand()method inDatetimeHandlerhad two separate branches:relative:prefix) - usedgmdate/strtotimeand always produced a datetime format, ignoring whether the field was date-only.\DateTimeand always applied a datetime format with timezone conversion to UTC.Neither branch was aware of the field's
datetime_typesetting, so date-only fields (configured asDateTimeItem::DATETIME_TYPE_DATE) received the wrong storage format.Before / After
Before - two independent branches, no date-type awareness:
After - relative prefix stripped first, then a unified path selects format by field type:
Issue
Resolves #200.
Test plan