当前位置:首页 » 操作系统 » 日历源码

日历源码

发布时间: 2022-02-06 15:44:07

㈠ 求日历的HTML代码...

这是一段[日历]代码:
<span>
<iframe src='../css_test/rl.asp' width='200' height='170' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='No'></iframe>
</span>
------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%
Dim currdate,currday,currfirstweek,currDayNum,gridnum,days,monthArr,I
currdate=request.QueryString("date")
If currdate="" then currdate=Date()
currfirstday=FormatdateTime(Year(currdate)&"-"&Month(currdate)&"-01")'格式当前月第一日
currfirstweek=Weekday(currfirstday)-1'获取当前月第一日是星期几
currDayNum=DateDiff("d",currfirstday,DateAdd("m",1,currfirstday))'获取当前月总的天数
gridnum=currfirstweek+currDayNum'获取格子数
If gridnum Mod 7 <>0 Then gridnum=((gridnum\7)+1)*7

monthArr=",一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月"
monthArr=split(monthArr,",")
%>

<table border="1">
<tr>
<td align="center"><a href=""><<</a></td>
<td align="center" colspan="5"><%=monthArr(Month(currdate))%> <%=Year(currdate)%></td>
<td align="center"><a href="">>></a></td>
</tr>
<tr>
<td align="center">日</td>
<td align="center">一</td>
<td align="center">二</td>
<td align="center">三</td>
<td align="center">四</td>
<td align="center">五</td>
<td align="center">六</td>
</tr>
<tr>
<%
For I=1 To gridnum
days=I-currfirstweek
If I>currfirstweek And I<=currfirstweek+currDayNum Then
If days=Day(Now()) And FormatdateTime(Now(),2)=currdate Then
Response.Write("<td align=center bgcolor=""#CCCCCC"">"& days &"</td>")
Else
Response.Write("<td align=center>"& days &"</td>")
End If
Else
Response.Write("<td align=center></td>")
End If
IF I Mod 7 = 0 Then Response.Write("</tr><tr>")
Next
%>
</tr>
</table>

</body>
</html>

㈡ ASP+JS日历源代码

直接保存成 asp文件 运行就可以
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="http://purl.org/dc" rel="schema.DC" />
<title>日历</title
</head>
<body bgcolor="#FFFFFF">
<%
' 要调用的函数声明
'根据年份及月份得到每月的总天数
Function GetDaysInMonth(iMonth, iYear)
Select Case iMonth
Case 1, 3, 5, 7, 8, 10, 12
GetDaysInMonth = 31
Case 4, 6, 9, 11
GetDaysInMonth = 30
Case 2
If IsDate("February 29, " & iYear) Then
GetDaysInMonth = 29
Else
GetDaysInMonth = 28
End If
End Select
End Function
'得到一个月开始的日期.
Function GetWeekdayMonthStartsOn(dAnyDayInTheMonth)
Dim dTemp
dTemp = DateAdd("d", -(Day(dAnyDayInTheMonth) - 1), dAnyDayInTheMonth)
GetWeekdayMonthStartsOn = WeekDay(dTemp)
End Function
'得到当前一个月的上一个月.
Function SubtractOneMonth(dDate)
SubtractOneMonth = DateAdd("m", -1, dDate)
End Function
'得到当前一个月的下一个月.
Function AddOneMonth(dDate)
AddOneMonth = DateAdd("m", 1, dDate)
End Function
' 函数声明结束

Dim dDate ' 日历显示的日期
Dim iDOW ' 每一月开始的日期
Dim iCurrent ' 当前日期
Dim iPosition ' 表格中的当前位置

' 得到选择的日期并检查日期的合法性
If IsDate(Request.QueryString("date")) Then
dDate = CDate(Request.QueryString("date"))
Else
If IsDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Then
dDate = CDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year"))
Else
dDate = Date()

If Len(Request.QueryString("month")) <> 0 Or Len(Request.QueryString("day")) <> 0 Or Len(Request.QueryString("year")) <> 0 Or Len(Request.QueryString("date")) <> 0 Then
Response.Write "您所选择的日期格式不正确,系统会使用当前日期.<BR><BR>"
End If

