{"id":15412972,"url":"https://github.com/ascorbic/localized-time","last_synced_at":"2025-04-19T11:36:10.094Z","repository":{"id":42839655,"uuid":"263874777","full_name":"ascorbic/localized-time","owner":"ascorbic","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-06T05:52:38.000Z","size":1469,"stargazers_count":4,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T07:22:16.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ascorbic.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-14T09:43:18.000Z","updated_at":"2023-05-12T05:28:38.000Z","dependencies_parsed_at":"2023-02-05T11:31:59.921Z","dependency_job_id":null,"html_url":"https://github.com/ascorbic/localized-time","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/ascorbic%2Flocalized-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascorbic%2Flocalized-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascorbic%2Flocalized-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascorbic%2Flocalized-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ascorbic","download_url":"https://codeload.github.com/ascorbic/localized-time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249685197,"owners_count":21310564,"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":"2024-10-01T16:54:56.888Z","updated_at":"2025-04-19T11:36:10.062Z","avatar_url":"https://github.com/ascorbic.png","language":"TypeScript","readme":"# react-localized-time\n\nThis is a component to display time translated to the user's timezone.\n\n[Try it out](https://codesandbox.io/s/react-localized-time-id0rz)\n\nAt its simplest, you can use it like this:\n\n```jsx\nimport { LocalizedTime } from \"react-localized-time\";\n\n//...\n\n\u003cp\u003e\n  Gatsby Days starts at{\" \"}\n  \u003cLocalizedTime dateTime=\"1 June 2020 09:00 PST\"\u003e9am PST\u003c/LocalizedTime\u003e\n\u003c/p\u003e;\n```\n\nOr a more complicated version:\n\n```jsx\n\u003cp\u003e\n  Gatsby Days começa às{\" \"}\n  \u003cLocalizedTime\n    dateTime=\"2020-06-01T18:00:00.000Z\"\n    append={false}\n    locale=\"pt-PT\"\n    options={{ timeZoneName: \"long\" }}\n  /\u003e\n\u003c/p\u003e\n```\n\nThe `dateTime` prop accepts any text that can be parsed by [the `Date` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date#Syntax). (These formats are RFC 2822 and ISO8601).\n\nThe component renders the `dateTime` value, translated into the user's timezone and locale. By default the value is appended to the existing content of the tag, separated by \" / \", so the example above would render as \"Gatsby Days starts at 9am PST / 18:00 BST\" in the UK.\n\n## Props\n\nThe component renders a [`\u003ctime\u003e` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time), and accepts and passes-through any valid `\u003ctime\u003e` props.\n\n### `dateTime`: `boolean`\n\nA date/time string in RFC 2822 or ISO8601 format. It must include a date as well as time so that it can calculate daylight saving time.\n\n### `append`?: `boolean`\n\nWhether the value should be appended to the existing content of the tag. Default: `true`\n\n### `options?:`Intl.DateTimeFormatOptions`\n\nOptions that are passed to the formatter. For valid options see [DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format#Syntax).\n\nDefault:\n\n```js\n{\n  hour: \"numeric\",\n  minute: \"numeric\",\n  timeZoneName: \"short\",\n}\n```\n\n### `locale`?: `string`\n\ne.g. `\"en-US\"`. You may specify a locale for the display, or leave as undefined which will use the user's locale. This does not affect the timezone, just the format and the language used for timezone names. \n\n### `separator`?: `string`\n\nIf you are using the `append` option, this is the string that will be used to separate the two times. Default: `\" / \"`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascorbic%2Flocalized-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fascorbic%2Flocalized-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascorbic%2Flocalized-time/lists"}