日曆日期控制項

2021-08-30 10:17:33 字數 3987 閱讀 3316

自己做了乙個日曆日期控制項,說實話,還存在很多問題,不過基本可以用,呵呵,先發出來再慢慢改。

date.js源**:

var montharr = new array("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一", "十二");

function $(id)

function showmonthdiv()

function closemonthdiv()

function minuptonfocus()

function minputonblur()

var backyeartd = "←";

var xyeartd = "x";

var forwardyeartd = "→";

function showyeardiv()

html += "";

html += backyeartd + xyeartd + forwardyeartd;

html += "";

html += "";

yeardiv.innerhtml = html;

yeardiv.style.display = "block";

}function backyear()

html += "";

html += backyeartd + xyeartd + forwardyeartd;

html += "";

html += "";

yeardiv.innerhtml = html;

yeardiv.style.display = "block";

}function forwardyear()

html += "";

html += backyeartd + xyeartd + forwardyeartd;

html += "";

html += "";

yeardiv.innerhtml = html;

yeardiv.style.display = "block";

}function closeyeardiv()

function yinuptonfocus()

function yinputonblur()

function getdaysinmonth(month,year) else

} return days;

}function isleapyear (year) else

}function overdate(obj)

function outdate(obj)

function displaycalendar(month, year)

var j = 0;

for (i = startingpos; i < days; i++) else

} if (days < 35 && days > 28)

} else if (days > 35)

} html += "

"; datediv.innerhtml = html;

}function isfourdigityear(year) else

}function getmonthindex(month)

} return 0;

}function setpreviousyear()

}function setpreviousmonth()

} else

$("month").value = montharr[month];

displaycalendar(month, year);

}}function setnextmonth() else

$("month").value = montharr[month];

displaycalendar(month, year);

}}function setnextyear()

}function leftfill(str, digit, char)

} else

ret += string;

return ret;

}//設定今天日期

function settoday()

function selectmonth(month)

function selectyear(year)

var curfocus = null;

function selectinput(obj)

function increasetime()

var curvalue = parseint(curfocus.value, 10);

var value;

if ((curfocus == hh && curvalue < 23) || (curfocus != hh && curvalue < 59)) else

curfocus.value = leftfill(value, 2, "0");

curfocus.focus();

}function decreasetime()

var curvalue = parseint(curfocus.value, 10);

var value;

if (curvalue > 0) else

curfocus.value = leftfill(value, 2, "0");

curfocus.focus();

}function getscriptpath()

}return "";

}var object = null;

var maindiv = null;

var scriptpath = getscriptpath();

function datehandler(obj) else

str += "";

}str += ""

+ "" + ""

+ "" + ""

+ "" + ""

+ "" + ""

+ "+ "

+ "" + "

" + "

" + ""

+ ""

+ "時間"

+ ":"

+ ":"

+ "" + "

" + "

" + "

" + ""

+ ""

+ "" + "

" + "

"; if (maindiv == null)

maindiv.style.display = "block";

settoday();

}function closedate()

}function selectdate(obj)

date.css源**:

.wdatediv

.wdatediv *

.wdatediv #dptitle

/* 年份月份選擇框 div */

.ymsel

#month

#year

.bttn

.timespan

.time

.timetab

.seltimebtn

#datetab

.day

.day td

.date

.date td

td.weekday

td.thisday

.mouseover

.mouseout

images目錄下放置了所有使用到的.

下面是乙個使用這個空間的測試頁面:

<?xml version="1.0" encoding="gbk" ?>

日曆使用者控制項

namespace tempweb remove private static readonly string header new string private datetime startdate gets or sets the show date.the show date.descript...

日曆控制項 Calendar

現在我們可以利用calendar控制項可以簡單的實現乙個很好的日曆控制項.直接在工具箱裡面拉出來就可以了,在這個控制項裡面,我們也可以做更多的個性化.有系統預設的也有系統自己帶的很多款式給你選擇.當然你不高興的話可以自己選擇自己的方式去填充這些 我選擇了乙個專業型的.感覺還不錯.呵呵 asp cal...

js日曆控制項

網上有許多js寫的時間選擇控制項,但大都不能在aspx中使用 只能在html中用 好不容易找到乙個可以用的,不過介面難看了 如下 在head中包含 src中的檔名當然是根據自己的檔名來的 在輸入框 編碼問題 最佳方法是把js的編碼換成utf 8,而不是把aspx的編碼換成gb2312 在vs中開啟該...