SproutCMS

This is the code documentation for the SproutCMS project

function dateRange()

Checks that a date range is valid.

Usage

void Validity::dateRange ( array $vals [, string $min [, string $max [, bool $enforce_ordering ]]] );

Example

$valid->multipleCheck(['date_start', 'date_end'], 'Validity::dateRange', '1999-01-01', '2099-01-01')

Arguments

  1. array $vals
    The values to check; there must be exactly two with the 'start' field name occuring first in the array
  2. string $min = NULL
    (optional) A date string (compatible with strtotime) for the minimum of the date range.
  3. string $max = NULL
    (optional) A date string (compatible with strtotime) for the maximum of the date range.
  4. bool $enforce_ordering = TRUE
    (optional) Ensures that the start date is less than or equal to the end date. On by default.

Return value

  • void