Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • C civicrm-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 113
    • Merge requests 113
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CiviCRM
  • civicrm-core
  • Merge requests
  • !17475

Open
Created Jun 02, 2020 by Michael O'Toole@MikeyMJCOOwner
  • Report abuse
Report abuse

APIv4 - Support "relative date ranges" with the "IS" operator

  • Overview 10
  • Commits 7
  • Changes 8

Created by: totten

Before

In APIv4, there's no good way to use the "relative date ranges" (e.g. previous.month, previous.year, this.fiscal_year, next.week).

After

APIv4 supports two new query operators, IS and IS NOT. The IS operator is loosely similar to the SQL IS operator in that it accepts symbolic quasi-values (eg myfield IS null). This flavor of IS accepts null as well as the relative date ranges, e.g.

civicrm_api4("Activity", "get", [
  "where" => [["activity_date_time", "IS", "previous.year"]],
  "select" => ["id","activity_date_time"],
  "limit" => 10,
]);
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/totten/master-is-op-deep