{"id":25170097,"url":"https://github.com/codaxy/intl-io","last_synced_at":"2025-05-05T17:57:29.055Z","repository":{"id":47262466,"uuid":"54881731","full_name":"codaxy/intl-io","owner":"codaxy","description":"Culture-specific date/time and number formatting and parsing based on ECMAScript Internationalization API (Intl).","archived":false,"fork":false,"pushed_at":"2024-09-03T12:08:58.000Z","size":274,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T22:55:41.621Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/codaxy.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-03-28T09:30:26.000Z","updated_at":"2024-09-03T12:09:02.000Z","dependencies_parsed_at":"2022-09-26T18:21:14.426Z","dependency_job_id":null,"html_url":"https://github.com/codaxy/intl-io","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codaxy%2Fintl-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codaxy%2Fintl-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codaxy%2Fintl-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codaxy%2Fintl-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codaxy","download_url":"https://codeload.github.com/codaxy/intl-io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252547523,"owners_count":21766004,"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":[],"created_at":"2025-02-09T08:38:33.609Z","updated_at":"2025-05-05T17:57:29.011Z","avatar_url":"https://github.com/codaxy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003eintl-io\n\u003ca href=\"https://npmjs.org/package/intl-io\"\u003e\n    \u003cimg src=\"https://badgen.now.sh/npm/v/intl-io\" alt=\"version\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://npmjs.org/package/intl-io\"\u003e\n    \u003cimg src=\"https://badgen.now.sh/npm/dm/intl-io\" alt=\"downloads\" /\u003e\n\u003c/a\u003e\n\u003c/h1\u003e\n\n_Culture specific date/time and number formatting and **parsing** based on ECMAScript Internationalization API (Intl)._\n\nUsed for localized [calendars](https://docs.cxjs.io/widgets/calendars), [date fields](https://docs.cxjs.io/widgets/date-fields) and [number fields](https://docs.cxjs.io/widgets/number-fields) in [CxJS](https://cxjs.io/).\n\nThis module is available in four formats:\n\n-   **CommonJS**: `dist/intl-io.js`\n-   **ES Module**: `dist/intl-io.module.js`\n-   **Modern ES Module**: `dist/intl-io.modern.js`\n-   **UMD**: `dist/intl-io.umd.js`\n\n## Install\n\n```\n$ npm install intl-io --save\n```\n\n## Usage\n\n```js\nimport { DateTimeCulture, NumberCulture } from 'intl-io';\n\nlet dateCulture = new DateTimeCulture('es');\ndateCulture.format(new Date(), 'yyyyMMdd'); //28/08/2019\ndateCulture.format(new Date(), 'yyyyMMMdd'); //28 ago. 2019\ndateCulture.format(new Date(), 'yyyyMMdd'); //28 de agosto de 2019\ndateCulture.format(new Date(), 'yyyyMMddDDD'); //mié., 28 de agosto de 2019\nlet date = culture.parse('mié., 28 de agosto de 2019', { loose: true }); //Aug 28, 2019\n\nlet numberCulture = new NumberCulture('de');\nlet formatter = numberCulture.getFormatter({\n    style: 'currency',\n    currency: 'EUR',\n});\nlet currency = formatter.format(5555.5); //5.555,50 €\nlet number = numberCulture.parse('5.555,5'); //5555.5\n```\n\nFor number formatting options look at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat.\n\n## Date time formatting\n\nSome parts support different length. Four digits means full name, three digits is a long form, two digits is medium and one digit is short form.\n\n-   `YYYY` - full year (e.g. 2019)\n-   `YY` - short year (e.g. 19)\n\n*   `MMMM` - long month name (e.g. August)\n*   `MMM` - short month name (e.g. Aug)\n*   `MM` - two digit month (e.g. 08)\n*   `M` - numeric month (e.g. 8)\n\n-   `DDDD` - full day name (e.g. Monday)\n-   `DDD` - short day name (e.g. Mon)\n-   `DD` - short day name (e.g. Mo)\n-   `D` - short day name (e.g. M)\n\n### Examples\n\n| Format          | Description    | Result                |\n| --------------- | -------------- | --------------------- |\n| `yyyyMMdd`      | Short date     | 09/07/2019            |\n| `yyyyMMMdd`     | Medium date    | Sep 07, 2019          |\n| `HHmm`          | Short time     | 09:35 PM              |\n| `HHmmN`         | Short time     | 21:35                 |\n| `yyyyMMMddHHmm` | Full date time | Sep 07, 2019 09:35 PM |\n\n#### Format Specifiers\n\n| Specifier | Part         |\n| --------- | ------------ |\n| `y`, `Y`  | year         |\n| `M`       | month        |\n| `D`       | day name     |\n| `d`       | day          |\n| `h`, `H`  | hours        |\n| `m`, `i`  | minutes      |\n| `s`, `S`  | seconds      |\n| `a`, `A`  | hour12 AM/PM |\n| `p`, `P`  | hour12 AM/PM |\n| `n`, `N`  | hour24       |\n| `t`, `T`  | timezone     |\n| `u`, `U`  | UTC timezone |\n| `z`, `Z`  | UTC timezone |\n\nFor detailed date formatting options look at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat.\n\n## License\n\nMIT © [Codaxy](https://www.codaxy.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodaxy%2Fintl-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodaxy%2Fintl-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodaxy%2Fintl-io/lists"}