End If
End If

'得到日期后我们先得到这个月的天数及这个月的起始日期.
iDIM = GetDaysInMonth(Month(dDate), Year(dDate))
iDOW = GetWeekdayMonthStartsOn(dDate)

%>
<table width="180" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="150" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5"> </td>
</tr>
</table>
<table width="180" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" colspan="7"><table border="0" cellpadding="0" cellspacing="0"width="100%">
<tr>
<td height="22" align="right"><a href="rl.asp?date=<%= SubtractOneMonth(dDate) %>"><img src="../images/dot_left.gif" width="15" height="14" border="0" /></a></td>
<td align="center"><font color="999999"><b><%= MonthName(Month(dDate)) & " " & Year(dDate) %></b></font></td>
<td><a href="rl.asp?date=<%= AddOneMonth(dDate) %>"><img src="../images/dot_right.gif" width="15" height="14" border="0" /></a></td>
</tr>
</table></td>
</tr>
<tr>
<td width="25" height="22" align="center"><font
color="d08c00"><b>日</b></font> </td>
<td width="25" align="center"><b><font color="999999">一</font></b> </td>
<td width="25" align="center"><b><font color="999999">二</font></b> </td>
<td width="25" align="center"><b><font color="999999">三</font></b> </td>
<td width="25" align="center"><b><font color="999999">四</font></b> </td>
<td width="25" align="center"><b><font color="999999">五</font></b> </td>
<td width="25" align="center"><b><font color="d08c00">六</font></b> </td>
</tr>
<%
' 如果这个月的起始日期不是周日的话就加空的单元.
If iDOW <> 1 Then
Response.Write vbTab & "<TR>" & vbCrLf
iPosition = 1
Do While iPosition < iDOW
Response.Write vbTab & vbTab & "<TD></TD>" & vbCrLf
iPosition = iPosition + 1
Loop
End If

' 绘制这个月的日历
iCurrent = 1
iPosition = iDOW
Do While iCurrent <= iDIM
' 如果是一行的开头就使用 TR 标记
If iPosition = 1 Then
Response.Write vbTab & "<TR>" & vbCrLf
End If

