{"id":28455732,"url":"https://github.com/rafalgolarz/age_guard","last_synced_at":"2025-06-27T02:32:32.254Z","repository":{"id":57478755,"uuid":"239884557","full_name":"rafalgolarz/age_guard","owner":"rafalgolarz","description":"Verifies if a person born at a given date meets provided age requirements.","archived":false,"fork":false,"pushed_at":"2020-03-10T14:41:20.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T07:45:58.982Z","etag":null,"topics":["age-verification-gate","elixir","elixir-lang","hex","package"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/age_guard","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafalgolarz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-11T23:16:52.000Z","updated_at":"2020-03-10T14:41:22.000Z","dependencies_parsed_at":"2022-09-17T04:21:47.471Z","dependency_job_id":null,"html_url":"https://github.com/rafalgolarz/age_guard","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rafalgolarz/age_guard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalgolarz%2Fage_guard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalgolarz%2Fage_guard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalgolarz%2Fage_guard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalgolarz%2Fage_guard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafalgolarz","download_url":"https://codeload.github.com/rafalgolarz/age_guard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalgolarz%2Fage_guard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262177866,"owners_count":23270951,"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":["age-verification-gate","elixir","elixir-lang","hex","package"],"created_at":"2025-06-06T22:10:35.328Z","updated_at":"2025-06-27T02:32:32.236Z","avatar_url":"https://github.com/rafalgolarz.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Hex.pm](https://img.shields.io/hexpm/v/age_guard.svg?maxAge=2592000)](https://hex.pm/packages/age_guard)\n[![Downloads](https://img.shields.io/hexpm/dt/age_guard.svg?maxAge=3600)](https://hex.pm/packages/age_guard)\n\n# AgeGuard\n\nVerifies if a person born at a given date meets provided age requirements.\n\nIt checks given DOB (date of birth) against given age.\nUseful when registering users.\n\nAcceptable formats of DOB (mix of integers and strings):\n\n```Elixir\n1, 12, 2020\n01, 03, 2010\n\"01\", \"12\", \"2020\"\n\"1\", \"3\", \"2010\"\n\"03\", \"March\", \"2011\"\n\"17\", \"Mar\", \"2018\"\n17, \"Mar\", 2019\n\"13\", 02, \"2019\"\n```\n\nAlso does some dates validations (dates from the future are rejected).\n\n\n## Installation\n\nThe package can be installed by adding `age_guard` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:age_guard, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nand running `mix deps.get` in your console to fetch from Hex.\n\n## Basic Usage\n\n```Elixir\nAgeGuard.is_old_enough?(day_of_birth, month_of_birth, year_of_birth, required_age)\n```\n\nExamples:\n\n```Elixir\n  iex\u003e AgeGuard.is_old_enough?(\"1\",\"5\",\"2019\", 21)\n  false\n\n  iex\u003e AgeGuard.is_old_enough?(3, \"March\", 2000, 21)\n  false\n\n  iex\u003e AgeGuard.is_old_enough?(3, 3, 2000, 18)\n  true\n\n  iex\u003e AgeGuard.is_old_enough?(3, \"Dec\", 1995, 18)\n  true\n```\n\n\n## Author\nRafał Golarz\n\nAgeGuard is released under the [MIT License](https://github.com/rafalgolarz/age_guard/blob/master/LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalgolarz%2Fage_guard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafalgolarz%2Fage_guard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalgolarz%2Fage_guard/lists"}