我写的万年历插件(含天干地支,农历,阳历,节气,各种节假日等),基于MooTools 1.4

本文主要是介绍我写的万年历插件(含天干地支,农历,阳历,节气,各种节假日等),基于MooTools 1.4,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

演示效果图:

 

插件源代码:

function PL_rili(_id,Option,memo,_edit){//_edit:日曆內的價格可否被編輯
//如果页面中不包含该对象则退出该扩展方法
if(!_id){return false;}

if(_edit==undefined){_edit=false}
var Today=new Date();
var tY=Today.getFullYear();
var tM=Today.getMonth();
var tD=Today.getDate();
//農曆資料
var lunarInfo=new Array(0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,0x06ca0,0x0b550,0x15355,0x04da0,0x0a5d0,0x14573,0x052d0,0x0a9a8,0x0e950,0x06aa0,0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b5a0,0x195a6,0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0);
var solarMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var Gan=new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸");
var Zhi=new Array("子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥");
var solarTerm=new Array("小寒","大寒","立春","雨水","驚蟄","春分","清明","穀雨","立夏","小滿","芒種","夏至","小暑","大暑","立秋","處暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至");
var sTermInfo=new Array(0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,375494,397447,419210,440795,462224,483532,504758);
var nStr1=new Array('星期日','星期一','星期二','星期三','星期四','星期五','星期六');
var cn_mth=new Array("","一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
var cn_day=new Array("","初一","初二","初三","初四","初五","初六","初七","初八","初九","初十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十","廿一","廿二","廿三","廿四","廿五","廿六","廿七","廿八","廿九","三十","卅一");
var wFtv=new Array("0520 母親節","1144 感恩節");//某月的第幾個星期幾
//國曆節日 *表示放假日
var sFtv=new Array(
"0101*元旦","0111 司法節","0115 藥師節","0214 情人節","0215 戲劇節","0228*和平紀念日","0301 兵役節","0308 婦女節","0312 植樹節","0317 國醫節","0320 郵政節",
"0321 氣象節","0325 美術節","0326 廣播節","0329 青年節","0330 出版節","0401 愚人節","0404*兒童節","0405*清明節","0408 衛生節","0501 勞動節","0504 文藝節",
"0505 舞蹈節","0512 護士節","0603 禁煙節","0606 水利節","0609 鐵路節","0615 警察節","0701 漁民節","0711 航海節","0808 父親節","0814 空軍節","0901 記者節",
"0903 軍人節","0909 律師節","0913 法律日","0928 教師節","1006 老人節","1010*國慶日","1021 華僑節","1024 聯合國日","1025 光復節","1031 榮民節","1101 商人節",
"1111 工業節","1112 國父誕辰","1121 防空節","1205 海員節","1210 人權節","1212 憲兵節","1225*行憲紀念日","1227 建築師節","1228 電信節","1231 受信節"
);
//農曆節日 *表示放假日
var lFtv=new Array(
"0100*除夕","0101*春節","0102*回娘家","0103*祭祖","0104 迎神","0105 開市","0109 天公生","0115 元宵節","0202 土地公生","0219 觀世音誕辰","0323 媽祖生日",
"0408 浴彿節","0505*端午節","0701 開鬼門","0707 七夕","0715 中元節","0800 關鬼門","0815*中秋節","0909 重陽節","1208 臘八節","1216 尾牙","1224 送神"
);
//畫月曆
Show(tY,tM,tD);
function Show(_y,_m,_d){
var i,sD;
var cld=new core(_y,_m);
Ganzhi((_y-1900)*12 + _m +14);
css='<style type="text/css">';
css+='#PL_rili_tit{width:100%;font-family:Verdana,arial;font-size:15px;font-weight:bo

这篇关于我写的万年历插件(含天干地支,农历,阳历,节气,各种节假日等),基于MooTools 1.4的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/491954

相关文章

Maven(插件配置和生命周期的绑定)

1.这篇文章很好,介绍的maven插件的。 2.maven的source插件为例,可以把源代码打成包。 Goals Overview就可以查看该插件下面所有的目标。 这里我们要使用的是source:jar-no-fork。 3.查看source插件的example,然后配置到riil-collect.xml中。  <build>   <plugins>    <pl

jenkins 插件执行shell命令时,提示“Command not found”处理方法

首先提示找不到“Command not found,可能我们第一反应是查看目标机器是否已支持该命令,不过如果相信能找到这里来的朋友估计遇到的跟我一样,其实目标机器是没有问题的通过一些远程工具执行shell命令是可以执行。奇怪的就是通过jenkinsSSH插件无法执行,经一番折腾各种搜索发现是jenkins没有加载/etc/profile导致。 【解决办法】: 需要在jenkins调用shell脚

Jenkins 插件 地址证书报错问题解决思路

问题提示摘要: SunCertPathBuilderException: unable to find valid certification path to requested target...... 网上很多的解决方式是更新站点的地址,我这里修改了一个日本的地址(清华镜像也好),其实发现是解决不了上述的报错问题的,其实,最终拉去插件的时候,会提示证书的问题,几经周折找到了其中一遍博文

eclipse安装subversion(SVN)版本控制插件

陈科肇 查看插件更新站点 网址:http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA 网站截图: 根据自己的eclipse版本,选择需要的更新站点. 使用eclipse集成subservion插件 Help > Install New Software…> 等待下载安装插件…

Weex入门教程之2,Android Studio安装Weex插件

插件位置及描述 https://plugins.jetbrains.com/idea/plugin/8460-weex 貌似对windows还不是很支持,先放着吧。 安装 插件功能 先预览下都有什么功能 安装完成Weex插件后,如果在main toolbar找不到这些功能图标,那么就需要手动添加到main toolbar 添加到main toolbar 红框内就是

mybatis框架基础以及自定义插件开发

文章目录 框架概览框架预览MyBatis框架的核心组件MyBatis框架的工作原理MyBatis框架的配置MyBatis框架的最佳实践 自定义插件开发1. 添加依赖2. 创建插件类3. 配置插件4. 启动类中注册插件5. 测试插件 参考文献 框架概览 MyBatis是一个优秀的持久层框架,它支持自定义SQL、存储过程以及高级映射,为开发者提供了极大的灵活性和便利性。以下是关于M

PrestaShop免费模块/插件/扩展/工具下载

PrestaShop免费模块/插件/扩展/工具下载 PrestaShop免费模块 适用于您的电子商务网站的PrestaShop模块 现有超过3,000个PrestaShop模块可帮助您自定义在线商店,增加流量,提高转化率并建立客户忠诚度。 使您的电子商务网站成功! 下载(超过142+之多的PrestaShop官网认证的免费模块) 标签PrestaShop免费, PrestaShop免费工

zblog自定义关键词和描述,zblog做seo优化必备插件

zblog自定义关键词和描述,zblog做seo优化必备插件     首先说下用到的一款插件:CustomMeta自定义数据字段 ,我们这里用到的版本是1.1,1.1+版增加了列表页标签支持!     插件介绍:文章,分类等添加自定义数据字段。1.1+版适用于 Z-Blog 2.0 B2以上版本。     在zblog2.0beta1里面,这个插件是集成到了程序里面,beta2里面默认没有了

插件maven-search:Maven导入依赖时,使用插件maven-search拷贝需要的依赖的GAV

然后粘贴: <dependency>    <groupId>mysql</groupId>    <artifactId>mysql-connector-java</artifactId>    <version>8.0.26</version> </dependency>

插件:清理maven错误缓存.bat

插件:https://pan.baidu.com/s/1nHIxHoo1C4MvFlW7QbZe5Q?pwd=7zenhttps://pan.baidu.com/s/1nHIxHoo1C4MvFlW7QbZe5Q?pwd=7zen没错误缓存时: 有错误缓存时: