{"id":29035391,"url":"https://github.com/professionalwiki/edtf","last_synced_at":"2025-10-06T20:51:09.679Z","repository":{"id":52462295,"uuid":"295521488","full_name":"ProfessionalWiki/EDTF","owner":"ProfessionalWiki","description":"PHP library to parse, represent and work with dates that follow the Extended Date/Time Format specification.","archived":false,"fork":false,"pushed_at":"2025-05-15T12:11:42.000Z","size":636,"stargazers_count":10,"open_issues_count":16,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-26T12:09:22.990Z","etag":null,"topics":["date-time","edtf","edtf-php","parser","php"],"latest_commit_sha":null,"homepage":"https://wikibase.consulting/wikibase-edtf","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProfessionalWiki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"JeroenDeDauw","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-09-14T19:44:03.000Z","updated_at":"2025-05-15T12:11:45.000Z","dependencies_parsed_at":"2023-02-17T19:30:34.239Z","dependency_job_id":"52d21335-5826-4ae3-9944-124d984f7a84","html_url":"https://github.com/ProfessionalWiki/EDTF","commit_stats":{"total_commits":300,"total_committers":10,"mean_commits":30.0,"dds":0.4666666666666667,"last_synced_commit":"b3b298d86d0ce162a1d07d89a798f3827117f674"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/ProfessionalWiki/EDTF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfessionalWiki%2FEDTF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfessionalWiki%2FEDTF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfessionalWiki%2FEDTF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfessionalWiki%2FEDTF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProfessionalWiki","download_url":"https://codeload.github.com/ProfessionalWiki/EDTF/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProfessionalWiki%2FEDTF/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262063552,"owners_count":23252767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date-time","edtf","edtf-php","parser","php"],"created_at":"2025-06-26T12:09:18.834Z","updated_at":"2025-10-06T20:51:09.674Z","avatar_url":"https://github.com/ProfessionalWiki.png","language":"PHP","funding_links":["https://github.com/sponsors/JeroenDeDauw"],"categories":[],"sub_categories":[],"readme":"# EDTF PHP Library\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ProfessionalWiki/EDTF/ci.yml?branch=master)](https://github.com/ProfessionalWiki/EDTF/actions?query=workflow%3ACI)\n[![Type Coverage](https://shepherd.dev/github/ProfessionalWiki/EDTF/coverage.svg)](https://shepherd.dev/github/ProfessionalWiki/EDTF)\n[![codecov](https://codecov.io/gh/ProfessionalWiki/EDTF/branch/master/graph/badge.svg?token=GnOG3FF16Z)](https://codecov.io/gh/ProfessionalWiki/EDTF)\n[![Latest Stable Version](https://poser.pugx.org/professional-wiki/edtf/v/stable)](https://packagist.org/packages/professional-wiki/edtf)\n[![Download count](https://poser.pugx.org/professional-wiki/edtf/downloads)](https://packagist.org/packages/professional-wiki/edtf)\n[![License](https://poser.pugx.org/professional-wiki/edtf/license)](LICENSE)\n\nEDTF PHP is a small library for parsing, representing, and working with the\n[Extended Date/Time Format] specification.\n\n[Professional Wiki] created and maintains EDTF. The Luxembourg Ministry of Culture funded the [initial development].\nThis library is an open-source project, so contributions are welcome! You can also commission [software development] via Professional Wiki.\n\n- [Usage](#usage)\n  * [Parsing](#parsing)\n  * [Validating](#validating)\n  * [Humanizing](#humanizing)\n  * [Object model](#object-model)\n- [EDTF support and limits](#edtf-support-and-limits)\n- [Installation](#installation)\n- [Development](#development)\n- [Release notes](#release-notes)\n\n## Usage\n\n### Parsing\n\n```php\n$parser = \\EDTF\\EdtfFactory::newParser();\n$parsingResult = $parser-\u003eparse('1985-04-12T23:20:30');\n$parsingResult-\u003eisValid(); // true\n$parsingResult-\u003egetEdtfValue(); // \\EDTF\\EdtfValue\n$parsingResult-\u003egetInput(); // '1985-04-12T23:20:30'\n```\n\n### Validating\n\n```php\n$validator = \\EDTF\\EdtfFactory::newValidator();\n$validator-\u003eisValidEdtf('1985-04-12T23:20:30'); // true\n````\n\n### Humanizing\n\n```php\n$humanizer = \\EDTF\\EdtfFactory::newHumanizerForLanguage( 'en' );\n$humanizer-\u003ehumanize($edtfValue); // string\n````\n\n### Object model\n\n```php\n$edtfValue-\u003egetMax(); // int\n$edtfValue-\u003egetMin(); // int\n$edtfValue-\u003ecovers(\\EDTF\\EdtfValue $anotherValue); // bool\n```\n\n```php\n$edtfDate-\u003egetYear(); // int\n$edtfDate-\u003eisOpenInterval(); // bool\n$edtfDate-\u003egetQualification(); // \\EDTF\\Qualification\n```\n\n## EDTF support and limits\n\nAll level 0, 1 and 2 EDTF formats can be parsed and represented, except for:\n\n* Open ranges with a date (Level 2: Qualification): `..2004-06-01/2004-06-20` (This is supported: `../2004-06-20`)\n\nHumanization has more limits:\n\n* Significant digits (EDTF level 2): `1950S2` (some year between 1900 and 1999, estimated to be 1950)\n* Group Qualification (EDTF level 2): `2004-06~-11` (year and month approximate)\n* Qualification of Individual Component (EDTF level 2): `?2004-06-~11` (year uncertain; month known; day approximate)\n* Level 2 Unspecified Digit: `1XXX-1X` (October, November, or December during the 1000s)\n\n## Installation\n\nTo use the EDTF library in your project, simply add a dependency on professional-wiki/edtf\nto your project's `composer.json` file. Here is a minimal example of a `composer.json`\nfile that just defines a dependency on EDTF 3.x:\n\n```json\n{\n    \"require\": {\n        \"professional-wiki/edtf\": \"~3.0\"\n    }\n}\n```\n\n## Development\n\nStart by installing the project dependencies by executing\n\n    composer update\n\nYou can run the tests by executing\n\n    make test\n    \nYou can run style checks and static analysis by executing\n\n    make cs\n    \nTo run all CI checks, execute\n\n    make\n    \nYou can also invoke PHPUnit directly to pass it arguments, as follows\n\n    vendor/bin/phpunit --filter SomeClassNameOrFilter\n\n## Release notes\n\n### Version 3.1.0 - 2025-09-23\n\n* Added support for installation with a newer version of a used date time library (`nesbot/carbon` 3.x)\n* Improved translations\n\n### Version 3.0.2 - 2025-05-12\n\n* Improved translations\n\n### Version 3.0.1 - 2024-05-03\n\n* Fixed \"Undefined array key\" warning when combining approximation qualifiers\n* Improved translations\n\n### Version 3.0.0 - 2023-01-18\n\nFunctional changes:\n\n* Improved humanization of uncertain and approximate dates\n* Improved capitalization in humanization, especially for French\n* Various translation updates from TranslateWiki, improving humanization for many languages\n* Added support for pluralization in humanization, for use by TranslateWiki\n\nBreaking API changes:\n\n* Removed parameter of `ExtDate::uncertain`\n* Removed parameter of `ExtDate::approximate`\n* Renamed `FrenchStrategy` to `DefaultStrategy`\n* Made `Qualification` constructor arguments required\n\nFurther API changes:\n\n* Deprecated `ExtDate::uncertain` in favour of `ExtDate::isUncertain`\n* Deprecated `ExtDate::approximate` in favour of `ExtDate::isApproximate`\n* Added `Qualification::newFullyKnown`\n* Added `Qualification::isFullyKnown`\n* Added `Qualification::dayIsKnown`\n* Added `Qualification::monthIsKnown`\n* Added `Qualification::yearIsKnown`\n* Added `Qualification::isUncertain`, replacing `Qualification::uncertain`\n* Added `Qualification::dayIsUncertain`\n* Added `Qualification::monthIsUncertain`\n* Added `Qualification::yearIsUncertain`\n* Added `Qualification::isApproximate`, replacing `Qualification::approximate`\n* Added `Qualification::dayIsApproximate`\n* Added `Qualification::monthIsApproximate`\n* Added `Qualification::yearIsApproximate`\n* Added `Qualification::isUniform`\n* Added `Qualification::monthAndYearHaveTheSameQualification`\n* Added `ExtDate::isUniformlyQualified`\n\n### Version 2.0.2 - 2022-04-29\n\n* Improved translations\n\n### Version 2.0.1 - 2022-02-19\n\n* `?` is no longer recognized as valid date\n\n### Version 2.0.0 - 2021-04-28\n\n* Fixed performance issue for sets with large range elements like `1000-01-01..2000-12-30`\n* Fixed humanization of sets with more than one element, of which at least one an open range\n* Improved humanization of sets with range elements like `2000..2010`\n* Intervals and set ranges with end dates earlier than their start dates are now rejected\n* Various breaking changes to the `Set` class\n  * Constructor signature changed\n  * Removed `hasOpenStart` and `hasOpenEnd`\n  * Removed `isSingleElement`\n* Added `Set::isEmpty`\n* Added `Set::getElements`\n* Added `SetElement` interface with implementations\n  * `OpenSetElement`\n  * `RangeSetElement`\n  * `SingleDateSetElement`\n* `ExtDate::precision` and `Season::precision` are now guaranteed to return an integer\n* `precisionAsString` in `ExtDate` and `Season` is now guaranteed to return a non-empty string\n\n### Version 1.3.0 - 2021-04-26\n\n* Fixed season support in intervals\n* Fixed parsing of open sets with an extra space like `{ ..2021}` (thanks @chaudbak)\n* Added `ExtDate::iso8601` and `ExtDateTime::iso8601` (thanks @seth-shaw-unlv)\n* Added `ParsingResult::getErrorMessage`\n\n### Version 1.2.0 - 2021-04-16\n\n* Improved humanization of open sets\n\n### Version 1.1.0 - 2021-03-20\n\n* Added internationalization to the `StructuredHumanizer` service\n* Fixed handling of \"year 0\"\n\n### Version 1.0.0 - 2021-03-19\n\n* [Initial release] with\n    * Support for EDTF levels 0, 1 and 2\n    * Parsing\n    * Object model\n    * Internationalized humanization\n    * Validation service\n    * Example data\n\n[Professional Wiki]: https://professional.wiki\n[Extended Date/Time Format]: https://www.loc.gov/standards/datetime/\n[initial development]: https://www.wikibase.consulting/wikibase-edtf/\n[initial release]: https://www.wikibase.consulting/wikibase-edtf/\n[software development]: https://professional.wiki/en/mediawiki-development\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofessionalwiki%2Fedtf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprofessionalwiki%2Fedtf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofessionalwiki%2Fedtf/lists"}