<
script
src
="js/jquery-1.7.2.min.js"
type
="text/javascript"></
script
>
<
script
type
="text/javascript">
window.onload =
function
() {
var
now =
new
Date();
var
yr = now.getFullYear();
var
month = ((now.getMonth() < 9) ?
"0"
:
""
) + (now.getMonth() + 1);
var
day = now.getDay();
var
date = now.getDate();
var
aryDay =
new
Array(
"
日
"
,
"
一
"
,
"
二
"
,
"
三
"
,
"
四
"
,
"
五
"
,
"
六
"
);
var
liClass =
"week"
;
try
{
var
url = window.location.href
//
获取当前
URL
var
param = url.split(
"?"
)[1].split(
"="
)[1];
var
hidDate = param;
$(
"#txt_Date"
).val(hidDate);
}
catch
(e) {
}
finally
{
var
param1 = $(
"#txt_Date"
).val();
var
dateNow = now.getDate();
var
date1 = yr +
"-"
+ month +
"-"
+ ((dateNow < 10) ?
"0"
:
""
) + dateNow;
if
(param1 ==
""
) {
$(
"#txt_Date"
).val(date1);
}
}
var
compareDate;
for
(
var
i = 0; i <= 6; i++) {
if
(i <= day) {
compareDate = yr +
"-"
+ month +
"-"
+ (((date - (day - i)) < 10) ?
"0"
:
""
) + (date - (day - i));
if
(compareDate == $(
"#txt_Date"
).val()) {
liClass =
"choosetoday"
;
}
$(
"#ulID"
).append(
"<a href='FinCalendar.asp?date="
+ yr +
"-"
+ month +
"-"
+ (((date - (day - i)) < 10) ?
"0"
:
""
) + (date - (day - i)) +
"'><li class='"
+ liClass +
"'><p>
星期
"
+ aryDay[i] +
"</p><p>("
+ month +
"/"
+ (date - (day - i)) +
")</p></li></a>"
);
liClass =
"week"
;
}
else
{
compareDate = yr +
"-"
+ month +
"-"
+ (((date + (i - day)) < 10) ?
"0"
:
""
) + (date + (i - day));
if
(compareDate == $(
"#txt_Date"
).val()) {
liClass =
"choosetoday"
;
}
$(
"#ulID"
).append(
"<a href='FinCalendar.asp?date="
+ yr +
"-"
+ month +
"-"
+ (((date + (i - day)) < 10) ?
"0"
:
""
) + (date + (i - day)) +
"'><li class='"
+ liClass +
"'><p>
星期
"
+ aryDay[i] +
"</p><p>("
+ month +
"/"
+ (date + (i - day)) +
")</p></li></a>"
);
liClass =
"week"
;
}
}
}
function
jump() {
var
date = document.getElementById(
"txt_Date"
).value;
if
(date ==
""
) {
var
now =
new
Date();
var
yr = now.getFullYear();
var
month = ((now.getMonth() < 9) ?
"0"
:
""
) + (now.getMonth() + 1);
var
dateNow = now.getDate();
date = yr +
"-"
+ month +
"-"
+ ((dateNow < 10) ?
"0"
:
""
) + dateNow;
}
location.href =
"FinCalendar.asp?date="
+ date;
}
</
script
>
<
ul
id
="ulID">
</
ul
>