{"id":16153883,"url":"https://github.com/hinto-janai/nichi","last_synced_at":"2025-10-28T06:30:47.523Z","repository":{"id":201102760,"uuid":"706981010","full_name":"hinto-janai/nichi","owner":"hinto-janai","description":"Date library","archived":false,"fork":false,"pushed_at":"2023-12-15T20:19:35.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T12:18:17.218Z","etag":null,"topics":["date","rust","weekday"],"latest_commit_sha":null,"homepage":"https://docs.rs/nichi","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/hinto-janai.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-19T01:41:26.000Z","updated_at":"2023-10-19T01:51:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"72d53feb-b63d-4e68-929d-a3a1264ef4f8","html_url":"https://github.com/hinto-janai/nichi","commit_stats":null,"previous_names":["hinto-janai/nichi"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hinto-janai%2Fnichi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hinto-janai%2Fnichi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hinto-janai%2Fnichi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hinto-janai%2Fnichi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hinto-janai","download_url":"https://codeload.github.com/hinto-janai/nichi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238603662,"owners_count":19499490,"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":["date","rust","weekday"],"created_at":"2024-10-10T01:14:49.381Z","updated_at":"2025-10-28T06:30:42.247Z","avatar_url":"https://github.com/hinto-janai.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `nichi`\n[![CI](https://github.com/hinto-janai/nichi/actions/workflows/ci.yml/badge.svg)](https://github.com/hinto-janai/nichi/actions/workflows/ci.yml) [![crates.io](https://img.shields.io/crates/v/nichi.svg)](https://crates.io/crates/nichi) [![docs.rs](https://docs.rs/nichi/badge.svg)](https://docs.rs/nichi)\n\nDate library.\n\n## PartialEq\n```rust\nuse nichi::*;\n\n// PartialEq.\nlet date1 = Date::new(2000, 12, 25);\nlet date2 = Date::new_typed(\n\tYear(2000),\n\tMonth::December,\n\tDay::TwentyFifth,\n);\n\nassert_eq!(date1, date2);\n```\n\n## Weekday calculation\n```rust\nuse nichi::*;\n\n// Christmas in 2000 was on a Monday.\nassert_eq!(Date::new(2000, 12, 25).weekday(), Weekday::Monday);\n```\n\n## Unix calculation\n```rust\n# use nichi::*;\nlet date = Date::new(2023, 10, 20);\nassert_eq!(date.as_unix(), 1697760000);\nassert_eq!(date, Date::from_unix(date.as_unix()));\n```\n\n## String parsing\n```rust\nuse nichi::*;\n\nassert_eq!(Day::from_str(\"1st\").unwrap(),   Day::First);\nassert_eq!(Day::from_str(\"first\").unwrap(), Day::First);\nassert_eq!(Day::from_str(\"FIRST\").unwrap(), Day::First);\nassert_eq!(Day::from_str(\"10TH\").unwrap(),  Day::Tenth);\nassert_eq!(Day::from_str(\"tenth\").unwrap(), Day::Tenth);\nassert_eq!(Day::from_str(\"Tenth\").unwrap(), Day::Tenth);\n\nassert_eq!(Weekday::from_str(\"Tuesday\").unwrap(),   Weekday::Tuesday);\nassert_eq!(Weekday::from_str(\"wed\").unwrap(),       Weekday::Wednesday);\nassert_eq!(Weekday::from_str(\"WEDNESDAY\").unwrap(), Weekday::Wednesday);\nassert_eq!(Weekday::from_str(\"Wednesday\").unwrap(), Weekday::Wednesday);\nassert_eq!(Weekday::from_str(\"THURS\").unwrap(),     Weekday::Thursday);\nassert_eq!(Weekday::from_str(\"thurs\").unwrap(),     Weekday::Thursday);\nassert_eq!(Weekday::from_str(\"THUR\").unwrap(),      Weekday::Thursday);\nassert_eq!(Weekday::from_str(\"thursday\").unwrap(),  Weekday::Thursday);\n\nassert_eq!(Month::from_str(\"January\").unwrap(),   Month::January);\nassert_eq!(Month::from_str(\"February\").unwrap(),  Month::February);\nassert_eq!(Month::from_str(\"FEBRUARY\").unwrap(),  Month::February);\nassert_eq!(Month::from_str(\"JUN\").unwrap(),       Month::June);\nassert_eq!(Month::from_str(\"July\").unwrap(),      Month::July);\nassert_eq!(Month::from_str(\"Jul\").unwrap(),       Month::July);\nassert_eq!(Month::from_str(\"NOVEMBER\").unwrap(),  Month::November);\nassert_eq!(Month::from_str(\"nov\").unwrap(),       Month::November);\nassert_eq!(Month::from_str(\"DEC\").unwrap(),       Month::December);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhinto-janai%2Fnichi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhinto-janai%2Fnichi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhinto-janai%2Fnichi/lists"}