Skip to content

Conversation

@hokolomopo
Copy link
Contributor

Description:

[IMP] CF: add new conditional formats for dates

This commit adds the dateIs/dateIsBefore/dateIsAfter conditional
formats, as well as the excel export for these.

Note:
The excel export doesn't use Excel's date conditional formats, because
they don't have the same behaviour as ours. We'll use custom formulas
instead.

Example: today is 2025/11/19

  • Our date is last month: 2025/10/19 -> 2025/11/18
  • Excel's date is last month: 2025/10/01 -> 2025/10/30

Task: 5343283

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

The component `DateCriterion` would trigger an `updateCriterion` call
on startup if `criterion.dateValue` wasn't set. It's acceptable for
data validations (it only triggers another render), but not acceptable
for conditional formatting, where each call to `updateCriterion` will
trigger a dispatch and a new revision.

The component is now modified to default to `exactDate` if
`criterion.dateValue` isn't set.

Task: 5343283
This commit adds the `dateIs/dateIsBefore/dateIsAfter` conditional
formats, as well as the excel export for these.

Note:
The excel export doesn't use Excel's date conditional formats, because
they don't have the same behaviour as ours. We'll use custom formulas
instead.

Example: today is 2025/11/19
- Our date is last month: 2025/10/19 -> 2025/11/18
- Excel's date is last month: 2025/10/01 -> 2025/10/30

Task: 5343283
@robodoo
Copy link
Collaborator

robodoo commented Nov 19, 2025

Pull request status dashboard

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.

2 participants