⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sttime.js

📁 超炫日历超炫日历超炫日历超炫日历超炫日历超炫日历超炫日历超炫日历超炫日历
💻 JS
字号:
//* File:stTime.js
//* Author: zhuangtai 
//* E-mail: zhuangtaizzt@gmail.com
//* Date:2008/01/21
if(typeof _STNS != "undefined" && !_STNS.TIME)
{
	_STNS.dTime=new Date;
	_STNS.TIME=
	{
		ASECOND:1000,
		AMINUTE:60000,
		AHOUR:3600000,
		ADAY:86400000,
		AWEEK:604800000,
		fiGetNow:function()
		{
			if(Date.now)
				return Date.now();
			else
				return (new Date).getTime();
		},
		fbIsLeapYear:function(y)
		{
			return (y%4==0 && y%100!=0)||y%400==0;
		},
		fiGetMonthLen:function(y,m)
		{
			var _r=_STNS,_t=_STNS.TIME;
			_r.dTime.setTime(Date.UTC(y,m)-_t.ADAY);
			return _r.dTime.getDate();
		},
		fiGetYearLen:function(y)
		{
			if(_STNS.TIME.fbIsLeapYear(y))
				return 366;
			else
				return 365;
		},
		fiGetFirstDay:function(y,m)
		{
			var _r=_STNS,_t=_STNS.TIME;
			_r.dTime.setTime(Date.UTC(y,m-1));
			return _r.dTime.getDay();				
		},
		fiGetWeek:function(y,m,d)
		{
			var _r=_STNS,_t=_STNS.TIME,dt=Date.UTC(y,m-1,d+1)-Date.UTC(y,0,1)+_t.fiGetFirstDay(y,1)*_t.ADAY;
			return Math.ceil(dt/_t.AWEEK);
		}
	};
	with(_STNS.TIME)
	{
		_STNS.TIME.CCalDat=_STNS.Class();
		CCalDat.register("TIME/CCalDat");
		CCalDat.construct=function()
		{
			this.sURL=0;
			this.oInfo=0;
			this.iStat=0;
			with(_STNS.TIME.CCalDat)
			{
				this.foGetInfo=foGetInfo;
				this.foTranslation=foTranslation;
			}
		};
		CCalDat.foGetInfo=function(y,m,d,h,mi,s,ms)
		{
			if(!this.oInfo) return;
			if(this.oInfo.iType==0)		
				return this.oInfo.foTranslation(y,m,d,h,mi,s,ms);
			else
				return this.foTranslation.call(this.oInfo,y,m,d,h,mi,s,ms);
		};
		CCalDat.foTranslation=function(y,m,d,h,mi,s,ms)
		{
			var dt=Date.UTC(y,m-1,d);
			for(var i=0;i<this.aEvents.length;i++)
			{
				for(var j=0;j<this.aEvents[i].aDates.length;j++)
				{
					if(Date.parse(this.aEvents[i].aDates[j])==(dt+_STNS.dTime.getTimezoneOffset()*_STNS.TIME.AMINUTE))
					{
						return {
									sIco:this.aEvents[i].sIco,
									sSummary:this.aEvents[i].sSummary,
									sDescription:this.aEvents[i].sDescription,
									fsGetIco:_STNS.TIME.CCalDat.fsGetIco,
									fsGetSimpleTxt:_STNS.TIME.CCalDat.fsGetSimpleTxt,
									fsGetWholeTxt:_STNS.TIME.CCalDat.fsGetWholeTxt
								}
					}
				}
			}
		};
		CCalDat.fsGetIco=function()
		{
			return this.sIco;
		};
		CCalDat.fsGetSimpleTxt=function()
		{
			return this.sSummary;
		};
		CCalDat.fsGetWholeTxt=function()
		{
			return "<table cellpadding=0 cellspacing=0><td valign='top'><img src='"+this.sIco+"'></td><td style='float:left'>"+this.sDescription+"</td></table>";
		};
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -