1.0.7 • Published 3 years ago

@apility/rule-builder v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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"
    }
  ]
}
1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago