computerminds/php-edtf

A library for getting information about EDTF formatted strings.

Installs: 793

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/computerminds/php-edtf

0.3.0 2024-02-01 14:20 UTC

This package is auto-updated.

Last update: 2025-09-29 02:41:59 UTC


README

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');
}