{"id":21003069,"url":"https://github.com/jerazo7/age_calculator","last_synced_at":"2025-05-15T00:31:45.810Z","repository":{"id":56825805,"uuid":"345793645","full_name":"JErazo7/age_calculator","owner":"JErazo7","description":"A Flutter package to calculate someone's age in days, months, and years; in addition it can be used to find the difference between two dates.","archived":false,"fork":false,"pushed_at":"2023-09-05T09:42:23.000Z","size":8456,"stargazers_count":9,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-16T03:27:26.830Z","etag":null,"topics":["dart","flutter"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/age_calculator","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JErazo7.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2021-03-08T21:00:56.000Z","updated_at":"2024-05-29T18:06:33.000Z","dependencies_parsed_at":"2024-11-16T03:26:47.860Z","dependency_job_id":"b61cd995-1440-4af3-9c45-4ef21d8d5968","html_url":"https://github.com/JErazo7/age_calculator","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"29800d583eaff92c7b7ba0ba4f5227133d9bf35c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JErazo7%2Fage_calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JErazo7%2Fage_calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JErazo7%2Fage_calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JErazo7%2Fage_calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JErazo7","download_url":"https://codeload.github.com/JErazo7/age_calculator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225318022,"owners_count":17455538,"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":["dart","flutter"],"created_at":"2024-11-19T08:22:43.148Z","updated_at":"2024-11-19T08:22:43.711Z","avatar_url":"https://github.com/JErazo7.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# age_calculator\n\nA Flutter package that allows you to perform operations between dates:\n- Calculate a person's age and the time remaining to their next birthday in years, months and days. \n- Calculate differences between two dates in years, months and days.\n- Add years, months and days to any date.\n\n## Getting Started\n\nIn your flutter project add the dependency:\n\ndependencies:\n  ...\n  age_calculator: ^1.0.0\n\nFor help getting started with Flutter, view the online documentation.\n\n### Example\n\n```dart\nimport 'package:age_calculator/age_calculator.dart';\n\nvoid main() {\n  DateTime birthday = DateTime(1997, 3, 5);\n\n  DateDuration duration;\n\n  // Find out your age as of today's date 2021-03-08\n  duration = AgeCalculator.age(birthday);\n  print('Your age is $duration'); // Your age is Years: 24, Months: 0, Days: 3\n\n  //Find out your age on any given date\n  duration = AgeCalculator.age(birthday, today: DateTime(2030, 5, 1));\n  print('Your age is $duration'); // Your age is Years: 33, Months: 1, Days: 26\n\n  // Find out when your next birthday will be at 2021-03-08\n  duration = AgeCalculator.timeToNextBirthday(birthday);\n  print('You next birthday will be in $duration');\n  // You next birthday will be in Years: 0, Months: 11, Days: 25\n\n  // Find out when your next birthday will be on any given date\n  duration = AgeCalculator.timeToNextBirthday(birthday,\n      fromDate: DateTime(2021, 3, 2));\n  print('You next birthday will be in $duration');\n  // You next birthday will be in Years: 0, Months: 0, Days: 3\n\n  // Find out the difference between two dates\n  duration = AgeCalculator.dateDifference(\n    fromDate: DateTime(2021, 1, 2),\n    toDate: DateTime(2025, 5, 2),\n  );\n  print('The difference is $duration');\n  // You next birthday will be in Years: 4, Months: 4, Days: 0\n\n  // Add time to any date\n  DateTime date = AgeCalculator.add(\n      date: DateTime(2021, 1, 2),\n      duration: DateDuration(years: 5, months: 2, days: 1));\n  print(date);\n  // 2026-03-03 00:00:00.000\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerazo7%2Fage_calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerazo7%2Fage_calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerazo7%2Fage_calculator/lists"}