waDateIsoValidator

Validation of dates in the ISO format.

Contents...

The purpose of the class is to validate date errors strictly in the yyyy-mm-dd format.

Methods

public function isValid ($value)

Validates a date value.

Parameters

  • $value

    String with a date value in the “yyyy-mm-dd” format; e.g., '2000-12-31'.

Example

$validator = new waDateIsoValidator();

// true
$validator->isValid('2001-01-01');

// false
$validator->isValid('2001-01-01 00:00:00');