Quick date ranges – system description

The quick range master, the rule parameters (unit, offset, span, alignment), whitelisted saving and how filter panels are served.

Master of the quick range buttons of filter panels: code, name, order, status and an optional rule. The master stores a rule, never a date; date arithmetic lives in the quick range library.

Data model

Table names carry the installation's own prefix in the database.

TableMain fields
quickrangecode, name, order, status (0/1/9), period_unit (year/quarter/month/day), period_offset, period_span, period_align (calendar/today)

Known codes (examples): ty, tm, tq, q1–q4, py, pm, pq1–pq4, l30d, l10d, l3y.

Process

  1. List: filter by name/status; per row a preview resolved for today (resolveRow) and the rule description; unknown codes flagged; the trash only with the right to see deleted items.
  2. Save: the code must be a known rule code (isCode) and unique (codeTaken); the model normalises unit and alignment against a whitelist (unknown unit → empty = built-in rule).
  3. Delete: physical with delete, status = 9 with statusdelete only.
  4. Serving: getFilterPresets() supplies the buttons of the filter panels.

Permissions

  • Function rights: list; form/save canSave(); status edit; delete; statusdelete; debug. The keys have a catalogue seed.
  • No content scope.
Related topics: quick date range permissions