![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
1
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
2![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
<html xmlns="http://www.w3.org/1999/xhtml">
6
<head runat="server">
7
<title>无标题页</title>
8
<script src="date.js" type="text/javascript"></script>
9
<script src="base.js" type="text/javascript"></script>
10
11
</head>
12
<body>
13
<form id="form1" runat="server">
14
<div>
15
onpropertychange
16
</div>
17
</form>
18
<p>
19
<input id="Text1" type="text" onchange="altertValue();" /><input id="Text2" type="text" />sInputString<input
20
id="txtTime" type="text" value="2009-05-10" /></p>
21
</body>
22
</html>
23![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
24
<script language="javascript" type="text/javascript">
25
function altertValue()
26![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
27
var time = document.getElementById("txtTime").value.toString();
28
// var day2 = new Date(Date.parse(time.replace(/-/g, "/")));
29
var temp = time.replace(/-/g,"/");
30
var day=new Date(temp).getDay();
31
day=23;
32
var day2=new Date(temp).getDay();
33
34
//20天后
35
switch (day2)
36![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
37
case 1: //星期一
38
temp=addDate(temp,25);
39
break;
40
41
case 2: //星期二
42
temp=addDate(temp,27);
43
break;
44
45
case 3: //星期三
46
temp=addDate(temp,27);
47
break;
48
49
case 4: //星期四
50
temp=addDate(temp,27);
51
break;
52
53
case 5: //星期五
54
temp=addDate(temp,27);
55
break;
56
57
case 6: //星期六
58
temp=addDate(temp,27);
59
break;
60
61
case 0: //星期天
62
temp=addDate(temp,26);
63
break;
64
}
65
66
//5天后
67
switch (day)
68![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
69
case 1: //星期一
70
temp=addDate(temp,4);
71
break;
72
73
case 2: //星期二
74
temp=addDate(temp,6);
75
break;
76
77
case 3: //星期三
78
temp=addDate(temp,6);
79
break;
80
81
case 4: //星期四
82
temp=addDate(temp,7);
83
break;
84
85
case 5: //星期五
86
temp=addDate(temp,6);
87
break;
88
89
case 6: //星期六
90
temp=addDate(temp,6);
91
break;
92
93
case 0: //星期天
94
temp=addDate(temp,5);
95
break;
96
}
97
// document.write(temp);
98
99
alert(temp);
100![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
101
// var myDate="2009-04-11 20:51";
102
// myDate=myDate.substring(0,10);
103
//
104
// var time=document.getElementById("txtTime").value;
105![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
106
// time = addDate(time,4);
107
// alert(time);
108
//
109![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
110
//
111
// document.getElementById("Text1").value=time
112
// var txt=document.getElementById("Text1").value;
113![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
114
// document.getElementById("Text2").value=txt;
115
//
116
117
}
118![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
119
</script>
120![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
posted on
2009-05-15 14:47
poop
阅读(
595)
评论()
编辑
收藏
举报