{"id":13535438,"url":"https://github.com/AndrewPoyntz/time-ago-pipe","last_synced_at":"2025-04-02T01:30:49.124Z","repository":{"id":11303791,"uuid":"69166241","full_name":"AndrewPoyntz/time-ago-pipe","owner":"AndrewPoyntz","description":"An Angular pipe for converting a date string into a time ago","archived":false,"fork":false,"pushed_at":"2023-01-11T11:56:25.000Z","size":169,"stargazers_count":128,"open_issues_count":26,"forks_count":69,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T01:43:20.906Z","etag":null,"topics":["angular","angular2","aot-compatible","pipe","timeago"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/AndrewPoyntz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-25T13:33:32.000Z","updated_at":"2025-03-11T05:24:17.000Z","dependencies_parsed_at":"2023-01-13T16:26:42.999Z","dependency_job_id":null,"html_url":"https://github.com/AndrewPoyntz/time-ago-pipe","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewPoyntz%2Ftime-ago-pipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewPoyntz%2Ftime-ago-pipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewPoyntz%2Ftime-ago-pipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewPoyntz%2Ftime-ago-pipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewPoyntz","download_url":"https://codeload.github.com/AndrewPoyntz/time-ago-pipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246738426,"owners_count":20825779,"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":["angular","angular2","aot-compatible","pipe","timeago"],"created_at":"2024-08-01T08:00:56.240Z","updated_at":"2025-04-02T01:30:48.878Z","avatar_url":"https://github.com/AndrewPoyntz.png","language":"TypeScript","funding_links":[],"categories":["UI Components","Uncategorized"],"sub_categories":["Time","Uncategorized"],"readme":"# time-ago-pipe\n[![Build Status](https://travis-ci.org/AndrewPoyntz/time-ago-pipe.svg?branch=master)](https://travis-ci.org/AndrewPoyntz/time-ago-pipe) [![npm](https://img.shields.io/npm/v/time-ago-pipe.svg)](https://www.npmjs.com/package/time-ago-pipe) [![npm](https://img.shields.io/npm/dt/time-ago-pipe.svg?maxAge=25920)](https://www.npmjs.com/package/time-ago-pipe) [![GitHub issues](https://img.shields.io/github/issues/AndrewPoyntz/time-ago-pipe.svg?maxAge=25920?style=plastic)](https://github.com/AndrewPoyntz/time-ago-pipe/issues) [![npm](https://img.shields.io/npm/l/time-ago-pipe.svg?maxAge=25920?style=plastic)](https://github.com/AndrewPoyntz/time-ago-pipe/blob/master/LICENSE)\n\n\nA really simple, lightweight Angular pipe for converting a date string into a time ago\n\n|Time Range|Output|\n|---|---|\n|0 - 45 seconds             | a few seconds ago      |\n|45 - 90 seconds            | a minute ago           |\n|90 seconds - 45 minutes    | X minutes ago          |\n|45 - 90 minutes            | an hour ago            |\n|90 minutes - 22 hours      | X hours ago            |\n|22 - 36 hours              | a day ago              |\n|36 hours - 25 days         | X days ago             |\n|25 - 45 days               | a month ago            |\n|45 - 345 days              | X months ago           |\n|345 - 545 days (1.5 years) | a year ago             |\n|546 days+                  | X years ago            |\n\n## Installation\n```npm install time-ago-pipe --save```\n\n## Usage\nIt can be imported into your angular project, as you would for any other library. \n\nIn the @NgModule you want to use it in\n```\nimport {TimeAgoPipe} from 'time-ago-pipe';\n```\nadd \"TimeAgoPipe\" to your declarations\n```\n@NgModule({\n\timports: [... etc ...],\n\tdeclarations: [..., TimeAgoPipe, ... ]\n})\n```\n---\n\nIn your component templates you can just do:\n```\n\u003cspan\u003e{{your_date | timeAgo}}\u003c/span\u003e\n```\nwhere \"your_date\" is a local date string, which could be parsed by the standard Js Date()\n\nIf this value is null or not parsable as a date, then the pipe will display nothing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndrewPoyntz%2Ftime-ago-pipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAndrewPoyntz%2Ftime-ago-pipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndrewPoyntz%2Ftime-ago-pipe/lists"}