{"id":18051584,"url":"https://github.com/sinclairnick/dateformat-ts","last_synced_at":"2025-04-05T07:12:30.010Z","repository":{"id":243618181,"uuid":"812919099","full_name":"sinclairnick/dateformat-ts","owner":"sinclairnick","description":"A type-level implementation of date.format()","archived":false,"fork":false,"pushed_at":"2024-06-10T06:53:47.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T14:52:51.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/sinclairnick.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-10T06:46:44.000Z","updated_at":"2024-07-27T08:47:16.000Z","dependencies_parsed_at":"2024-06-10T08:49:35.760Z","dependency_job_id":"1e9bfe87-8dcc-40be-87c6-cfefaa986ce9","html_url":"https://github.com/sinclairnick/dateformat-ts","commit_stats":null,"previous_names":["sinclairnick/dateformat-ts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinclairnick%2Fdateformat-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinclairnick%2Fdateformat-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinclairnick%2Fdateformat-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinclairnick%2Fdateformat-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinclairnick","download_url":"https://codeload.github.com/sinclairnick/dateformat-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299850,"owners_count":20916193,"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-30T22:50:05.354Z","updated_at":"2025-04-05T07:12:29.980Z","avatar_url":"https://github.com/sinclairnick.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DateFormat TS\n\n**Format date information at the type-level, according to the [Unicode #35 standard](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table)**\n\n---\n\n```ts\n// Init date\ntype Date = FromIso\u003c\"2024-06-10T04:39:46.229Z\"\u003e;\n\n// Format date\ntype Formatted = Format\u003cDate, \"dd-MM-yy H:mm:ss aa\"\u003e;\n//   ^? 10-06-24 4:39:46 AM\n```\n\n\u003e This is just a toy project, it's probably not super useful in production\n\n## Usage\n\nGiven a `DateObject`\n\n```ts\nexport type DateObject = {\n    dayOfMonth: number;\n    dayOfYear: number;\n    dayOfWeek: number;\n    monthOfYear: number;\n    hourOfDay: number;\n    minuteOfHour: number;\n    secondOfMinute: number;\n    year: number;\n};\n```\n\nWe can format the date information given a format string.\n\n```ts\ntype FormattedDate = Format\u003cSomeDateObject, \"some-format-string\"\u003e;\n```\n\n## Limitations\n\n-   Not all format parts implemented, like ISO and locale-stuff\n-   No input validation is done\n-   Escaping syntax is not respected (not implemented yet)\n-   `FromIso` does _not_ produce `dayOfYear` or `dayOfWeek` information\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinclairnick%2Fdateformat-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinclairnick%2Fdateformat-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinclairnick%2Fdateformat-ts/lists"}