computerminds / php-edtf
A library for getting information about EDTF formatted strings.
0.3.0
2024-02-01 14:20 UTC
Requires
- guzzlehttp/guzzle: ~6.1|~7.0
Requires (Dev)
- phpunit/phpunit: ~4.0|~5.0
This package is auto-updated.
Last update: 2024-10-30 15:59:31 UTC
README
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');
}