' 如果这一天是我们选择的日期就高亮度显示该日期.
If iCurrent = Day(dDate) Then
Response.Write vbTab & vbTab & "<TD BGCOLOR=#eeeeee height=18 align=center><B>" & iCurrent & "</B></TD>" & vbCrLf
Else
Response.Write vbTab & vbTab & "<TD height=18 align=center><A HREF=""./rl.asp?date=" & Month(dDate) & "-" & iCurrent & "-" & Year(dDate) & """>" & iCurrent & "</A></TD>" & vbCrLf
End If

' 如果满一周的话表格就另起一行
If iPosition = 7 Then
Response.Write vbTab & "</TR>" & vbCrLf
iPosition = 0
End If

iCurrent = iCurrent + 1
iPosition = iPosition + 1
Loop

' 如果一个月不是以周六结束则加上相应的空单元.
If iPosition <> 1 Then
Do While iPosition <= 7
Response.Write vbTab & vbTab & "<TD></TD>" & vbCrLf
iPosition = iPosition + 1
Loop
Response.Write vbTab & "</TR>" & vbCrLf
End If
%>
</table>
<table width="150" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5"> </td>
</tr>
</table></td>
</tr>
</table>

㈢ 能不能把VB的那个日历的源代码发给我我急用 我只有20财富 都给你了

有什么奖赏啊有经济支持的话我可以考虑一下到少上网费应该有吧呵呵 呵呵,帮帮忙吧,谢谢你 以下是网页阴历阳历的转换页面代码 提供出来供参考-

php小白,做的日历有源码,求大神帮看看问题在哪里,感激不尽

代码逻辑就有问题

你的sql循环遍历里截取了一次day应该是无用代码,下面把数据存入数组中写的键名 data 和前面写的date并不一样。你自己检查一下有没有问题。

另外 你的判断日期是否特殊日期的逻辑里,是根据数组索引 $i 来判断的,你能保证从数据库取出的数据是按天排序每天都有的吗?

一般做日期判断可以把数据拉出来按日期索引 ,这样后面日期判断的时候根据键名来判断就比较准确了。

//存入标志数组
$day_color[$row['date']]=true;

for(...){
$date=sprintf("%02d",$i);
if(!empty($day_color['2019-01-'.$date])){
...
}else{
...
}
}

㈤ 求java 日历的小程序的源代码

当在一段代码块定义一个变量时,Java就在栈中 为这个变量分配内存空间,当该变量退出该作用域后,Java会自动释放掉为该变量所分配的内存空间,该内存空间可以立即被另作他用。

Java内存分配中的堆

堆内存用来存放由new创建的对象和数组。 在堆中分配的内存,由Java虚拟机的自动垃圾回收器来管理。

㈥ 日历代码, 风格颜色


别人的网站上复制代码过来不就得咯

㈦ JS日历代码求助

不需要看js和css。只需要修改下面就可以了:
<inputid="selectdate"type="text"style="border:1pxsolid#999;"onClick="fPopCalendar(event,this,this)"onFocus="this.select()"/>
把上面的修改为:
<inputid="selectdate"type="text"style="border:1pxsolid#999;"onFocus="this.select()"/>
<inputtype="button"value="日期选择"onClick="fPopCalendar(event,document.getElementById('selectdate'),document.getElementById('selectdate'))"
就是在文本框后面加一个按钮,然后把文本框的点击事件放到按钮上来。
需要注意的是点击事件onClick="fPopCalendar(event,this,this)"里面的两个this,第一个this你可以不修改,它只是计算位置的,我把这两个this都换成了document.getElementById('selectdate'),单引号里是日期框的id值。这样修改后一个页面里每个日期输入框的id必须是唯一的,例如两个日期框是这样:
<inputid="selectdate"type="text"style="border:1pxsolid#999;"onFocus="this.select()"/>
<inputtype="button"value="日期选择"onClick="fPopCalendar(event,document.getElementById('selectdate'),document.getElementById('selectdate'))"
<inputid="selectdate2"type="text"style="border:1pxsolid#999;"onFocus="this.select()"/>
<inputtype="button"value="日期选择"onClick="fPopCalendar(event,document.getElementById('selectdate2'),document.getElementById('selectdate2'))"
再说一句,按钮太丑了,换个图片多好,我们项目是这样的

㈧ 谁有做好的百度空间的漂亮的日历代码

1》》》
#mod_cals .modbox——日历模块
#cals——日历主体背景、边框
#mod_cals .modbox td ——字体颜色设置
#m_cals——设置模块背景颜色
#m_cals div——背景设置
#cals .cal_body,#cals .cal_mth——除年月控制器外的日期部分,包括周和一般日期
#cals .cal_yr table——年、月表格
#cals .cal_yr td——*年、月单元格
#cals .cal_yr .cal_pre——上一月箭头(正常)
#cals .cal_yr .cal_nxt——下一月箭头(正常)
#cals .cal_yr .cal_pre_ovr——上一月箭头(鼠标悬停)
#cals .cal_yr .cal_nxt_ovr——下一月箭头(鼠标悬停)

2》》》

[font=Times New Roman]把以下代码插入最后一行即可!
#comm_info div.line{margin-top:8px;line-height:10px;border-top:2px solid #BBC1C6; background:url([/font][font=Times New Roman]http://www.hotik.com/sign.png) no-repeat bottom; padding-bottom: 100px; margin-bottom: 25px} [/font]

哪个都行!!

㈨ 求C语言编日历源代码的详细说明

/*
稍微改了下对齐格式,加了注释
*/
/*
1、闰年的算法:
如果某年能被4整除但不能被100整除,
或者能被400整除,
则该年是闰年.
用表达式表示就是
(year
%4
==
0
&&
year%100
!=
0)
||
(year%400
==
0)
2、计算某一天是星期几:
已知1900年的1月1号为星期一,
然后就可以用某一天和1900年的1月1号相差的天数对7取余来求星期,
本题是用的公元1年的1月1号作为基准
*/
#include
<stdio.h>
#include<conio.h>
#include<stdlib.h>
int
IsLeapYear(int);
//函数定义
void
main()
{
int
i;
int
day;
int
year;
int
temp;
int
temp_i;
long
int
Year_days
=
0;
int
Year_Start
=
1;
int
Per_Year_Days;
int
month_day[]={31,28,31,30,31,30,31,31,30,31,30,31,29};
printf("Please
enter
the
year:
");
scanf("%d",&year);
//输入年份
while(Year_Start
<
year)
//从公元1年开始执行while循环,
该年的一月一号为星期一
{
if(
IsLeapYear(
Year_Start
)
)
Per_Year_Days
=
366;
//如果是闰年,
则一年有366天
else
Per_Year_Days
=
365;
//如果不是闰年,
则一年有365天
Year_days
=
Year_days
+
Per_Year_Days;
//Year_days为从公元1年到输入年份的前一年的天数的总和
Year_Start++;
}
for(
temp
=
1;
temp
<=12;
temp++
)
//temp从1到12,
对应一年内12个月
{
switch(
temp
)
//用switch语句将temp和12个月对应起来
{
case
1:
printf("
January(%d)\n",year);
//一月
break;
case
2:
printf("
February(%d)\n",year);
//二月
break;
case
3:
printf("
March(%d)\n",year);
//三月
break;
case
4:
printf("
April(%d)\n",year);
//四月
break;
case
5:
printf("
May(%d)\n",year);
//五月
break;
case
6:
printf("
June(%d)\n",year);
//六月
break;
case
7:
printf("
July(%d)\n",year);
//七月
break;
case
8:
printf("
August(%d)\n",year);
//八月
break;
case
9:
printf("
September(%d)\n",year);
//九月
break;
case
10:
printf("
October(%d)\n",year);
//十月
break;
case
11:
printf("
November(%d)\n",year);
//十一月
break;
case
12:
printf("
December(%d)\n",year);
//十二月
break;
}
i
=
Year_days
%
7;
//每个星期有7天,
故用每年的天数对7取余
printf("Mon\tTue\tWed\tThu\tFri\tSat\tSun\n");
if(
i
!=
0
)
//如果余数不为零
for(
temp_i
=
0;
temp_i
<
i;
temp_i++)
printf("\t");
//则打印空格(这里用\t代替空格,
更加美观),
空格数为i
day
=
1;
//初始化day为1,
为下面的while循环做准备
if(
IsLeapYear(year)
&&
temp
==
2)
//如果输入的年份是闰年,
并且月份为2
while(
day
<=
month_day[12]
)
//day为一循环变量,
取值为1-365(闰年的话为1-366)
{
if(
day
>1
)
//如果天数大于一
if(
Year_days
%
7
==
0
)
//如果是星期日,
则换行
printf("\n");
if(
day
>=
10
)
printf("%d\t",day);
//打印天数+空格
else
printf("%d\t",day);
Year_days++;
day++;
}
else
//如果不满足"输入的年份是闰年,
并且月份为2"
while
(day
<=
month_day[temp-1])
{
if(
day
>
1
)
if(
Year_days
%
7
==
0
)
printf("\n");
if(
day
>=10
)
printf("%d\t",day);
else
printf("%d\t",day);
Year_days++;
day++;
}
printf("\n");
if(
getch()
==
'q'
)
//如果输入为q,
则退出程序
exit(0);
}
getch();
//每按一次键,
打印一个月份
}
int
IsLeapYear(
int
year
)
{
//判断是否是闰年,
是则返回1,
否则返回0
if
((year
%4
==
0)
&&
(year
%
100
!=
0)
||
(year
%
400
==
0)
)
return
1;
else
return
0;
}

㈩ 日历表制作的源代码

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>一个很漂亮实用的日历</title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
//创建一个数组,用于存放每个月的天数
function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11)
{
this[0] = m0;
this[1] = m1;
this[2] = m2;
this[3] = m3;
this[4] = m4;
this[5] = m5;
this[6] = m6;
this[7] = m7;
this[8] = m8;
this[9] = m9;
this[10] = m10;
this[11] = m11;
}
//实现月历
function calendar() {
var monthNames = "";
var today = new Date();
var thisDay;
var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
year = today.getYear() +1900;
thisDay = today.getDate();
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29;
nDays = monthDays[today.getMonth()];
firstDay = today;
firstDay.setDate(1);
testMe = firstDay.getDate();
if (testMe == 2) firstDay.setDate(0);
startDay = firstDay.getDay();
document.write("<div id='rili' style='position:absolute;width:140px;left:300px;top:100px;'>")
document.write("<TABLE width='217' BORDER='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#0080FF'>")
document.write("<TR><TD><table border='0' cellspacing='1' cellpadding='2' bgcolor='Silver'>");
document.write("<TR><th colspan='7' bgcolor='#C8E3FF'>");
var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
var monthNames = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var now = new Date();
document.writeln("<FONT STYLE='font-size:9pt;Color:#330099'>" + "公元 " + now.getYear() + "年" + monthNames[now.getMonth()] + " " + now.getDate() + "日 " + dayNames[now.getDay()] + "</FONT>");
document.writeln("</TH></TR><TR><TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>日</FONT></TH>");
document.writeln("<th bgcolor='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>一</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>二</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>三</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>四</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>五</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>六</FONT></TH>");
document.writeln("</TR><TR>");
column = 0;
for (i=0; i<startDay; i++) {
document.writeln("\n<TD><FONT STYLE='font-size:9pt'> </FONT></TD>");
column++;
}
for (i=1; i<=nDays; i++) {
if (i == thisDay) {
document.writeln("</TD><TD ALIGN='CENTER' BGCOLOR='#FF8040'><FONT STYLE='font-size:9pt;Color:#ffffff'><B>")
}
else {
document.writeln("</TD><TD BGCOLOR='#FFFFFF' ALIGN='CENTER'><FONT STYLE='font-size:9pt;font-family:Arial;font-weight:bold;Color:#330066'>");
}
document.writeln(i);
if (i == thisDay) document.writeln("</FONT></TD>")
column++;
if (column == 7) {
document.writeln("<TR>");
column = 0;
}
}
document.writeln("<TR><TD COLSPAN='7' ALIGN='CENTER' VALIGN='TOP' BGCOLOR='#0080FF'>")
document.writeln("<FORM NAME='clock' onSubmit='0'><FONT STYLE='font-size:9pt;Color:#ffffff'>")
document.writeln("现在时间:<INPUT TYPE='Text' NAME='face' ALIGN='TOP'></FONT></FORM></TD></TR></TABLE>")
document.writeln("</TD></TR></TABLE></div>");
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;}
//显示当前时间
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = " " + ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " 下午 " : " 上午 "
document.clock.face.value = timeValue;
timerID = setTimeout("showtime()",1000);//设置超时,使时间动态显示
timerRunning = true;}
function startclock () {
stopclock();
showtime();}
</SCRIPT>
</head>
<body onLoad="startclock(); timerONE=window.setTimeout">
<script language="JavaScript" type="text/javascript">
<!--
calendar();
//-->
</script>
</body>
</html>

热点内容
聊天软件编程 发布:2024-09-17 03:00:07 浏览:725
linuxoracle安装路径 发布:2024-09-17 01:57:29 浏览:688
两个安卓手机照片怎么同步 发布:2024-09-17 01:51:53 浏览:207
cf编译后没有黑框跳出来 发布:2024-09-17 01:46:54 浏览:249
安卓怎么禁用应用读取列表 发布:2024-09-17 01:46:45 浏览:524
win10设密码在哪里 发布:2024-09-17 01:33:32 浏览:662
情逢敌手迅雷下载ftp 发布:2024-09-17 01:32:35 浏览:337
安卓如何让软件按照步骤自动运行 发布:2024-09-17 01:28:27 浏览:197
Z包解压命令 发布:2024-09-17 01:27:51 浏览:221
吉林ipfs存储服务器云主机 发布:2024-09-17 01:27:38 浏览:685