{"id":44184081,"url":"https://github.com/corylown/edtf-humanize","last_synced_at":"2026-02-09T15:31:29.664Z","repository":{"id":3959903,"uuid":"51518127","full_name":"corylown/edtf-humanize","owner":"corylown","description":"This gem adds a humanize method to EDTF dates.","archived":false,"fork":false,"pushed_at":"2026-01-12T14:34:18.000Z","size":199,"stargazers_count":16,"open_issues_count":1,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-01-14T10:56:04.085Z","etag":null,"topics":["code4lib","edtf","edtf-ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/corylown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-02-11T13:59:14.000Z","updated_at":"2026-01-12T16:13:26.000Z","dependencies_parsed_at":"2024-12-17T16:36:42.842Z","dependency_job_id":"f0ceecc2-da14-487e-964b-d65d26ac1115","html_url":"https://github.com/corylown/edtf-humanize","commit_stats":{"total_commits":64,"total_committers":7,"mean_commits":9.142857142857142,"dds":0.328125,"last_synced_commit":"781d78536fa4dc039e2433af1239bf94c5728bd0"},"previous_names":["duke-libraries/edtf-humanize"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/corylown/edtf-humanize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corylown%2Fedtf-humanize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corylown%2Fedtf-humanize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corylown%2Fedtf-humanize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corylown%2Fedtf-humanize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corylown","download_url":"https://codeload.github.com/corylown/edtf-humanize/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corylown%2Fedtf-humanize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29270851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T13:47:44.167Z","status":"ssl_error","status_checked_at":"2026-02-09T13:47:43.721Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["code4lib","edtf","edtf-ruby"],"created_at":"2026-02-09T15:31:28.594Z","updated_at":"2026-02-09T15:31:29.654Z","avatar_url":"https://github.com/corylown.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# edtf-humanize\n\n\nThe EDTF-humanize gem adds a humanize method to EDTF::Decade, EDTF::Century, EDTF::Interval, EDTF::Set, EDTF::Season, EDTF::Unknown, and Date (ISO 8601 compliant) objects. It uses the [edtf-ruby](https://github.com/inukshuk/edtf-ruby) gem for parsing EDTF date strings into Date and EDTF objects.\n\nSee the [edtf-ruby project's documentation](https://github.com/inukshuk/edtf-ruby) for details about supported EDTF string formats and other implementation details.\n\nThis gem is used in production by Duke University Library's [digital repository](https://gitlab.oit.duke.edu/ddr/ddr-xenon/) to transform date metadata stored as Extended Date Time Format (EDTF) strings into human readable strings for display.\n\n\n## Installation\n\nIn a Rails application using Bundler\n\nAdd the following to your Gemfile:\n\n```\ngem 'edtf-humanize'\n```\n\nThen run:\n\n```\n\u003e bundle install\n```\n\nTo use in other contexts install the gem and require it:\n\n```\n\u003e gem install edtf-humanize\n```\n\n```\nrequire 'edtf-humanize'\n```\n\n\n## Examples\n\n\n### Date (ISO 8601)\n\n```\n\u003e d = Date.edtf('1975-07-01')\n =\u003e Tue, 01 Jul 1975\n\u003e d.humanize\n =\u003e \"July 1, 1975\"\n\u003e d = Date.edtf('1981~')\n =\u003e Thu, 01 Jan 1981\n\u003e d.humanize\n =\u003e \"circa 1981\"\n\u003e d = Date.edtf('198u')\n =\u003e Tue, 01 Jan 1980\n\u003e d.humanize\n =\u003e \"198x\"\n ```\n\n### EDTF::Season\n\n```\n\u003e d = Date.edtf('1975-22')\n =\u003e #\u003cEDTF::Season:0x0000000b6dd980 @year=1975, @season=:summer, @qualifier=nil\u003e\n\u003e d.humanize\n =\u003e \"summer 1975\"\n ```\n\n### EDTF::Decade\n\n ```\n\u003e d = Date.edtf('197x')\n =\u003e #\u003cEDTF::Decade:0x0000000b6fe798 @year=1970\u003e\n\u003e d.humanize\n =\u003e \"1970s\"\n ```\n\n### EDTF::Century\n\n ```\n\u003e d = Date.edtf('19xx')\n =\u003e #\u003cEDTF::Century:0x0000000b6fe798 @year=1900\u003e\n\u003e d.humanize\n =\u003e \"1900s\"\n ```\n\n### EDTF::Interval\n\n ```\n\u003e d = Date.edtf('1981/1985')\n =\u003e #\u003cEDTF::Interval:0x0000000ceeab18 @from=Thu, 01 Jan 1981, @to=Tue, 01 Jan 1985\u003e\n\u003e d.humanize\n =\u003e \"1981 to 1985\"\n ```\n\n### EDTF::Set\n\n ```\n\u003e d = Date.edtf('[1888, 1889, 1891]')\n =\u003e #\u003cEDTF::Set:0x0000000cef5450 @dates=#\u003cSet: {Sun, 01 Jan 1888, Tue, 01 Jan 1889, Thu, 01 Jan 1891}\u003e, @choice=true, @later=false, @earlier=false\u003e\n\u003e d.humanize\n =\u003e \"1888, 1889 or 1891\"\n ```\n\n### EDTF::Unknown\n\n```\n\u003e d = Date.edtf('uuuu')\n =\u003e #\u003cEDTF::Unknown:0x0000000c04c688 @d=1\u003e\n\u003e d.humanize\n =\u003e \"unknown\"\n```\n\n## Internationalization\n\nEDTF-humanize supports the use of I18n as well as language specific module overrides for more nuanced control. English, French, German, and Italian are supported.\n\nExamples with current locale `:fr`:\n\n```\n\u003e Date.edtf('1975-24').humanize\n =\u003e \"hiver 1975\"\n \u003e Date.edtf('20xx').humanize\n =\u003e \"XXIe siècle\"\n```\n\nPull requests to add support for additional languages are welcome. You must add a new language module for the language and include the Default language module. A locales file with translations is also needed. The supporting files for French may be used as a reference for adding support for additional languages.:\n\n```\nedtf-humanize/lib/edtf/humanize.rb\nedtf-humanize/config/locales/fr.edtf.yml\nedtf-humanize/lib/edtf/humanize/language/french.rb\nedtf-humanize/spec/edtf/humanize_fr_spec.rb\n```\n\n## Contributions\n\nContributions, especially to add support for additional languages are welcome. Tests are expected and written using RSpec. Code style is enforced with Rubocop.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorylown%2Fedtf-humanize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorylown%2Fedtf-humanize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorylown%2Fedtf-humanize/lists"}