導航:首頁 > 源碼編譯 > 日歷源碼

日歷源碼

發布時間:2022-01-15 06:54:23

㈠ 日歷代碼

萬年歷代碼:
<iframe
src="http://freefilehosting.net/file/?id=pdnxl6re"
width="509"
height=433
marginwidth="0"
marginheight="0"
hspace="0"
vspace="0"
frameborder="0"
scrolling="no"></iframe>
老黃歷的源代碼:
<IFRAME
style="BORDER-RIGHT:
#000000
1px
dotted;
BORDER-TOP:
#000000
1px
dotted;
BORDER-LEFT:
#000000
1px
dotted;
BORDER-BOTTOM:
#000000
1px
dotted"
border=0
name=nongli
marginHeight=0
src="http://www.nongli.com/todaylhl.htm"
frameBorder=no
width=149
scrolling=no
height=140></IFRAME>
最新日歷代碼(包括日歷、星期、現在時間)
<IFRAME
border=0
name=www1.xise.cn
align=center
marginWidth=0
marginHeight=0
src="http://www1.xise.cn/rili/sj.htm"
frameBorder=0
width=146
scrolling=no
height=183></IFRAME>
代碼一:<IFRAME
style="BORDER-RIGHT:
#000000
1px
dotted;
BORDER-TOP:
#000000
1px
dotted;
BORDER-LEFT:
#000000
1px
dotted;
BORDER-BOTTOM:
#000000
1px
dotted"
border=0
name=nongli
marginHeight=0
src="http://www.nongli.com/todaylhl.htm"
frameBorder=no
width=149
scrolling=no
height=140></IFRAME>
代碼二:<iframe
name="jiro23"
src="http://astro.sina.com.cn/calendar1.htm"
width="500"
height="500"></iframe>
代碼三:<iframe
scrolling=no
height=170
width=165
frameborder=0
marginHeight=0
marginWidth=0
src=http://home.id666.com/user/420009598/disk/webdisk/55.html></iframe>
具體步驟是:復制代碼---管理博客-----新增空白面板-----鉤選顯示源代碼(出現鉤號,同時文檔里出現DIV的字樣)----粘貼代碼----鉤選顯示源代碼(鉤號消失)-----保存新增面板----定製個人首頁----選取新增個人面板----保存設置

㈡ 求日歷的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>

