争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

“javascript做的日历”改进版

时间:2024/7/8作者:未知来源:争怎路由网人气:

(tmpYear % 400 == 0)){

theMonthDay++;

}

}

return(theMonthDay);

}

this.SetDateFormat = function(theYear, theMonth, theDay){//format a date to this.DateFormat

var theDate = this.DateFormat;

var tmpYear = this.GetFormatYear(theYear);



var tmpMonth = theMonth;

if (tmpMonth < 0){

tmpMonth = 0;

}

if (tmpMonth > 11){

tmpMonth = 11;

}

var tmpDay = theDay;

if (tmpDay < 1){

tmpDay = 1;

}else{

tmpDay = this.GetMonthDays(tmpYear, tmpMonth);

if (theDay < tmpDay){

tmpDay = theDay;

}

}

theDate = theDate.replace(/<yyyy>/g, tmpYear.toString());

theDate = theDate.replace(/<yy>/g, tmpYear.toString().substr(2,2));

theDate = theDate.replace(/<MMMMMM>/g, this.MonthName[tmpMonth]);

theDate = theDate.replace(/<MMM>/g, this.MonthName[tmpMonth].substr(0,3));

if (theMonth < 9){

theDate = theDate.replace(/<mm>/g, "0" + (tmpMonth + 1).toString());

}else{

theDate = theDate.replace(/<mm>/g, (tmpMonth + 1).toString());

}

theDate = theDate.replace(/<m>/g, (tmpMonth + 1).toString());

if (theDay < 10){

theDate = theDate.replace(/<dd>/g, "0" + tmpDay.toString());

}else{

theDate = theDate.replace(/<dd>/g, tmpDay.toString());

}

theDate = theDate.replace(/<d>/g, tmpDay.toString());

return(theDate);

}
this.GetTextDate = function(theString){ //convert a string to a date, if the string is not a date, return a empty string
var i = 0, tmpChar = "", find_tag = "";
var start_at = 0, end_at = 0, year_at = 0, month_at = 0, day_at = 0;
var tmp_at = 0, one_at = 0, two_at = 0, one_days = 0, two_days = 0;
var aryDate = new Array();
var tmpYear = -1, tmpMonth = -1, tmpDay = -1;
var tmpDate = theString.toLowerCase();
var defDate = "";
end_at = tmpDate.length;
for (i=1;i<end_at;i++){
if (tmpDate.charAt(i)=="0"){
tmpChar = tmpDate.charAt(i-1);
if (tmpChar<"0"

关键词:“javascript做的日历”改进版




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版