{"id":13807552,"url":"https://github.com/json-derulo/angular-ecmascript-intl","last_synced_at":"2025-09-02T04:07:38.690Z","repository":{"id":65971717,"uuid":"603704473","full_name":"json-derulo/angular-ecmascript-intl","owner":"json-derulo","description":"Contains pipes to transform internationalization data using Intl.* browser APIs","archived":false,"fork":false,"pushed_at":"2025-08-27T20:25:20.000Z","size":14604,"stargazers_count":17,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-28T03:10:51.997Z","etag":null,"topics":["angular","angular-pipe","date-formatting","i18n","pipe","timeago"],"latest_commit_sha":null,"homepage":"https://json-derulo.github.io/angular-ecmascript-intl/","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/json-derulo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"json-derulo"}},"created_at":"2023-02-19T10:34:07.000Z","updated_at":"2025-08-27T18:08:34.000Z","dependencies_parsed_at":"2024-02-15T07:28:43.559Z","dependency_job_id":"e6e83290-2741-4388-a461-ec457a9ab932","html_url":"https://github.com/json-derulo/angular-ecmascript-intl","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":0.5,"last_synced_commit":"ab953b9402588ed275b866536137f30d67f4efee"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/json-derulo/angular-ecmascript-intl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-derulo%2Fangular-ecmascript-intl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-derulo%2Fangular-ecmascript-intl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-derulo%2Fangular-ecmascript-intl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-derulo%2Fangular-ecmascript-intl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/json-derulo","download_url":"https://codeload.github.com/json-derulo/angular-ecmascript-intl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-derulo%2Fangular-ecmascript-intl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273227988,"owners_count":25067696,"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-09-02T02:00:09.530Z","response_time":77,"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":["angular","angular-pipe","date-formatting","i18n","pipe","timeago"],"created_at":"2024-08-04T01:01:26.750Z","updated_at":"2025-09-02T04:07:38.681Z","avatar_url":"https://github.com/json-derulo.png","language":"TypeScript","readme":"# Angular ECMAScript Intl\n\n[![codecov](https://codecov.io/gh/json-derulo/angular-ecmascript-intl/graph/badge.svg?token=RHNUC3YCJP)](https://codecov.io/gh/json-derulo/angular-ecmascript-intl)\n\nContains pipes to transform internationalization data using `Intl.*` browser APIs.\n\n## Getting started\n\nInstall the package:\n\n```\nnpm install angular-ecmascript-intl --save\n```\n\nThis package requires TypeScript with a lib setting of ES2021 or later.\nOlder lib targets (e.g., ES2020 or below) are not supported and may cause\ntype errors or missing type definitions. Make sure your `tsconfig.json` includes\n`\"lib\": [\"ES2021\"]` (or a newer standard such as ES2022) to ensure full compatibility.\n\nImport the pipes individually as per usage, or import the `IntlModule` to import all pipes at once.\n\nBy default, all pipes will use the browser default locale.\nIf you want to override it, you can provide the `INTL_LOCALES` injection token:\n\n```typescript\nimport { NgModule } from \"@angular/core\";\nimport { INTL_LOCALES } from \"angular-ecmascript-intl\";\n\n@NgModule({\n  providers: [\n    {\n      provide: INTL_LOCALES,\n      useValue: \"de-DE\",\n    },\n  ],\n})\nexport class MyModule {}\n```\n\nAlso, every pipe accepts the `locale` option.\n\nNow you can use the pipes, see below.\n\n## Pipes\n\n- [Date pipe](#date-pipe)\n- [Decimal pipe](#decimal-pipe)\n- [Percent pipe](#percent-pipe)\n- [Currency pipe](#currency-pipe)\n- [Language pipe](#language-pipe)\n- [Country pipe](#country-pipe)\n- [Unit pipe](#unit-pipe)\n- [List pipe](#list-pipe)\n- [Relative Time (timeago) pipe](#relative-time-timeago-pipe)\n- [Duration pipe](#duration-pipe)\n\n### Date pipe\n\nUse the date pipe like the following:\n\n```\n{{myDate | intlDate: options}}\n```\n\nThe input date can be one of the following:\n\n- `Date` object\n- number (UNIX timestamp)\n- string (will be parsed by `new Date()` constructor)\n- null\n- undefined\n\nThe following options are supported:\n\n- [`dateStyle`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#datestyle)\n- [`timeStyle`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#timestyle)\n- [`hour12`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#hour12)\n\nWith the `INTL_DATE_PIPE_DEFAULT_OPTIONS` injection token you can specify default options.\n\n### Decimal pipe\n\nUse the decimal pipe like the following:\n\n```\n{{1.24 | intlDecimal: options}}\n```\n\nThe input can be one of the following:\n\n- number\n- string (must be parseable as number)\n- null\n- undefined\n\nThe following options are supported:\n\n- [`notation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#notation)\n- [`signDisplay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay)\n- [`minimumIntegerDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumintegerdigits)\n- [`minimumFractionDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits)\n- [`maximumFractionDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits)\n- [`minimumSignificantDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumsignificantdigits)\n- [`maximumSignificantDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumsignificantdigits)\n\nWith the `INTL_DECIMAL_PIPE_DEFAULT_OPTIONS` injection token you can specify default options.\n\n### Percent pipe\n\nUse the percent pipe like the following:\n\n```\n{{0.24 | intlPercent: options}}\n```\n\nThe input can be one of the following:\n\n- number\n- string (must be parseable as number)\n- null\n- undefined\n\nThe following options are supported:\n\n- [`notation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#notation)\n- [`signDisplay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay)\n- [`minimumIntegerDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumintegerdigits)\n- [`minimumFractionDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits)\n- [`maximumFractionDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits)\n- [`minimumSignificantDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumsignificantdigits)\n- [`maximumSignificantDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumsignificantdigits)\n\nWith the `INTL_PERCENT_PIPE_DEFAULT_OPTIONS` injection token you can specify default options.\n\n### Currency pipe\n\nUse the currency pipe like the following:\n\n```\n{{1.24 | intlCurrency: 'USD': options}}\n```\n\nThe input can be one of the following:\n\n- number\n- string (must be parseable as number)\n- null\n- undefined\n\nThe currency code parameter is required and must be a valid ISO 4217 currency code. If you want to transform a decimal\nnumber instead, use the `intlDecimal` pipe.\n\nThe following additional options are supported:\n\n- [`currencyDisplay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay)\n- [`currencySign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencysign)\n- [`notation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#notation)\n- [`signDisplay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay)\n- [`minimumIntegerDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumintegerdigits)\n- [`minimumFractionDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits)\n- [`maximumFractionDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits)\n- [`minimumSignificantDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumsignificantdigits)\n- [`maximumSignificantDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumsignificantdigits)\n\nWith the `INTL_CURRENCY_PIPE_DEFAULT_OPTIONS` injection token you can specify default options.\n\n### Language pipe\n\nUse the language pipe like the following:\n\n```\n{{'en-US' | intlLanguage: options}}\n```\n\nThe input can be one of the following:\n\n- string (must be a BCP 47 IETF language tag)\n- null\n- undefined\n\nThe following option is supported:\n\n- [`languageDisplay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames#languagedisplay)\n\nWith the `INTL_LANGUAGE_PIPE_DEFAULT_OPTIONS` injection token you can specify default options.\n\n### Country pipe\n\nUse the country pipe like the following:\n\n```\n{{'US' | intlCountry: options}}\n```\n\nThe input can be one of the following:\n\n- string (must be two-letter ISO 639-1 language code or a three-letter ISO 639-2 language code)\n- null\n- undefined\n\n### Unit pipe\n\nUse the unit pipe like the following:\n\n```\n{{1.2 | intlUnit: 'hour': options}}\n```\n\nThe input can be one of the following:\n\n- number\n- string (must be parseable as number)\n- null\n- undefined\n\nThe unit parameter is required, see\nthe [specification](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier)\nfor a full list of possible values. If you want to transform a decimal number instead, use the `intlDecimal` pipe.\n\nThe following additional options are supported:\n\n- [`unitDisplay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unitdisplay)\n- [`notation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#notation)\n- [`signDisplay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay)\n- [`minimumIntegerDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumintegerdigits)\n- [`minimumFractionDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits)\n- [`maximumFractionDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits)\n- [`minimumSignificantDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumsignificantdigits)\n- [`maximumSignificantDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumsignificantdigits)\n\nWith the `INTL_UNIT_PIPE_DEFAULT_OPTIONS` injection token you can specify default options.\n\n### List pipe\n\nUse the list pipe like the following:\n\n```\n{{['my', 'items'] | intlList: options}}\n```\n\nThe input can be one of the following:\n\n- Iterable of strings\n- null\n- undefined\n\nThe following options are supported:\n\n- [`type`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#type)\n- [`style`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#style)\n\nWith the `INTL_LIST_PIPE_DEFAULT_OPTIONS` injection token you can specify default options.\n\n## Relative Time (timeago) pipe\n\nThe relative time format will format the input date compared to the current date in a \"timeago\" format. Every minute,\nthe value will be updated automatically.\n\nUse the relative time pipe like the following:\n\n```\n{{myDate | intlRelativeTime: options}}\n```\n\nThe input date can be one of the following:\n\n- `Date` object\n- number (UNIX timestamp)\n- string (will be parsed by `new Date()` constructor)\n- null\n- undefined\n\nThe following options are supported:\n\n- [`numeric`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#numeric)\n- [`style`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#style)\n\nWith the `INTL_RELATIVE_TIME_PIPE_DEFAULT_OPTIONS` injection token you can specify default options.\n\n## Duration pipe\n\nUse the duration pipe like the following:\n\n```\n{{ { hours: 2, minutes: 53 } | intlDuration: options }}\n```\n\nThe input can be one of the following:\n\n- [duration object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/format#parameters)\n- null\n- undefined\n\nThe following options are supported:\n\n- [`style`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#style)\n- [`fractionalDigits`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#fractionalDigits)\n\nFor each duration unit, there is a style and display option.\n\n## Browser compatibility\n\nThis library supports the latest major version of the following browsers:\n\n- Chrome\n- Firefox\n- Safari\n\nFor each of those browsers, unit tests are being performed regularly.\n\nIn case you need to support older versions of that browsers, see the below table with the minimum required browser version for each pipe:\n\n| Pipe          | Chrome | Firefox | Safari |\n| ------------- | ------ | ------- | ------ |\n| Date          | 24     | 29      | 10     |\n| Number        | 24     | 29      | 10     |\n| Percent       | 24     | 29      | 10     |\n| Currency      | 24     | 29      | 10     |\n| Language      | 81     | 86      | 14.1   |\n| Country       | 81     | 86      | 14.1   |\n| Unit          | 77     | 78      | 14.1   |\n| List          | 72     | 78      | 14.1   |\n| Relative Time | 71     | 65      | 14     |\n| Duration      | 129    | 136     | 16.4   |\n\n## Angular compatibility table\n\n| Angular | angular-ecmascript-intl |\n| ------- | ----------------------- |\n| 20      | 6.x                     |\n| 19      | 5.x                     |\n| 18      | 4.x                     |\n| 17      | 3.x                     |\n| 16      | 2.x                     |\n| 15      | 1.x                     |\n\n## Background\n\nFor more context, see the following [GitHub issue](https://github.com/angular/angular/issues/49143)\n","funding_links":["https://github.com/sponsors/json-derulo"],"categories":["Development Utilities"],"sub_categories":["Internationalization"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson-derulo%2Fangular-ecmascript-intl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjson-derulo%2Fangular-ecmascript-intl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson-derulo%2Fangular-ecmascript-intl/lists"}