㈢ 求論壇日歷JS代碼

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建網頁 8</title>
<script language="javascript">
function calendar(month,year){
var today;
var len = calendar.arguments.length;
if(len == 2){
this.month = calendar.arguments[0];
this.year = calendar.arguments[1];
}
else{
today = new Date();
this.month = today.getMonth();
this.year = today.getYear();
}
this.displayM = displayMonth;
this.displayW = displayWeek;
this.displayD = displayDay;
this.displayY = displayYear;
this.sele1 = select1;
this.sele2 = month1;
}
function displayYear(year){
var ttt;
ttt=document.getElementById("year");
ttt.innerText=year;
}
function displayMonth(month){

var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");

var ttt;
var nnn;

ttt=document.getElementById("month");
ttt.innerText=months[month];

}
function displayWeek(month,year)
{
var days = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
var i;
var tablenew;
var trnew;
tablenew = document.getElementById("table1");

trnew = tablenew.insertRow(0);
for(i=0;i<7;i++){
tdnew=trnew.insertCell(i);
tdnew.innerText=days[i];
}
}
function displayDay(month,year){
var days;
var day;
var d;
var todayw;
var table1;
var rows;
var cells;
var i,k,crows,c;
rows=1
// alert(month);
table1 = document.getElementById("table1");
d = new Date(year,month,1);
todayw = d.getDay();
//alert(month);
// alert(todayw);
if(month==0){
days=31;
}

switch (month){
case "0": days=31;
break;

case "1": days=runnian(year);
break;
case "2": days=31;
break;
case "3": days=30;
break;
case "4": days=31;
break;
case "5": days=30;
break;
case "6": days=31;
break;
case "7": days=31;
break;
case "8": days=30;
break;
case "9": days=31;
break;
case "10": days=30;
break;
case "11": days=31;
break;
}
// alert(days);
if(table1.rows.length>=5){
k=table1.rows.length;
k=k-2;
k=k*7;
for(i=0;i<k;i++){
c=i%7;
//alert(c);
table1.rows[rows].cells[c].innerText="";
t=i+1;
c=t%7;
if(c==0){
rows=rows+1;
}
}
for(i=0;i<table1.rows[rows].cells.length;i++){
table1.rows[rows].cells[i].innerText="";
}
if((todayw+days)>(k+table1.rows[rows].cells.length)){
// alert("ttt");
rows=1;
for(i=1;i<=k;i++){
c=(todayw+i-1)%7;
// alert(i);
table1.rows[rows].cells[c].innerText=i;
c=(todayw+i)%7;
if(c==0){
rows=rows+1;
}
}
if(table1.rows[rows].cells.length!=6){
for(j=0;j<table1.rows[rows].cells.length;j++){

table1.rows[rows],cells[j].innerText=i;
i++;
}
trnew=table1.rows[rows];
for(j=k+table1.rows[rows].cells.length+1;j<todayw+days;j++){
c=j%7;
tdnew=trnew.insertCell[c];
tdnew.innerText=j;
c=(j+1)%7;
if((c==0)&&(j!=(todayw+days))){
rows=rows+1;
}
}
}
else{
rows=rows+1;
trnew=table1.insertRow[rows];
for(j=k+table1.rows[rows].cells.length+1;j<=todayw+days;j++){
c=j%7;
tdnew=trnew.insertCell[c];
//alert(j);
tdnew.innerText=j;
c=(j+1)%7;
if((c==0)&&(j!=(todayw+days))){
rows=rows+1;
}
}
}
}
else{
rows=1;
//alert(todayw);
//alert(days);

for(i=todayw;i<todayw+days;i++){
c=i%7;
// alert(i);
table1.rows[rows].cells[c].innerText=i-todayw+1;
c=(i+1)%7;
if(c==0){
rows=rows+1;
}
}
}
}

else{
trnew = table1.insertRow(1)
for(i=0;i<todayw;i++){
trnew.insertCell(i);
}
cells=todayw;
for(i=1;i<=days;i++){

tdnew=trnew.insertCell(cells);
tdnew.innerText=i;
todayw1=todayw+i;
// alert(todayw1);
if(todayw1%7){
cells++;
}
else{
rows=rows+1;
cells=0
var trnew=table1.insertRow(rows);
}
}
}
}
function select1(year){
for(i=1980;i<=2050;i++){
var oOption = document.createElement("OPTION");
oOption.text=i;
oOption.value=i;
if(year==i){
oOption.selected=true;
}
oSelect1 = document.getElementById("yearsel");
oSelect1.add(oOption);
}
}
function month1(month){
for(i=0;i<12;i++){
var oOption = document.createElement("OPTION");
oOption.text=i+1;
oOption.value=i;
if(month==i){
oOption.selected=true;
}
oSelect1 = document.getElementById("monthsel");
oSelect1.add(oOption);
}
}
function runnian(year){
var year1,year2;
year1 = year%100;
year2 = year%4;
if(year1==0){
if(year2==0)
return 29;
else
return 28;
}
else{
if(year2==0)
return 29;
else
return 28;
}
}

function init(){
cal = new calendar();
cal.displayM(cal.month);
cal.displayW();
cal.displayY(cal.year);
cal.displayD(cal.month,cal.year);
cal.sele1(cal.year);
cal.sele2(cal.month);
// delete(cal);
}
function yearchange(){
getyear = document.getElementById("yearsel");
getmonth = document.getElementById("monthsel");
for(i=0;i<getyear.options.length;i++){
if(getyear.options[i].selected==1){
theyear = getyear.options[i].value;
}
}
for(i=0;i<getmonth.options.length;i++){
if(getmonth.options[i].selected==1){
themonth = getmonth.options[i].value;
}
}

cal = new calendar(themonth,theyear);
cal.displayY(cal.year);
cal.displayM(cal.month);
cal.displayD(themonth,cal.year);
}

</script>
</head>

<body onload="init()">
<span id=month></span><span id=year></span>
<table id=table1>

</table>
<SELECT ID="yearsel" onchange="yearchange()">

</SELECT>
<select id="monthsel" onchange="yearchange()">
</select>
</body>

</html>

㈣ 求用C++日歷源代碼

那更簡單,改好了

#include <stdio.h>
#include<conio.h>
#include<stdlib.h>
int IsLeapYear(int);
void main()
{
int i;
int day;
int year;
int month;
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);
//printf("Please enter the month, enter 0 for the whole year: ");
//scanf("%d",&month);
month=0;
while(Year_Start < year)
{
if( IsLeapYear( Year_Start ) )
Per_Year_Days = 366;
else
Per_Year_Days = 365;

Year_days = Year_days + Per_Year_Days;
Year_Start++;
}

