{"id":26967088,"url":"https://github.com/yb66/newage","last_synced_at":"2025-08-26T12:20:51.746Z","repository":{"id":56885393,"uuid":"3403019","full_name":"yb66/NewAge","owner":"yb66","description":"Handling year and month inputs sanely.","archived":false,"fork":false,"pushed_at":"2013-09-05T09:09:21.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-20T11:45:58.925Z","etag":null,"topics":["age","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yb66.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-10T00:53:52.000Z","updated_at":"2019-01-15T06:48:13.000Z","dependencies_parsed_at":"2022-08-20T13:50:58.776Z","dependency_job_id":null,"html_url":"https://github.com/yb66/NewAge","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/yb66/NewAge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yb66%2FNewAge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yb66%2FNewAge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yb66%2FNewAge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yb66%2FNewAge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yb66","download_url":"https://codeload.github.com/yb66/NewAge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yb66%2FNewAge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272219733,"owners_count":24894475,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["age","ruby"],"created_at":"2025-04-03T08:38:35.359Z","updated_at":"2025-08-26T12:20:51.706Z","avatar_url":"https://github.com/yb66.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Welcome to the New Age! ##\n\nExcuse me while I light some scented candles...\n\nHandling age as an input is pain. Should it be 12.5? 12 years? Two separate fields on a form, one for year, one for month?\n\n    puts NewAge \"12y 5m\"   #=\u003e \"12 years 5 months\"\n\n    NewAge(\"28\").age       #=\u003e {years: 28, months: 0}\n    \n    puts NewAge \"9 months\" #=\u003e \"0 years 9 months\"\n\n    NewAge(\"72 y 6m\").to_s #=\u003e \"72 years 6 months\"\n    NewAge(\"72 y 6m\").to_s( \"%d YEARS\" ) #=\u003e \"72 YEARS\"\n\n    puts NewAge \"12.5\"     #=\u003e 12 years 5 months\n    # No, I don't think it should be 6 months.\n\n    puts NewAge \"12.11\"    #=\u003e 12 years 11 months\n    puts NewAge \"12 11\"    #=\u003e 12 years 11 months\n    puts NewAge \"12-11\"    #=\u003e 12 years 11 months\n    puts NewAge \"12\"       #=\u003e 12 years 0 months\n    puts NewAge \"12 m\"     #=\u003e 0 years 12 months\n\nThere's nothing but years and months as that is all I need for now. The validation is not very strict, just enough to let two numbers in that are recognised as a year and a month. \n\n## Licence ##\n\nThis is under the MIT Licence.\n\nCopyright (c) 2012 Iain Barnett\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nIn other words, be good.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyb66%2Fnewage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyb66%2Fnewage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyb66%2Fnewage/lists"}