# almanac **Repository Path**: yima1006/almanac ## Basic Information - **Project Name**: almanac - **Description**: 日历,中国农历,阴历,基于jQuery的实现 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2015-07-17 - **Last Updated**: 2021-10-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 简介 本套日历现依赖于jQuery实现,根据香港天文台提供的数据,关于中国农历的测算从1901-2100年的测算数据,不一定准确,仅供参考。 ## 文件描述 JS文件中(almanac.js)均有详细的注释。里面主要包含三个对象 * `Almanac` 这部分代码包含日历的绘画、更新、二十四节气、天干地支等信息的计算和显示 * `DateSelection` 日历顶部右侧切换年、月所封装的操作函数 * `global` 全局变量 CSS文件中(almanac.css)包含了日历所需的CSS样式文件 images文件夹中包含所需的图片文件 ## 功能列表 * 每日阴历大图显示(天干、地支、二十四节气等),见日历右侧 * 单击/双击日历单元格事件 * 日历初始化之后回调函数 * 支持的浏览器 IE8+,FireFox3.5+,Opera 10+,Chrome 3+ ## 截图 ![日历截图](shortcut.png) ## 使用方法 1. 在页面中插入HTML ```
2015年
7月
返回今天
  • 日
  • 一
  • 二
  • 三
  • 四
  • 五
  • 六

宜

忌

``` 2. 在页面中引入CSS\JS相关文件 ``` ``` 3. 使用如下代码进行调用 ``` $("#id_almanac").almanac({ /** * 画日历之后调用函数 */ afterDrawCld: function(year, month){ console.log('加载完成'); }, /** * 双击某一天的事件 */ dbClickDay: function(elem){ var _this = $(elem); console.log('阳历:' + _this.attr('data-year') + '年' + _this.attr('data-month') + '月' + _this.attr('data-solor')); }, /** * 单击某一天的事件 */ clickDay: function(elem){ var _this = $(elem); console.log('阳历:' + _this.attr('data-year') + '年' + _this.attr('data-month') + '月' + _this.attr('data-solor')); } }); ``` 详细请参见index.html示例文件。 ## Q/A 联系方式:yima1006@foxmail.com ## License The MIT License (MIT) Copyright (c) 2015 NavCat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.