{"id":28066184,"url":"https://github.com/mumuy/calendar","last_synced_at":"2025-05-12T14:39:00.142Z","repository":{"id":81853399,"uuid":"541019869","full_name":"mumuy/calendar","owner":"mumuy","description":"万年历组件 - 阴阳历/农历公历换算/节日/天干地支/生肖属相_Chinese lunar calendar and Gregorian calendar conversion tool","archived":false,"fork":false,"pushed_at":"2025-01-23T14:04:31.000Z","size":974,"stargazers_count":118,"open_issues_count":0,"forks_count":23,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T14:38:48.463Z","etag":null,"topics":["calendar","lunar","solar","web-components"],"latest_commit_sha":null,"homepage":"https://passer-by.com/calendar/","language":"HTML","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/mumuy.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":"2022-09-25T01:47:49.000Z","updated_at":"2025-05-08T02:38:02.000Z","dependencies_parsed_at":"2024-01-11T01:10:17.875Z","dependency_job_id":"1d708eff-979b-466a-a980-bdaaba2d89cf","html_url":"https://github.com/mumuy/calendar","commit_stats":{"total_commits":81,"total_committers":2,"mean_commits":40.5,"dds":"0.41975308641975306","last_synced_commit":"d2086999612e17f3b0db4f789cedc0df5bbc3934"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumuy%2Fcalendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumuy%2Fcalendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumuy%2Fcalendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumuy%2Fcalendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mumuy","download_url":"https://codeload.github.com/mumuy/calendar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253755922,"owners_count":21959115,"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":["calendar","lunar","solar","web-components"],"created_at":"2025-05-12T14:38:59.300Z","updated_at":"2025-05-12T14:39:00.127Z","avatar_url":"https://github.com/mumuy.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 中国农历公历换算算法\n\n## 参考标准\n\n算法根据《中华人民共和国国家标准GB/T33661—2017〈农历的编算和颁行〉》标准开发，明确了干支纪年和生肖纪年起于正月初一0点，与农历新年同步。\n\n## 网页组件\n```html\n\u003cwidget-calendar date=\"2023-01-01\"\u003e\u003c/widget-calendar\u003e\n```\n\n```html\n\u003cwidget-calendar\u003e\n    \u003cdiv slot=\"item\"\u003e\n        \u003cp\u003e双鱼座\u003c/p\u003e\n    \u003c/div\u003e    \n\u003c/widget-calendar\u003e\n```\n\n#### 自定义事件-选中日期: onSelect\n\n```js\ndocument.querySelector('widget-calendar').addEventListener('onSelect',function(event){\n}\n```\n\n#### 自定义事件-切换日期: onChange\n\n```js\ndocument.querySelector('widget-calendar').addEventListener('onChange',function(event){\n}\n```\n\n#### 自定义事件-初始化: onInit\n\n```js\ndocument.querySelector('widget-calendar').addEventListener('onInit',function(event){\n}\n```\n\n## 方法调用\n\n```js\n// 农历日期: 2023年闰二月初十\ncalendar.getDateByLunar(2023,2,10,true);\n\n// 公历日期：2022年10月1日\ncalendar.getDateBySolar(2022,10,1);\n\n// 今天\ncalendar.getToday();\n```\n\n## 返回结果\n\n```js\n{\n    \"date\":'2022-10-01',\n    \"sYear\":2022,\n    \"sMonth\":10,\n    \"sDay\":1,\n    \"lYear\":2022,\n    \"lMonth\":9,\n    \"lDay\":6,\n    \"isLeap\":false,\n    \"lMonthZH\":\"九月\",\n    \"lDayZH\":\"初六\",\n    \"gzYearZH\":\"壬寅\",\n    \"gzMonthZH\":\"己酉\",\n    \"gzDayZH\":\"丁亥\",\n    \"week\":6,\n    \"weekZH\":\"星期六\",\n    \"animal\":\"虎\",\n    \"term\":\"\",\n    \"zodiac\":\"天秤座\",\n    \"festival\":\"国庆节\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumuy%2Fcalendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmumuy%2Fcalendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumuy%2Fcalendar/lists"}