{"id":26847770,"url":"https://github.com/nerixyz/icu-typ","last_synced_at":"2026-03-09T16:38:14.156Z","repository":{"id":242108172,"uuid":"808706053","full_name":"Nerixyz/icu-typ","owner":"Nerixyz","description":"Wrapper around ICU4X' datetime formatting for Typst to provide internationalized formatting for dates, times, and timezones","archived":false,"fork":false,"pushed_at":"2026-03-02T20:02:02.000Z","size":619,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-02T21:09:03.697Z","etag":null,"topics":["rust","typst","wasm"],"latest_commit_sha":null,"homepage":"https://nerixyz.github.io/icu-typ/","language":"Rust","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/Nerixyz.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-31T16:30:53.000Z","updated_at":"2026-03-02T20:02:06.000Z","dependencies_parsed_at":"2026-01-19T20:13:01.131Z","dependency_job_id":null,"html_url":"https://github.com/Nerixyz/icu-typ","commit_stats":null,"previous_names":["nerixyz/icu-typ"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Nerixyz/icu-typ","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nerixyz%2Ficu-typ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nerixyz%2Ficu-typ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nerixyz%2Ficu-typ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nerixyz%2Ficu-typ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nerixyz","download_url":"https://codeload.github.com/Nerixyz/icu-typ/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nerixyz%2Ficu-typ/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30302677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T14:33:48.460Z","status":"ssl_error","status_checked_at":"2026-03-09T14:33:48.027Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["rust","typst","wasm"],"created_at":"2025-03-30T20:30:51.282Z","updated_at":"2026-03-09T16:38:14.148Z","avatar_url":"https://github.com/Nerixyz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# icu-datetime\n\n\u003c!-- markdownlint-disable-file MD033 --\u003e\n\u003c!-- markdownlint-configure-file { \"no-duplicate-heading\": { \"siblings_only\": true } } --\u003e\n\nThis library is a wrapper around [ICU4X](https://github.com/unicode-org/icu4x)' `datetime` formatting for Typst which provides internationalized formatting for dates, times, and timezones.\n\nAs the WASM bundle includes all localization data, it's quite large (about 8 MiB).\n\nSee [nerixyz.github.io/icu-typ](https://nerixyz.github.io/icu-typ) for a full API reference with more examples as well as a migration guide.\n\n## Example\n\n```typ\n#import \"@preview/icu-datetime:0.2.1\" as icu\n\n#let day = datetime(\n  year: 2024,\n  month: 5,\n  day: 31,\n)\n#let time = datetime(\n  hour: 18,\n  minute: 2,\n  second: 23,\n)\n#let dt = datetime(\n  year: 2024,\n  month: 5,\n  day: 31,\n  hour: 18,\n  minute: 2,\n  second: 23,\n)\n#let tz = (offset: \"-07\", iana: \"America/Los_Angeles\")\n\n= Date\n#icu.fmt(day, locale: \"km\", date-fields: \"YMDE\") \\\n#icu.fmt(day, locale: \"af\", date-fields: \"YMDE\") \\\n#icu.fmt(day, locale: \"za\", date-fields: \"YMDE\") \\\n\n= Time\n#icu.fmt(time, locale: \"id\", time-precision: \"second\") \\\n#icu.fmt(time, locale: \"en\", time-precision: \"second\") \\\n#icu.fmt(time, locale: \"ga\", time-precision: \"second\") \\\n\n= Date and Time\n#icu.fmt(dt, locale: \"ru\", length: \"long\") \\\n#icu.fmt(dt, locale: \"en-US\", length: \"long\") \\\n#icu.fmt(dt, locale: \"zh-Hans-CN\", length: \"long\") \\\n#icu.fmt(dt, locale: \"ar\", length: \"long\") \\\n#icu.fmt(dt, locale: \"fi\", length: \"long\")\n\n= Zone\n#icu.fmt(\n  datetime.today(), // to resolve the zone variant\n  zone: tz,\n  zone-style: \"specific-long\",\n) \\\n#icu.fmt(\n  datetime.today(),\n  zone: tz,\n  zone-style: \"generic-short\",\n)\n\n= Zoned Datetime\n#let opts = (\n  zone: tz,\n  date-fields: \"YMDE\",\n  time-precision: \"second\",\n  length: \"long\",\n)\n\n#icu.fmt(dt, ..opts, zone-style: \"generic-short\") \\\n#icu.fmt(dt, ..opts, zone-style: \"localized-offset-short\", locale: \"lv\") \\\n#icu.fmt(dt, ..opts, zone-style: \"exemplar-city\", locale: \"en-CA-u-hc-h23-ca-buddhist\")\n```\n\n\u003c!--\n- create a symlink at typst/icu-datetime.wasm to target/wasm32-unknown-unknown/debug/icu_typ.wasm\n  PowerShell (from the project root):\n    new-item -ItemType SymbolicLink typst/icu-datetime.wasm -Target ../target/wasm32-unknown-unknown/debug/icu_typ.wasm\n\n- typst c res/example.typ res/example.png --root .\n --\u003e\n\n![Example](res/example.png)\n\nLocales must be [Unicode Locale Identifier]s.\nUse [`locale-info(locale)`](https://nerixyz.github.io/icu-typ/locale-info/) to get information on how a locale is parsed.\nUnicode extensions are supported, so you can, for example, set the hour cycle with `hc-h12` or set the calendar with `ca-buddhist` (e.g. `en-CA-u-hc-h24-ca-buddhist`).\n\n## Documentation\n\nDocumentation can be found on [nerixyz.github.io/icu-typ](https://nerixyz.github.io/icu-typ).\n\n## Using Locally\n\nDownload the [latest release](https://github.com/Nerixyz/icu-typ/releases), unzip it to your [local Typst packages](https://github.com/typst/packages#local-packages), and use `#import \"@local/icu-datetime:0.2.0\"`.\n\n## Building\n\nTo build the library, you need to have [Rust](https://www.rust-lang.org/), [just](https://just.systems/), and [`wasm-opt`](https://github.com/WebAssembly/binaryen) installed.\n\n```sh\njust build\n# to deploy the package locally, use `just deploy`\n```\n\n`just example` will build the example and symlink the release artifact to `typst/icu-datetime.wasm`.\n\n[Unicode Locale Identifier]: https://unicode.org/reports/tr35/tr35.html#Unicode_locale_identifier\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerixyz%2Ficu-typ","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerixyz%2Ficu-typ","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerixyz%2Ficu-typ/lists"}