for( temp = 1; temp <=12 && (month*(temp-1)==0); temp++ )
{
if (month!=0) temp=month;
switch(temp)
{
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;
printf(" Mon Tue Wed Thu Fri Sat Sun\n");
if( i != 0 )
for( temp_i = 0; temp_i < i*4; temp_i++)
printf(" ");
day = 1;
if( IsLeapYear(year) && temp == 2)
while( day <= month_day[12] )
{
if( day >1 )
if( Year_days % 7 == 0 )
printf("\n");
if( day >= 10 )
printf("%4d",day);
else
printf("%4d",day);
Year_days++;
day++;
}

else
while (day <= month_day[temp-1])
{
if( day > 1 )
if( Year_days % 7 == 0 )
printf("\n");
if( day >=10 )
printf("%4d",day);
else
printf("%4d",day);
Year_days++;
day++;
}
printf("\n");
if( getch() == 'q' )
exit(0);
}
getch();
}

int IsLeapYear( int year )
{
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>

㈥ 求Java 日歷的小程序的源代碼

當在一段代碼塊定義一個變數時,Java就在棧中 為這個變數分配內存空間,當該變數退出該作用域後,Java會自動釋放掉為該變數所分配的內存空間,該內存空間可以立即被另作他用。

Java內存分配中的堆

堆內存用來存放由new創建的對象和數組。 在堆中分配的內存,由Java虛擬機的自動垃圾回收器來管理。

㈦ 求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;
}

㈧ 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、結束日期1,事件內容1...;
起始日期2、結束日期2,事件內容2...;
... ...

一般日期表達方式有:字元串、長整數、日期時間格式
具體的資料庫操作就是用一條sql語句添加一條數據記錄,可以多次添加,也可以一次添加多條。
添加記錄的SQL語句為insert.語法大同小異。

使用不同的編程語言,源代碼的差別很大

㈩ 日歷效果的網頁代碼要怎麼做

網上找的:

