├── .gitignore ├── .obsidian ├── app.json ├── appearance.json ├── community-plugins.json ├── core-plugins-migration.json ├── core-plugins.json ├── graph.json ├── plugins │ └── components │ │ ├── data.json │ │ ├── main.js │ │ ├── manifest.json │ │ └── styles.css └── workspace.json ├── Birthday ├── 张三.md ├── 张飞.md ├── 成龙.md ├── 李四.md ├── 李雷.md ├── 杨沫.md ├── 王五.md ├── 赵六.md └── 赵虎.md ├── LICENSE ├── README.md ├── Resources ├── components │ ├── basic │ │ └── 生日簿.components │ └── scripts │ │ └── calculateNextBirthdayDates.js ├── image │ ├── 3.0-preview.png │ ├── advanced.png │ ├── download.gif │ ├── setting.png │ └── usage.gif └── template │ └── 生日数据模板.md └── 生日管理.md /.gitignore: -------------------------------------------------------------------------------- 1 | .obsidian/plugins/components/data.json 2 | .vscode -------------------------------------------------------------------------------- /.obsidian/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "alwaysUpdateLinks": true, 3 | "showUnsupportedFiles": true, 4 | "useMarkdownLinks": true, 5 | "newLinkFormat": "absolute", 6 | "promptDelete": false, 7 | "readableLineLength": false 8 | } -------------------------------------------------------------------------------- /.obsidian/appearance.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.obsidian/community-plugins.json: -------------------------------------------------------------------------------- 1 | [ 2 | "components" 3 | ] -------------------------------------------------------------------------------- /.obsidian/core-plugins-migration.json: -------------------------------------------------------------------------------- 1 | { 2 | "file-explorer": true, 3 | "global-search": true, 4 | "switcher": true, 5 | "graph": true, 6 | "backlink": true, 7 | "canvas": true, 8 | "outgoing-link": true, 9 | "tag-pane": true, 10 | "properties": false, 11 | "page-preview": true, 12 | "daily-notes": true, 13 | "templates": true, 14 | "note-composer": true, 15 | "command-palette": true, 16 | "slash-command": false, 17 | "editor-status": true, 18 | "bookmarks": true, 19 | "markdown-importer": false, 20 | "zk-prefixer": false, 21 | "random-note": false, 22 | "outline": true, 23 | "word-count": true, 24 | "slides": false, 25 | "audio-recorder": false, 26 | "workspaces": false, 27 | "file-recovery": true, 28 | "publish": false, 29 | "sync": false 30 | } -------------------------------------------------------------------------------- /.obsidian/core-plugins.json: -------------------------------------------------------------------------------- 1 | { 2 | "file-explorer": true, 3 | "global-search": true, 4 | "switcher": true, 5 | "graph": true, 6 | "backlink": true, 7 | "canvas": true, 8 | "outgoing-link": true, 9 | "tag-pane": true, 10 | "properties": false, 11 | "page-preview": true, 12 | "daily-notes": true, 13 | "templates": true, 14 | "note-composer": true, 15 | "command-palette": true, 16 | "slash-command": false, 17 | "editor-status": true, 18 | "bookmarks": true, 19 | "markdown-importer": false, 20 | "zk-prefixer": false, 21 | "random-note": false, 22 | "outline": true, 23 | "word-count": true, 24 | "slides": false, 25 | "audio-recorder": false, 26 | "workspaces": false, 27 | "file-recovery": true, 28 | "publish": false, 29 | "sync": false 30 | } -------------------------------------------------------------------------------- /.obsidian/graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "collapse-filter": true, 3 | "search": "", 4 | "showTags": false, 5 | "showAttachments": false, 6 | "hideUnresolved": false, 7 | "showOrphans": true, 8 | "collapse-color-groups": true, 9 | "colorGroups": [], 10 | "collapse-display": true, 11 | "showArrow": false, 12 | "textFadeMultiplier": 0, 13 | "nodeSizeMultiplier": 1, 14 | "lineSizeMultiplier": 1, 15 | "collapse-forces": true, 16 | "centerStrength": 0.518713248970312, 17 | "repelStrength": 10, 18 | "linkStrength": 1, 19 | "linkDistance": 250, 20 | "scale": 1, 21 | "close": true 22 | } -------------------------------------------------------------------------------- /.obsidian/plugins/components/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "folder": "Resources/components/basic", 3 | "createComponentSilent": false, 4 | "scriptFolder": "Resources/components/scripts", 5 | "DEFAULT_SETTINGS": { 6 | "folder": "", 7 | "createComponentSilent": false, 8 | "scriptFolder": "components/scripts" 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /.obsidian/plugins/components/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "components", 3 | "name": "Components", 4 | "version": "1.10.1", 5 | "minAppVersion": "0.14.0", 6 | "description": "create component for your obsidian", 7 | "author": "vran", 8 | "authorUrl": "https://github.com/vran-dev", 9 | "isDesktopOnly": false, 10 | "fundingUrl": "https://www.buymeacoffee.com/vran" 11 | } -------------------------------------------------------------------------------- /.obsidian/workspace.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": { 3 | "id": "efb0b9916899ac45", 4 | "type": "split", 5 | "children": [ 6 | { 7 | "id": "7b7549cd484d3f03", 8 | "type": "tabs", 9 | "children": [ 10 | { 11 | "id": "b6e28841ece42d6f", 12 | "type": "leaf", 13 | "state": { 14 | "type": "markdown", 15 | "state": { 16 | "file": "README.md", 17 | "mode": "source", 18 | "source": false 19 | }, 20 | "icon": "lucide-file", 21 | "title": "README" 22 | } 23 | } 24 | ] 25 | } 26 | ], 27 | "direction": "vertical" 28 | }, 29 | "left": { 30 | "id": "06978abcf01c5641", 31 | "type": "split", 32 | "children": [ 33 | { 34 | "id": "65ce3a2b87aacb29", 35 | "type": "tabs", 36 | "children": [ 37 | { 38 | "id": "453fb9d54277f430", 39 | "type": "leaf", 40 | "state": { 41 | "type": "file-explorer", 42 | "state": { 43 | "sortOrder": "alphabetical" 44 | }, 45 | "icon": "lucide-folder-closed", 46 | "title": "文件列表" 47 | } 48 | }, 49 | { 50 | "id": "a65b5cbaee4d4fdf", 51 | "type": "leaf", 52 | "state": { 53 | "type": "search", 54 | "state": { 55 | "query": "", 56 | "matchingCase": false, 57 | "explainSearch": false, 58 | "collapseAll": false, 59 | "extraContext": false, 60 | "sortOrder": "alphabetical" 61 | }, 62 | "icon": "lucide-search", 63 | "title": "搜索" 64 | } 65 | }, 66 | { 67 | "id": "659f30fe22f4f003", 68 | "type": "leaf", 69 | "state": { 70 | "type": "bookmarks", 71 | "state": {}, 72 | "icon": "lucide-bookmark", 73 | "title": "书签" 74 | } 75 | } 76 | ] 77 | } 78 | ], 79 | "direction": "horizontal", 80 | "width": 249.5 81 | }, 82 | "right": { 83 | "id": "4cf275b64dfc087a", 84 | "type": "split", 85 | "children": [ 86 | { 87 | "id": "e5f417349b6b7621", 88 | "type": "tabs", 89 | "children": [ 90 | { 91 | "id": "b60fb0c5cb7f2869", 92 | "type": "leaf", 93 | "state": { 94 | "type": "backlink", 95 | "state": { 96 | "collapseAll": false, 97 | "extraContext": false, 98 | "sortOrder": "alphabetical", 99 | "showSearch": false, 100 | "searchQuery": "", 101 | "backlinkCollapsed": false, 102 | "unlinkedCollapsed": true 103 | }, 104 | "icon": "links-coming-in", 105 | "title": "反向链接" 106 | } 107 | }, 108 | { 109 | "id": "08d20c840f3f12ae", 110 | "type": "leaf", 111 | "state": { 112 | "type": "outgoing-link", 113 | "state": { 114 | "linksCollapsed": false, 115 | "unlinkedCollapsed": true 116 | }, 117 | "icon": "links-going-out", 118 | "title": "出链" 119 | } 120 | }, 121 | { 122 | "id": "f95b5464ccc6f6f9", 123 | "type": "leaf", 124 | "state": { 125 | "type": "tag", 126 | "state": { 127 | "sortOrder": "frequency", 128 | "useHierarchy": true 129 | }, 130 | "icon": "lucide-tags", 131 | "title": "标签" 132 | } 133 | }, 134 | { 135 | "id": "daa4fdc338ae3361", 136 | "type": "leaf", 137 | "state": { 138 | "type": "outline", 139 | "state": {}, 140 | "icon": "lucide-list", 141 | "title": "大纲" 142 | } 143 | } 144 | ] 145 | } 146 | ], 147 | "direction": "horizontal", 148 | "width": 300, 149 | "collapsed": true 150 | }, 151 | "left-ribbon": { 152 | "hiddenItems": { 153 | "switcher:打开快速切换": false, 154 | "graph:查看关系图谱": false, 155 | "canvas:新建白板": false, 156 | "daily-notes:打开/创建今天的日记": false, 157 | "templates:插入模板": false, 158 | "command-palette:打开命令面板": false 159 | } 160 | }, 161 | "active": "453fb9d54277f430", 162 | "lastOpenFiles": [ 163 | "Resources/image/advanced.png", 164 | "生日管理.md", 165 | "README.md", 166 | "Resources/image/download.gif", 167 | "Resources/image/3.0-preview.png", 168 | "Resources/image/setting.png", 169 | "attachment/README-Clip_2024-11-02_19-18-14.png", 170 | "attachment", 171 | "Resources/components/basic/生日簿.components", 172 | "Birthday/20241020231300 .md", 173 | "Birthday/20241020231148 .md", 174 | "Birthday/赵虎.md", 175 | "Birthday/杨沫.md", 176 | "Birthday/李雷.md", 177 | "Birthday/成龙.md", 178 | "Birthday/张飞.md", 179 | "Birthday/赵六.md", 180 | "Birthday/王五.md", 181 | "Birthday/李四.md", 182 | "Birthday/张三.md", 183 | "Birthday/李四.md", 184 | "Birthday/张三.md", 185 | "Resources/components/basic/生日管理簿.components", 186 | "未命名", 187 | "Resources/image/Clip_2024-10-12_21-23-08.png", 188 | "Birthday-Manager.zip", 189 | "Resources/image/usage.gif", 190 | "Birthday/王五.md", 191 | "Birthday/张三.md", 192 | "Birthday/张三.md", 193 | "Birthday/张三.md", 194 | "Resources/image/d113f21299cb936f4ddf10e5882310a 1.png", 195 | "Resources/image/011d63e1b4f5dfd414d666d49a3786c.png", 196 | "Resources/template/生日数据模板.md", 197 | "Birthday/该机.md", 198 | "Birthday/赵六.md", 199 | "Birthday/利好.md", 200 | "d113f21299cb936f4ddf10e5882310a.png", 201 | "Resources/image/README-7b22783fbb6ae14b58b3a1ea72bfb8b.png", 202 | "Resources/image", 203 | "Birthday/廉颇.md", 204 | "Birthday/赵云.md", 205 | "Resources/components/scripts/calculateNextBirthdayDates.js", 206 | "Resources/components/scripts/getDaysUntilNextBirthday.js", 207 | "Resources/template", 208 | "Resources" 209 | ] 210 | } -------------------------------------------------------------------------------- /Birthday/张三.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 1999-09-09 3 | birthdayLunar: 一九九九年七月三十 4 | birthdayType: 公历 5 | nextBirthday: 2025-09-09 6 | nextBirthdayString: |- 7 |
8 | 公历:2025-09-09 9 | 农历:二〇二五年七月十八 10 |
11 | animal: 己卯年 兔 12 | zodiac: 处女座 13 | --- 14 | -------------------------------------------------------------------------------- /Birthday/张飞.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 2024-03-09 3 | birthdayLunar: 二零二四年正月廿九 4 | birthdayType: 农历 5 | nextBirthday: 2025-02-26 6 | nextBirthdayString: |- 7 |
8 | 公历:2025-02-26 9 | 农历:二〇二五年正月廿九 10 |
11 | animal: 甲辰年 龙 12 | zodiac: 双鱼座 13 | --- 14 | -------------------------------------------------------------------------------- /Birthday/成龙.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 1997-11-02 3 | birthdayLunar: 一九九七年十月初三 4 | birthdayType: 公历 5 | nextBirthday: 2025-11-02 6 | nextBirthdayString: |- 7 |
8 | 公历:2025-11-02 9 | 农历:二〇二五年九月十三 10 |
11 | animal: 丁丑年 牛 12 | zodiac: 天蝎座 13 | --- 14 | -------------------------------------------------------------------------------- /Birthday/李四.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 2022-03-01 3 | birthdayLunar: 二零二二年正月廿九 4 | birthdayType: 农历 5 | nextBirthday: 2025-02-26 6 | nextBirthdayString: |- 7 |
8 | 公历:2025-02-26 9 | 农历:二〇二五年正月廿九 10 |
11 | animal: 壬寅年 虎 12 | zodiac: 双鱼座 13 | --- 14 | -------------------------------------------------------------------------------- /Birthday/李雷.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 1998-07-09 3 | birthdayLunar: 一九九八年闰五月十六 4 | nextBirthday: 2025-06-11 5 | birthdayType: 农历 6 | nextBirthdayString: |- 7 |
8 | 公历:2025-06-11 9 | 农历:二〇二五年五月十六 10 |
11 | animal: 戊寅年 虎 12 | zodiac: 巨蟹座 13 | --- 14 | -------------------------------------------------------------------------------- /Birthday/杨沫.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 2012-10-01 3 | birthdayLunar: 二〇一二年八月十六 4 | birthdayType: 公历 5 | nextBirthday: 2025-10-01 6 | nextBirthdayString: |- 7 |
8 | 公历:2025-10-01 9 | 农历:二〇二五年八月初十 10 |
11 | animal: 壬辰年 龙 12 | zodiac: 天秤座 13 | --- 14 | -------------------------------------------------------------------------------- /Birthday/王五.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 2001-10-25 3 | birthdayLunar: 二〇〇一年九月初九 4 | birthdayType: 农历 5 | nextBirthday: 2025-10-29 6 | nextBirthdayString: |- 7 |
8 | 公历:2025-10-29 9 | 农历:二〇二五年九月初九 10 |
11 | animal: 辛巳年 蛇 12 | zodiac: 天蝎座 13 | --- 14 | -------------------------------------------------------------------------------- /Birthday/赵六.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 2001-12-23 3 | birthdayLunar: 二〇〇一年冬月初九 4 | birthdayType: 农历 5 | nextBirthday: 2024-12-09 6 | nextBirthdayString: |- 7 |
8 | 公历:2024-12-09 9 | 农历:二〇二四年冬月初九 10 |
11 | animal: 辛巳年 蛇 12 | zodiac: 摩羯座 13 | --- 14 | -------------------------------------------------------------------------------- /Birthday/赵虎.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 2000-02-05 3 | birthdayLunar: 一九九九年腊月三十 4 | nextBirthday: 2025-01-28 5 | birthdayType: 农历 6 | nextBirthdayString: |- 7 |
8 | 公历:2025-01-28 9 | 农历:二〇二四年腊月廿九 10 |
11 | animal: 己卯年 兔 12 | zodiac: 水瓶座 13 | --- 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 生日管理器 2 | 本库使用[components](https://cp.cc1234.cc/)插件探讨管理生日的可能方案。 3 | ![](Resources/image/3.0-preview.png) 4 | 5 | 可以管理农历生日与公历生日 6 | 7 | ### 前情提要 8 | components插件为付费插件,需要购买激活后才能使用本库。 9 | 10 | 因激活密钥隐私,本库未上传data.json文件,需重新激活。 11 | 12 | 脚本目录需要设置为`Resources/components/scripts` 13 | 14 | ![](Resources/image/setting.png) 15 | 16 | ## 介绍 17 | ### 文档属性 18 | - birthdaySolar:公历生日,格式为 "YYYY-MM-DD",如2004-12-21 19 | - birthdayLunar:农历生日,格式为 "YYYY年MM月DD日",全中文,如二〇〇四年腊月廿一 20 | - birthdayType:生日类型,有两种选择:"Lunar"、"Solar"(或"农历"、"公历"),默认为"Solar"("公历") 21 | - nextBirthday:下个生日(公历日期),脚本自动计算 22 | - nextBirthdayString:下个生日(包含显示农历日期),脚本自动计算,用于展示的另一种格式 23 | - animal:生肖,由农历生日决定,脚本自动计算,会包含的干支纪年 24 | - zodiac:星座,由公历生日决定,脚本自动计算 25 | 26 | ### 映射表 27 | - 农历年份:['〇','一','二','三','四','五','六','七','八','九'] 28 | - 对于〇,打不出也可以输入零 29 | - 农历月份:['正','二','三','四','五','六','七','八','九','十','冬','腊'] 30 | - 需要注意,一月为正月,十一月为冬月,十二月为腊月 31 | - 农历日:['初一','初二','初三','初四','初五','初六','初七','初八','初九','初十','十一','十二','十三','十四','十五','十六','十七','十八','十九','二十','廿一','廿二','廿三','廿四','廿五','廿六','廿七','廿八','廿九','三十'] 32 | - 二十是廿,拼音为nian 33 | 34 | ## 使用方法 35 | 选择生日类型,并输入对应类型的生日,脚本将自动计算下个生日、生肖、星座等信息。 36 | 37 | ![](Resources/image/usage.gif) 38 | 39 | [演示视频](https://www.bilibili.com/video/BV1MpyeYwEdq/) 40 | 41 | ### 高级用法 42 | ![](Resources/image/advanced.png) 43 | 44 | ## 如何下载 45 | 点击右上角的"Code"按钮,选择"Download ZIP"下载压缩包。 46 | 47 | ![](Resources/image/download.gif) 48 | 49 | ## 鸣谢 50 | - [中国农历公历换算算法](https://github.com/mumuy/calendar) 51 | - [components](https://cp.cc1234.cc/) 52 | -------------------------------------------------------------------------------- /Resources/components/basic/生日簿.components: -------------------------------------------------------------------------------- 1 | { 2 | "components": [ 3 | { 4 | "id": "9fc3d95d-dac9-446b-8ad6-7c3646cb855b", 5 | "type": "multi", 6 | "titleAlign": "center", 7 | "tabTitle": "", 8 | "maxWidthRatio": -1, 9 | "showBorder": true, 10 | "showShadow": false, 11 | "createAt": "2024-10-10T12:45:57.238Z", 12 | "updateAt": "2024-10-10T12:45:57.240Z", 13 | "components": [ 14 | { 15 | "componentId": "a1e3c7d2-133f-4f5f-a3d8-e004b1c66166" 16 | } 17 | ], 18 | "layoutType": "tab" 19 | }, 20 | { 21 | "id": "a1e3c7d2-133f-4f5f-a3d8-e004b1c66166", 22 | "type": "dynamicDataView", 23 | "titleAlign": "center", 24 | "tabTitle": "生日簿", 25 | "maxWidthRatio": -1, 26 | "showBorder": false, 27 | "showShadow": false, 28 | "createAt": "2024-10-10T12:46:40.515Z", 29 | "updateAt": "2024-10-10T12:46:40.515Z", 30 | "viewType": "table", 31 | "newPageNameFormat": "{{date: YYYYMMDDHHmmss}}", 32 | "properties": [ 33 | { 34 | "id": "__componentsTitleProperty_0x7c00", 35 | "name": "文件名", 36 | "type": "text", 37 | "isShow": true, 38 | "wrap": false, 39 | "options": { 40 | "width": "115" 41 | }, 42 | "alias": "名称" 43 | }, 44 | { 45 | "id": "3f0ca0ed-1a0a-4401-a803-1b756d2d4e56", 46 | "name": "birthdaySolar", 47 | "isShow": true, 48 | "type": "text", 49 | "options": { 50 | "width": "100" 51 | }, 52 | "alias": "公历生日" 53 | }, 54 | { 55 | "id": "6da1c17b-8c12-41cc-9d15-f76d6fdb491e", 56 | "name": "birthdayLunar", 57 | "isShow": true, 58 | "type": "text", 59 | "options": { 60 | "width": "168" 61 | }, 62 | "alias": "农历生日" 63 | }, 64 | { 65 | "id": "c55ea5c2-d5d5-47a4-8865-dd79cc0fdb34", 66 | "name": "animal", 67 | "isShow": true, 68 | "type": "select", 69 | "options": { 70 | "width": "100" 71 | }, 72 | "alias": "生肖" 73 | }, 74 | { 75 | "id": "67e933b2-5739-4d70-b80b-784acd23de16", 76 | "name": "zodiac", 77 | "isShow": true, 78 | "type": "select", 79 | "options": { 80 | "width": "84" 81 | }, 82 | "alias": "星座" 83 | }, 84 | { 85 | "id": "ec04f178-a2c6-4ee0-9770-6fb8c9e1ff80", 86 | "name": "birthdayType", 87 | "isShow": true, 88 | "type": "select", 89 | "options": { 90 | "items": [ 91 | { 92 | "id": "b7cba443-946c-4ff4-a39e-6169c97c9d34", 93 | "value": "公历", 94 | "color": "components--color-pink" 95 | }, 96 | { 97 | "id": "9dee4f3a-1aaf-4030-95b8-fe559ace56a6", 98 | "value": "农历", 99 | "color": "components--color-gray" 100 | }, 101 | { 102 | "id": "b6873507-1804-470d-9169-fe17b66b8e56", 103 | "value": "Solar", 104 | "color": "components--color-light-gray" 105 | }, 106 | { 107 | "id": "c5e133d9-2b9b-482f-98d2-20f0015d2b0d", 108 | "value": "Lunar", 109 | "color": "components--color-gray" 110 | } 111 | ], 112 | "width": "73" 113 | }, 114 | "alias": "类型" 115 | }, 116 | { 117 | "id": "87dae5b2-ba69-4c8e-b432-1262f257bcd6", 118 | "name": "nextBirthdayString", 119 | "isShow": true, 120 | "type": "markdown", 121 | "options": { 122 | "width": "201" 123 | }, 124 | "alias": "下次生日", 125 | "wrap": true 126 | }, 127 | { 128 | "id": "82750612-fb54-4c84-86b6-fa321d2a4f1b", 129 | "name": "nextBirthday", 130 | "isShow": false, 131 | "type": "text", 132 | "options": { 133 | "width": "123" 134 | }, 135 | "alias": "下次生日" 136 | }, 137 | { 138 | "id": "c31961bb-df30-45c9-8423-dd5529720470", 139 | "name": "nextBirthdayDates", 140 | "isShow": true, 141 | "type": "formula", 142 | "options": { 143 | "formula": "calculateNextBirthdayDates()", 144 | "width": "157" 145 | }, 146 | "alias": "距离", 147 | "wrap": false 148 | } 149 | ], 150 | "templates": [ 151 | { 152 | "id": "ba9a85ac-b75a-4074-b765-520c33992d58", 153 | "path": "Resources/template/生日数据模板.md", 154 | "name": "生日数据模板.md", 155 | "type": "normal" 156 | } 157 | ], 158 | "groups": [], 159 | "colorfulGroups": false, 160 | "viewOptions": { 161 | "openPageIn": "tab", 162 | "openPageAfterCreate": false, 163 | "itemSize": "components--page-card-medium", 164 | "showPropertyName": false, 165 | "hideFileName": false, 166 | "wrapFileName": true, 167 | "items": [], 168 | "cover": { 169 | "type": "pageContent", 170 | "value": "", 171 | "fit": "contains", 172 | "layout": "components--page-card-cover-landscape" 173 | }, 174 | "showGrid": true 175 | }, 176 | "filter": { 177 | "id": "d8151621-852e-4a3e-9865-c2228abba91a", 178 | "type": "group", 179 | "operator": "and", 180 | "conditions": [ 181 | { 182 | "id": "08063952-a166-4aa6-91a9-08812140b0ab", 183 | "type": "filter", 184 | "operator": "equals", 185 | "property": "${file.path}", 186 | "value": "Birthday", 187 | "conditions": [] 188 | } 189 | ] 190 | }, 191 | "defaultTemplate": "ba9a85ac-b75a-4074-b765-520c33992d58", 192 | "newPageLocation": { 193 | "location": "Birthday" 194 | }, 195 | "sort": { 196 | "orders": [ 197 | { 198 | "id": "f0df22fd-1c6e-4fcb-9adc-0e94aed5b888", 199 | "property": "nextBirthday", 200 | "direction": "asc" 201 | }, 202 | { 203 | "id": "2eb7f070-83f2-4c64-9d4c-37d36d1d7861", 204 | "property": "${file.basename}", 205 | "direction": "asc" 206 | } 207 | ] 208 | } 209 | } 210 | ], 211 | "rootComponentId": "9fc3d95d-dac9-446b-8ad6-7c3646cb855b" 212 | } -------------------------------------------------------------------------------- /Resources/components/scripts/calculateNextBirthdayDates.js: -------------------------------------------------------------------------------- 1 | exports.default = { 2 | entry: calculateNextBirthdayDates, 3 | scopes: ['formula'], 4 | description: ` 5 | 根据公历生日或农历生日,计算下一个生日日期。 6 | # 文档属性 7 | 你的文档需要包含以下属性: 8 | - \`birthdaySolar\`: 公历生日,格式为 "YYYY-MM-DD", 如2004-12-21 9 | - \`birthdayLunar\`: 农历生日,格式为 "YYYY年MM月DD日",全中文,如二〇〇四年腊月廿一 10 | - \`birthdayType\`: 生日类型,有 "Lunar","Solar" (或"农历","公历") 两种 11 | # 映射表 12 | - \`农历月映射表\`:['正','二','三','四','五','六','七','八','九','十','冬','腊'] 13 | - \`农历日映射表\`:['初一','初二','初三','初四','初五','初六','初七','初八','初九','初十','十一','十二','十三','十四','十五','十六','十七','十八','十九','二十','廿一','廿二','廿三','廿四','廿五','廿六','廿七','廿八','廿九','三十']; 14 | ` 15 | } 16 | 17 | // 自定义笔记属性名称,值根据实际情况修改,可以为中文 18 | const birthdaySolarProperty = "birthdaySolar"; // 公历生日 19 | const birthdayLunarProperty = "birthdayLunar"; // 农历生日 20 | const birthdayTypeProperty = "birthdayType"; // 生日类型 21 | const nextBirthdayProperty = "nextBirthday"; // 下一个生日日期, 纯日期格式 22 | const nextBirthdayStringProperty = "nextBirthdayString"; // 下一个生日日期, 有样式 23 | const animalProperty = "animal"; // 生肖 24 | const zodiacProperty = "zodiac"; // 星座 25 | 26 | // nextBirthdayStringProperty的样式显示方式,row表示横向排列,column表示纵向排列 27 | const flexDirection = "column"; 28 | const flexClass = flexDirection === "column" ? "components--flex-column" : "components--flex-row"; 29 | 30 | async function calculateNextBirthdayDates() { 31 | const file = this.currentFile; 32 | const metadata = app.metadataCache.getFileCache(file); 33 | const frontmatter = metadata?.frontmatter; 34 | 35 | let birthdaySolar = frontmatter?.[birthdaySolarProperty]; 36 | let birthdayLunar = frontmatter?.[birthdayLunarProperty]; 37 | const birthdayType = frontmatter?.[birthdayTypeProperty]; 38 | let nextBirthday; 39 | 40 | const now = new Date(); 41 | const today = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`; 42 | 43 | if(birthdaySolar && (birthdayType == "Solar" || birthdayType == "公历")){ 44 | const lunarBirthday = convertSolarToLunar(birthdaySolar, "Zh"); 45 | let [formatNextBirthday, nextLunarBirthday] = getNextSolarBirthday(birthdaySolar); 46 | let nextBirthdayString = ''; 47 | 48 | nextBirthdayString += `公历:${formatNextBirthday}\n`; 49 | nextBirthdayString += `农历:${nextLunarBirthday}`; 50 | 51 | if(isTodayBirthday(birthdaySolar, birthdayType)){ 52 | nextBirthdayString = `今天生日!\n${nextBirthdayString}`; 53 | formatNextBirthday = today; 54 | } 55 | 56 | updateFrontMatter(file, (frontmatter) => { 57 | frontmatter[birthdayLunarProperty] = lunarBirthday; 58 | frontmatter[nextBirthdayProperty] = formatNextBirthday; 59 | frontmatter[nextBirthdayStringProperty] = `
\n${nextBirthdayString}\n
`; 60 | }); 61 | } 62 | else if(birthdayLunar && (birthdayType == "Lunar" || birthdayType == "农历")){ 63 | birthdayLunar = birthdayLunar.replace(/零/g, "〇"); 64 | const solarBirthday = convertLunarToSolar(birthdayLunar, "Zh"); 65 | let [formatNextBirthday, nextLunarBirthday] = getNextLunarBirthday(birthdayLunar); 66 | let nextBirthdayString = ''; 67 | 68 | nextBirthdayString += `公历:${formatNextBirthday}\n`; 69 | nextBirthdayString += `农历:${nextLunarBirthday}`; 70 | 71 | if(isTodayBirthday(birthdayLunar, birthdayType)){ 72 | nextBirthdayString = `今天生日!\n${nextBirthdayString}`; 73 | formatNextBirthday = today; 74 | } 75 | 76 | updateFrontMatter(file, (frontmatter) => { 77 | frontmatter[birthdaySolarProperty] = solarBirthday; 78 | frontmatter[nextBirthdayProperty] = formatNextBirthday; 79 | frontmatter[nextBirthdayStringProperty] = `
\n${nextBirthdayString}\n
`; 80 | }); 81 | } 82 | else{ 83 | return "请根据生日类型填写对应生日日期"; 84 | } 85 | 86 | // 更新 87 | birthdaySolar = frontmatter?.[birthdaySolarProperty]; 88 | birthdayLunar = frontmatter?.[birthdayLunarProperty].replace(/零/g, "〇"); 89 | nextBirthday = frontmatter?.[nextBirthdayProperty]; 90 | 91 | const animal = getAnimalByLunar(birthdayLunar); 92 | const zodiac = getZodiacBySolar(birthdaySolar); 93 | 94 | updateFrontMatter(file, (frontmatter) => { 95 | frontmatter[animalProperty] = animal; 96 | frontmatter[zodiacProperty] = zodiac; 97 | }); 98 | 99 | return getDaysUntilNextBirthday(birthdaySolar, nextBirthday); 100 | } 101 | 102 | function updateFrontMatter(file, updateFrontmatterFunc) { 103 | app.fileManager.processFrontMatter(file, (frontmatter) => { 104 | updateFrontmatterFunc(frontmatter); 105 | }); 106 | } 107 | 108 | // 判断今天是否是生日 109 | function isTodayBirthday(birthdayDate, birthdayType){ 110 | const now = new Date(); 111 | const todaySolarString = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`; 112 | const todayTimestamp = getTimestampBySolar(now.getFullYear(), now.getMonth() + 1, now.getDate()); 113 | const todayLunarDateObj = getLunarByTimestamp(todayTimestamp); 114 | 115 | switch(birthdayType){ 116 | case "Solar": 117 | case "公历": 118 | const [solarYear, solarMonth, solarDay] = birthdayDate.split("-").map(Number); 119 | const [todayYear, todayMonth, todayDay] = todaySolarString.split("-").map(Number); 120 | return todayMonth === solarMonth && todayDay === solarDay; 121 | case "Lunar": 122 | case "农历": 123 | const lunarDateObj = parseLunarDateZhYear(birthdayDate); 124 | return todayLunarDateObj.lMonth === lunarDateObj.month && todayLunarDateObj.lDay === lunarDateObj.day; 125 | } 126 | } 127 | 128 | // 数字与中文映射 129 | const yearZhMap = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九']; 130 | // 获取中文年份 131 | function getYearZh(year){ 132 | return String(year).split('').map(num => yearZhMap[Number(num)]).join(''); 133 | } 134 | // 获取数字年份 135 | function getYearNum(zhYear){ 136 | return parseInt(zhYear.split('').map(char => yearZhMap.indexOf(char)).join(''), 10); 137 | } 138 | 139 | // 解析农历日期(数字年份) 140 | function parseLunarDateNumYear(lunarDate){ 141 | const [lunarYearText, lunarMonthText, lunarDayText] = lunarDate.match(/(\d{4})年(闰?[^月]+)月(.+)/).slice(1); 142 | const lunarYear = getYearNum(lunarYearText); 143 | const lunarMonth = monthMap.indexOf(lunarMonthText.replace("闰", "")) + 1; 144 | const lunarDay = dayMap.indexOf(lunarDayText) + 1; 145 | const isLeap = monthText.startsWith("闰"); 146 | 147 | const lunarDateObj = { 148 | year: lunarYear, 149 | month: lunarMonth, 150 | day: lunarDay, 151 | isLeap: isLeap, 152 | }; 153 | return lunarDateObj; 154 | } 155 | // 解析农历日期(中文年份) 156 | function parseLunarDateZhYear(lunarDate){ 157 | const [lunarYearText, lunarMonthText, lunarDayText] = lunarDate.match(/(.+)年(闰?[^月]+)月(.+)/).slice(1); 158 | const lunarYear = getYearNum(lunarYearText); 159 | const lunarMonth = monthMap.indexOf(lunarMonthText.replace("闰", "")) + 1; 160 | const lunarDay = dayMap.indexOf(lunarDayText) + 1; 161 | const isLeap = lunarMonthText.startsWith("闰"); 162 | 163 | const lunarDateObj = { 164 | year: lunarYear, 165 | month: lunarMonth, 166 | day: lunarDay, 167 | isLeap: isLeap, 168 | }; 169 | return lunarDateObj; 170 | } 171 | 172 | // 从公历日期转换为农历日期 173 | function convertSolarToLunar(solarDate, lunarYearType = "Num"){ 174 | const [solarYear, solarMonth, solarDay] = solarDate.split("-").map(Number); 175 | const timestamp = getTimestampBySolar(solarYear, solarMonth, solarDay); 176 | const lunarDate = getLunarByTimestamp(timestamp); 177 | 178 | let lunarYearText = lunarDate.lYear; 179 | 180 | if(lunarYearType == "Zh"){ 181 | lunarYearText = getYearZh(lunarDate.lYear); 182 | } 183 | 184 | const lunarMonthText = lunarDate.isLeap ? `闰${monthMap[lunarDate.lMonth - 1]}` : monthMap[lunarDate.lMonth - 1]; 185 | const lunarDayText = dayMap[lunarDate.lDay - 1]; 186 | 187 | const lunarDateString = `${lunarYearText}年${lunarMonthText}月${lunarDayText}`; 188 | 189 | return lunarDateString; 190 | } 191 | // 从农历日期转换为公历日期 192 | function convertLunarToSolar(lunarDate, lunarYearType = "Num"){ 193 | let lunarDateObj; 194 | if(lunarYearType == "Zh"){ 195 | lunarDateObj = parseLunarDateZhYear(lunarDate); 196 | }else if(lunarYearType == "Num"){ 197 | lunarDateObj = parseLunarDateNumYear(lunarDate); 198 | } 199 | 200 | const timestamp = getTimestampByLunar(lunarDateObj.year, lunarDateObj.month, lunarDateObj.day, lunarDateObj.isLeap); 201 | const solarDate = getSolarByTimestamp(timestamp); 202 | 203 | const solarDateString = `${solarDate.sYear}-${String(solarDate.sMonth).padStart(2, "0")}-${String(solarDate.sDay).padStart(2, "0")}`; 204 | 205 | return solarDateString; 206 | } 207 | 208 | // 获取下一个生日 209 | function getNextSolarBirthday(birthdaySolar){ 210 | // 获取下一个公历生日并更新 211 | const [solarYear, solarMonth, solarDay] = birthdaySolar.split("-").map(Number); 212 | const now = new Date(); 213 | const currentYear = now.getFullYear(); 214 | 215 | let nextYear = currentYear; 216 | if (now.getMonth() + 1 > solarMonth || (now.getMonth() + 1 === solarMonth && now.getDate() > solarDay)) { 217 | nextYear += 1; 218 | } 219 | 220 | const nextSolarBirthday = { 221 | sYear: nextYear, 222 | sMonth: solarMonth, 223 | sDay: solarDay, 224 | }; 225 | 226 | const nextLunarBirthday = convertSolarToLunar(nextSolarBirthday.sYear + "-" + nextSolarBirthday.sMonth + "-" + nextSolarBirthday.sDay, "Zh"); 227 | 228 | const formatNextBirthday = getDateString(nextSolarBirthday.sYear, nextSolarBirthday.sMonth, nextSolarBirthday.sDay); 229 | 230 | return [formatNextBirthday, nextLunarBirthday]; 231 | } 232 | function getNextLunarBirthday(birthdayLunar){ 233 | // 获取下一个农历生日并更新 234 | const lunarDateObj = parseLunarDateZhYear(birthdayLunar); 235 | 236 | const currentTimestamp = Date.now(); 237 | const currentLunar = getLunarByTimestamp(currentTimestamp); 238 | 239 | let nextLunarYear = currentLunar.lYear; 240 | if ( 241 | lunarDateObj.month < currentLunar.lMonth || 242 | (lunarDateObj.month === currentLunar.lMonth && lunarDateObj.day <= currentLunar.lDay) 243 | ) { 244 | nextLunarYear += 1; 245 | } 246 | 247 | const nextLunarTimestamp = getTimestampByLunar( 248 | nextLunarYear, 249 | lunarDateObj.month, 250 | lunarDateObj.day, 251 | false // 农历生日的计算不处理闰月 252 | ); 253 | 254 | let nextSolarBirthday = getSolarByTimestamp(nextLunarTimestamp); 255 | 256 | // 检查农历月是否有三十日,如果没有,则调整到廿九 257 | const lunarMonthDays = getLunarMonthDays(nextLunarYear, lunarDateObj.month, getLeapMonth(nextLunarYear)); 258 | if (lunarDateObj.day > lunarMonthDays) { 259 | nextSolarBirthday.sDay -= 1; 260 | } 261 | 262 | const nextLunarBirthday = convertSolarToLunar(nextSolarBirthday.sYear + "-" + nextSolarBirthday.sMonth + "-" + nextSolarBirthday.sDay, "Zh"); 263 | 264 | const formatNextBirthday = getDateString(nextSolarBirthday.sYear, nextSolarBirthday.sMonth, nextSolarBirthday.sDay); 265 | 266 | return [formatNextBirthday, nextLunarBirthday]; 267 | } 268 | 269 | function getAnimalByLunar(birthdayLunar){ 270 | // 根据农历生日获取生肖 271 | const lunarDateObj = parseLunarDateZhYear(birthdayLunar); 272 | const lunarYear = lunarDateObj.year; 273 | 274 | const ganzhi = getGanZhiYear(lunarYear); 275 | const animal = getAnimalYear(lunarYear); 276 | const chineseZodiac = `${ganzhi}年 ${animal}`; 277 | 278 | return chineseZodiac; 279 | } 280 | 281 | function getZodiacBySolar(birthdaySolar){ 282 | // 根据公历生日获取星座 283 | const [solarYear, solarMonth, solarDay] = birthdaySolar.split("-").map(Number); 284 | const zodiac = getZodiac(solarMonth, solarDay); 285 | 286 | return zodiac; 287 | } 288 | 289 | function getDaysUntilNextBirthday(birthdaySolar, nextBirthday){ 290 | const birthdayDate = new Date(birthdaySolar); 291 | const nextBirthdayDate = new Date(nextBirthday); 292 | const now = new Date(); 293 | const diff = nextBirthdayDate - now; 294 | const days = Math.ceil(diff / (1000 * 60 * 60 * 24)); 295 | const nextAge = nextBirthdayDate.getFullYear() - birthdayDate.getFullYear(); 296 | 297 | const String = `${nextAge}岁生日还有${days}天`; 298 | return String; 299 | } 300 | 301 | /* 302 | This file is part of mumuy/calendar. 303 | 304 | mumuy/calendar is licensed under the MIT License. See the LICENSE file (https://github.com/mumuy/calendar/blob/main/LICENSE) for more details. 305 | 306 | Portions of this code are based on work from the mumuy/calendar project by mumuy (Copyright 2022). 307 | The original project is licensed under the MIT License. See https://github.com/mumuy/calendar for more details. 308 | */ 309 | function getDateString(...param){ 310 | return param.map(function(value){ 311 | return (''+value).padStart(2,'0'); 312 | }).join('-'); 313 | } 314 | 315 | // 星期 316 | const weekMap = ['日','一','二','三','四','五','六']; 317 | // 公历日期转时间戳 318 | function getTimestampBySolar(sYear,sMonth,sDay){ 319 | return Date.UTC(sYear, sMonth-1, sDay, 0, 0, 0); 320 | }; 321 | // 通过时间戳获取日期 322 | function getSolarByTimestamp(timestamp){ 323 | let now = new Date(timestamp); 324 | let week = now.getDay(); 325 | let item = { 326 | sYear:now.getFullYear(), 327 | sMonth:now.getMonth()+1, 328 | sDay:now.getDate(), 329 | week:week, 330 | weekZH:'星期'+weekMap[week] 331 | }; 332 | item['date'] = getDateString(item['sYear'],item['sMonth'],item['sDay']); 333 | return item; 334 | } 335 | // 获取公历一个月天数 336 | function getSolarMonthDays(sYear,sMonth){ 337 | let day = new Date(sYear,sMonth,0); 338 | return day.getDate(); 339 | } 340 | 341 | // lunar.js, https://github.com/mumuy/calendar/blob/main/src/module/lunar.js 342 | // 农历有效期范围 343 | const minYear = 1900; 344 | const minMonth = 1; 345 | const minDay = 30; 346 | const maxYear = 2100; 347 | // 闰月数据压缩:1位闰月大小+12位平月大小及4位长度闰月月份转2进制,再转32进制 348 | const monthData = [ 349 | 'iuo','in0','19bg','l6l','1kj0','1mag','2pak','ll0','16mg','lei', 350 | 'in0','19dm','196g','1kig','3kil','1da0','1ll0','1bd2','15dg','2ibn', 351 | 'ibg','195g','1d5l','qig','ra0','3aqk','ar0','15bg','kni','ibg', 352 | 'pb6','1l50','1qig','rkl','mmg','ar0','31n3','14n0','3i6n','1iag', 353 | '1l50','3m56','1dag','ll0','39dk','9eg','14mg','1kli','1aag','1dan', 354 | 'r50','1dag','2kql','jd0','19dg','2hbj','klg','1ad8','1qag','ql0', 355 | '1bl6','1aqg','ir0','1an4','19bg','kj0','1sj3','1mag','mqn','ll0', 356 | '15mg','jel','img','196g','1l6k','1kig','1lao','1da0','1dl0','35d6', 357 | '15dg','idg','1abk','195g','1cjq','qig','ra0','1bq6','1ar0','15bg', 358 | 'inl','ibg','p5g','t53','1qig','qqo','le0','1ar0','15ml','14n0', 359 | '1ib0','1mak','1l50','1mig','tai','ll0','1atn','9eg','14mg','1ill', 360 | '1aag','1d50','1el4','1bag','lep','it0','19dg','2kbm','klg','1a9g', 361 | 'uak','ql0','1bag','mqi','ir0','19n6','1970','1kj0','1qj5','1l9g', 362 | 'ml0','tl3','15mg','inr','img','196g','3k5m','1kig','1l90','1na5', 363 | '1dd0','lmg','ldi','idg','19bn','195g','1aig','3cil','r90','1bd0', 364 | '2ir3','14rg','ifo','ibg','p5g','2q56','1qig','qp0','39m4','1an0', 365 | '18n0','1kn3','1ib0','1lan','1l50','1mig','nal','ll0','19mg','lek', 366 | 'kmg','1ado','1aag','1d50','1dl6','1bag','ld0','1at4','19dg','klg', 367 | '1cjj','q9g','spn','ql0','1bag','2iql','ir0','19bg','l74','1kb0', 368 | '1qb8','1l90','1ml0','2ql6','lmg','in0','1aek','18mg','1kag','1sii', 369 | '1l90' 370 | ]; 371 | // 月份 372 | const monthMap = ['正','二','三','四','五','六','七','八','九','十','冬','腊']; 373 | // 十位 374 | const dayMap = ['初一','初二','初三','初四','初五','初六','初七','初八','初九','初十','十一','十二','十三','十四','十五','十六','十七','十八','十九','二十','廿一','廿二','廿三','廿四','廿五','廿六','廿七','廿八','廿九','三十']; 375 | // 参考时间点 376 | const startTime = Date.UTC(minYear, minMonth-1, minDay, 0, 0, 0); 377 | // 获取农历年闰月 378 | function getLeapMonth(lYear){ 379 | let data = parseInt(monthData[lYear - minYear],32); 380 | return data&0xf; 381 | } 382 | // 获取农历年长度 383 | function getLunarYearDays(lYear) { 384 | let offset = 0; 385 | let data = parseInt(monthData[lYear - minYear],32); 386 | for (let i = 1<<15; i >= 1<<4; i >>= 1) { 387 | offset += (data&i)?30:29; 388 | } 389 | if(getLeapMonth(lYear)){ 390 | offset += (data&1<<16)?30:29; 391 | } 392 | return offset; 393 | } 394 | // 获得农历月份天数 395 | function getLunarMonthDays(lYear,lMonth,isLeap){ 396 | let leapMonth = getLeapMonth(lYear); 397 | let data = parseInt(monthData[lYear - minYear],32); 398 | let days = data&1<<(16 - lMonth)?30:29; 399 | if(isLeap&&lMonth==leapMonth){ 400 | days = data&1<<16?30:29; 401 | } 402 | return days; 403 | } 404 | // 农历日期转时间戳 405 | function getTimestampByLunar(lYear,lMonth,lDay,isLeap){ 406 | // 有效性验证 407 | if(lYearmaxYear){ 408 | return null; 409 | } 410 | if(lMonth<1||lMonth>12){ 411 | return null; 412 | } 413 | let leapMonth = getLeapMonth(lYear); 414 | if(isLeap&&leapMonth!=lMonth){ 415 | return null; 416 | } 417 | let data = parseInt(monthData[lYear - minYear],32); 418 | let days = (isLeap?data&1<<16:1<<(17-lMonth))?30:29; 419 | if(lDay>days){ 420 | return null; 421 | } 422 | // 时间戳获取 423 | let offset = 0; 424 | for(let year=minYear;yearleapMonth){ 431 | offset += data&1<<16?30:29; 432 | } 433 | offset += lDay; 434 | return startTime+offset*86400000; 435 | } 436 | // 时间戳转农历日期 437 | function getLunarByTimestamp(timestamp){ 438 | let offset = Math.floor((timestamp - startTime)/86400000); 439 | let lYear = 0, lMonth = 0, lDay = 0, isLeap = false; 440 | let days; 441 | if(offset<=0){ 442 | return null; 443 | } 444 | let count = 0; 445 | for(lYear = minYear; lYear<=maxYear; lYear++){ 446 | days = getLunarYearDays(lYear); 447 | if(count + days>=offset){ 448 | break; 449 | } 450 | count+= days; 451 | } 452 | let data = parseInt(monthData[lYear - minYear],32); 453 | let leapMonth = getLeapMonth(lYear); 454 | offset -= count; 455 | count = 0; 456 | for(lMonth=1;lMonth<=12;lMonth++){ 457 | days = data&1<<(16 - lMonth)?30:29; 458 | if(count+days>=offset){ 459 | break; 460 | } 461 | count += days; 462 | if(leapMonth&&lMonth==leapMonth){ 463 | days = data&1<<16?30:29; 464 | if(count+days>=offset){ 465 | isLeap = true; 466 | break; 467 | } 468 | count += days; 469 | } 470 | } 471 | lDay = offset-count; 472 | return { 473 | lYear:lYear, 474 | lMonth:lMonth, 475 | lDay:lDay, 476 | isLeap:isLeap, 477 | lMonthZH:(isLeap?'闰':'')+monthMap[lMonth-1]+'月', 478 | lDayZH:dayMap[lDay-1] 479 | }; 480 | } 481 | 482 | // 干支纪年 483 | const ganMap = ['甲','乙','丙','丁','戊','己','庚','辛','壬','癸']; 484 | const zhiMap = ['子','丑','寅','卯','辰','巳','午','未','申','酉','戌','亥']; 485 | // 获取干支年: 1984年为甲子年 486 | function getGanZhiYear(lYear){ 487 | let gzIndex = lYear - 1984; 488 | gzIndex = gzIndex%60>0?gzIndex%60:gzIndex%60+60; 489 | let gan = gzIndex%10; 490 | let zhi = gzIndex%12; 491 | return ganMap[gan]+zhiMap[zhi]; 492 | } 493 | 494 | // 12生肖 495 | const animalMap = ['鼠','牛','虎','兔','龙','蛇','马','羊','猴','鸡','狗','猪']; 496 | // 获取生肖纪年: 1984年为鼠年 497 | function getAnimalYear(sYear){ 498 | let diff = sYear - 1984; 499 | let animal = diff%12; 500 | return animalMap[animal>-1?animal:animal+12]; 501 | } 502 | 503 | // 星座 504 | const zodiacMap = ['水瓶','双鱼','白羊','金牛','双子','巨蟹','狮子','处女','天秤','天蝎','射手','摩羯']; 505 | const zodiacDate = [20,19,21,20,21,22,23,23,23,24,23,22]; 506 | // 获取星座 507 | function getZodiac(sMonth,sDay){ 508 | let zoIndex = 11; 509 | zodiacDate.forEach(function(day,index){ 510 | let month = index+1; 511 | if(getDateString(sMonth,sDay)>=getDateString(month,day)){ 512 | zoIndex = index%12; 513 | } 514 | }); 515 | return zodiacMap[zoIndex]+'座'; 516 | } -------------------------------------------------------------------------------- /Resources/image/3.0-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RavenHogWarts/Birthday-Manager/523def0f11312cc499de1397cb0e8a023f87f847/Resources/image/3.0-preview.png -------------------------------------------------------------------------------- /Resources/image/advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RavenHogWarts/Birthday-Manager/523def0f11312cc499de1397cb0e8a023f87f847/Resources/image/advanced.png -------------------------------------------------------------------------------- /Resources/image/download.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RavenHogWarts/Birthday-Manager/523def0f11312cc499de1397cb0e8a023f87f847/Resources/image/download.gif -------------------------------------------------------------------------------- /Resources/image/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RavenHogWarts/Birthday-Manager/523def0f11312cc499de1397cb0e8a023f87f847/Resources/image/setting.png -------------------------------------------------------------------------------- /Resources/image/usage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RavenHogWarts/Birthday-Manager/523def0f11312cc499de1397cb0e8a023f87f847/Resources/image/usage.gif -------------------------------------------------------------------------------- /Resources/template/生日数据模板.md: -------------------------------------------------------------------------------- 1 | --- 2 | birthdaySolar: 3 | birthdayLunar: 4 | birthdayType: 公历 5 | nextBirthday: 6 | nextBirthdayString: 7 | animal: 8 | zodiac: 9 | --- 10 | -------------------------------------------------------------------------------- /生日管理.md: -------------------------------------------------------------------------------- 1 | ![生日簿](Resources/components/basic/生日簿.components) --------------------------------------------------------------------------------