/php-edtf

A VERY simple library of helpers for dealing with EDTF dates

Primary LanguagePHP

php-EDTF

Build Status

Usage

Use the factory to get instances of EDTFInfo:

$factory = new \ComputerMinds\EDTF\EDTFInfoFactory();
$dateInfo = $factory->create('1990-01');

Then you can call the various methods on the instance.

$valid = $dateInfo->isValid();
if ($valid) {
  $min = $dateInfo->getMin();
  $max = $dateInfo->getMax();
  // $min and $max are just standard PHP \DateTime instances.
  print $min->format('c');
}