<!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>
<title>博客專用的JS日歷控制項</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<style type="text/css">
.Calendar {
font-family:Verdana;
font-size:9pt;
background-color:#EEE;
text-align:center;
width:198px;
height:158px;
padding:10px;
line-height:1.5em;
}
.Calendar a{
color:#0066CC;
}
.Calendar table{
width:100%;
border:0;
}
.Calendar table thead{color:#acacac;}
.Calendar table td {
font-size: 11px;
padding:1px;
}
#idCalendarPre{
cursor:pointer;
float:left;
padding-right:5px;
}
#idCalendarNext{
cursor:pointer;
float:right;
padding-right:5px;
}
#idCalendar td.onToday {
font-weight:bold;
color:#C60;
}
#idCalendar td.onSelect {
font-weight:bold;
}
</style>
<script type="text/javascript">
var $ = function (id) {
return "string" == typeof id ? document.getElementById(id) : id;
};
var Class = {
create: function() {
return function() {
this.initialize.apply(this, arguments);
}
}
}
Object.extend = function(destination, source) {
for (var property in source) {
destination[property] = source[property];
}
return destination;
}
var Calendar = Class.create();
Calendar.prototype = {
initialize: function(container, options) {
this.Container = $(container);//table結構容器
this.Days = [];//日期列表
this.SetOptions(options);
this.Year = this.options.Year;
this.Month = this.options.Month;
this.SelectDay = this.options.SelectDay ? new Date(this.options.SelectDay) : null;
this.onSelectDay = this.options.onSelectDay;
this.onToday = this.options.onToday;
this.onFinish = this.options.onFinish;
this.Draw();
},

SetOptions: function(options) {
this.options = {//默認值
Year: new Date().getFullYear(),
Month: new Date().getMonth() + 1,
SelectDay: null,//選擇日期
onSelectDay: function(){},
onToday: function(){},
onFinish: function(){}
};
Object.extend(this.options, options || {});
},
//上月
PreMonth: function() {
//取得上月日期對象
var d = new Date(this.Year, this.Month - 2, 1);
//設置屬性
this.Year = d.getFullYear();
this.Month = d.getMonth() + 1;
//重繪日歷
this.Draw();
},
//下一個月
NextMonth: function() {
var d = new Date(this.Year, this.Month, 1);
this.Year = d.getFullYear();
this.Month = d.getMonth() + 1;
this.Draw();
},

Draw: function() {
//保存日期列表
var arr = [];
//用當月第一天在一周中的日期值作為當月離第一天的天數
for(var i = 1, firstDay = new Date(this.Year, this.Month - 1, 1).getDay(); i <= firstDay; i++){ arr.push(" "); }
//用當月最後一天在一個月中的日期值作為當月的天數
for(var i = 1, monthDay = new Date(this.Year, this.Month, 0).getDate(); i <= monthDay; i++){ arr.push(i); }
// /
var frag = document.createDocumentFragment();
this.Days = [];
while(arr.length > 0){
//每個星期插入一個tr
var row = document.createElement("tr");
//星期
for(var i = 1; i <= 7; i++){
var cell = document.createElement("td");
cell.innerHTML = " ";
if(arr.length > 0){
var d = arr.shift();
cell.innerHTML = d;
if(d > 0){
this.Days[d] = cell;
//獲取今日
if(this.IsSame(new Date(this.Year, this.Month - 1, d), new Date())){ this.onToday(cell); }
//判斷用戶是否作了選擇
if(this.SelectDay && this.IsSame(new Date(this.Year, this.Month - 1, d), this.SelectDay)){ this.onSelectDay(cell); }
}
}
row.appendChild(cell);
}
frag.appendChild(row);
}
//此先清空然後再插入(ie的table不能用innerHTML)
while(this.Container.hasChildNodes()){ this.Container.removeChild(this.Container.firstChild); }
this.Container.appendChild(frag);
this.onFinish();
},
//判斷是否同一日
IsSame: function(d1, d2) {
return (d1.getFullYear() == d2.getFullYear() && d1.getMonth() == d2.getMonth() && d1.getDate() == d2.getDate());
}
};
</script>
</head>
<body>
<div class="Calendar">
<div id="idCalendarPre"><<</div>
<div id="idCalendarNext">>></div>
<span id="idCalendarYear">2008</span>年 <span id="idCalendarMonth">8</span>月
<table cellspacing="0">
<thead>
<tr>
<td>日</td>
<td>一</td>
<td>二</td>
<td>三</td>
<td>四</td>
<td>五</td>
<td>六</td>
</tr>
</thead>
<tbody id="idCalendar">
</tbody>
</table>
</div>
<script language="JavaScript">
var cale = new Calendar("idCalendar", {
SelectDay: new Date().setDate(10),
onSelectDay: function(o){ o.className = "onSelect"; },
onToday: function(o){ o.className = "onToday"; },
onFinish: function(){
$("idCalendarYear").innerHTML = this.Year; $("idCalendarMonth").innerHTML = this.Month;
var flag = [10,15,20];
for(var i = 0, len = flag.length; i < len; i++){
this.Days[flag[i]].innerHTML = "<a href='javascript:void(0);' onclick=\"alert('您選擇的日期是:"+this.Year+"/"+this.Month+"/"+flag[i]+"');return false;\">" + flag[i] + "</a>";
}
}
});
$("idCalendarPre").onclick = function(){ cale.PreMonth(); }
$("idCalendarNext").onclick = function(){ cale.NextMonth(); }
</script>
</body>
</html>

閱讀全文

與日歷源碼相關的資料

熱點內容
視頻監控取消默認加密 瀏覽:294
雲伺服器怎麼設置輸入鍵盤 瀏覽:817
單片機支持多大mhz 瀏覽:42
linux啟動mysql命令 瀏覽:792
編程和游戲買什麼筆記本 瀏覽:902
程序員座點陣圖片大全 瀏覽:142
aix重啟命令 瀏覽:460
騰訊雲伺服器的後台 瀏覽:47
安卓怎麼定時打開軟體 瀏覽:597
笨手機應用加密怎麼刪除 瀏覽:97
為什麼vc6編譯是灰色 瀏覽:389
python音標讀法 瀏覽:577
反轉語句python 瀏覽:23
哪個app搞英雄聯盟手游活動 瀏覽:585
如何查看郵箱收發伺服器 瀏覽:521
極簡歐洲史中文版pdf 瀏覽:908
python顯示變數值 瀏覽:387
副路由器為什麼要關伺服器 瀏覽:575
國家反詐騙app蘋果怎麼設置 瀏覽:464
我的世界如何用指令造伺服器方熊 瀏覽:305