@apility/rule-builder
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

Rule Builder PHP

Installation

yarn add @apility/rule-builder

Example rule

Validates true all of 2021, except on the 17th of may, 24th of december and all of june.

{
  "type": "group",
  "count": "all",
  "children": [
    {
      "type": "group",
      "count": "any",
      "children": [
        {
          "type": "dateRange",
          "from": "2021-01-01",
          "to": "2022-01-01"
        }
      ]
    },
    {
      "type": "not",
      "child": {
        "type": "group",
        "count": "any",
        "children": [
          {
            "type": "dateRange",
            "from": "2021-05-17",
            "to": "2021-05-18"
          },
          {
            "type": "dateRange",
            "from": "2021-12-24",
            "to": "2021-12-25"
          },
          {
            "type": "dateRange",
            "from": "2021-06-01",
            "to": "2021-07-01"
          }
        ]
      }
    }
  ]
}

Simple example matching weekends in september 2021

{
  "type": "group",
  "count": "all",
  "children": [
    {
      "type": "dayOfWeek,",
      "days": [
        6,
        0
      ]
    },
    {
      "type": "dateRange",
      "from": "2021-09-01",
      "to": "2021-10-01"
    }
  ]
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.748latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.748
1.0.62
1.0.52
1.0.41
1.0.31
1.0.21
1.0.11
1.0.01

Package Sidebar

Install

npm i @apility/rule-builder

Weekly Downloads

9

Version

1.0.7

License

MIT

Unpacked Size

258 kB

Total Files

50

Last publish

Collaborators

  • joadpility
  • sleskeleske
  • olavoyen
  • thomas-alrek
  • erikdju
  • cathrinevaage
  • tommysolsen
  • jarjarbinks1985