JSP日历控件

2022-10-08 14:27:16   第一文档网     [ 字体: ] [ 阅读: ] [ 文档下载 ]
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。下载word有问题请添加QQ:admin处理,感谢您的支持与谅解。点击这里给我发消息

#第一文档网# 导语】以下是®第一文档网的小编为您整理的《JSP日历控件》,欢迎阅读!
控件,日历,JSP

<link rel="stylesheet" type="text/css" media="all" href="img2/calendar-win2k-cold-2.css" title="win2k-cold-2" />

<script type="text/javascript" src="img2/calendar.js"></script>

<script type="text/javascript" src="img2/calendar-zh.js"></script>

<script language="javascript" >

function doAction ( action )

{

document.theform.action.value = action ;

document.theform.submit() ;

}

function doSearch( method )

{

document.searchform.detail.value = method ;

document.searchform.submit() ;

}

var oldLink = null;

function selected(cal, date) {

cal.sel.value = date; // just update the date in the input field.

if (cal.dateClicked && (cal.sel.id == "sel1" || cal.sel.id == "sel3"))

cal.callCloseHandler();

}

function closeHandler(cal) {

cal.hide(); // hide the calendar

// cal.destroy();

calendar = null;

}

function showCalendar(id, format, showsTime, showsOtherMonths) {

var el = document.getElementById(id);

if (calendar != null) {

// we already have some calendar created

calendar.hide(); // so we hide it first.

} else {

var cal = new Calendar(true, null, selected, closeHandler);

if (typeof showsTime == "string") {

cal.showsTime = true;

cal.time24 = (showsTime == "24");

}

if (showsOtherMonths) {

cal.showsOtherMonths = true;

}

calendar = cal; // remember it in the global var

cal.setRange(1900, 2070); // min/max year allowed.

cal.create();

}

calendar.setDateFormat(format); // set the specified date format

calendar.parseDate(el.value); // try to parse the text in field

calendar.sel = el; // inform it what input field we use

// the reference element that we pass to showAtElement is the button that

// triggers the calendar. In this example we align the calendar bottom-right

// to the button.

calendar.showAtElement(el.nextSibling, "Br"); // show the calendar

return false;

}

var MINUTE = 60 * 1000;

var HOUR = 60 * MINUTE;

var DAY = 24 * HOUR;

var WEEK = 7 * DAY;

function isDisabled(date) {

var today = new Date();

return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;

}

</script>

<input type=text readonly size=12 name="f_date" id=start value="<%=fbrq%>"><input type="reset" value="选择" onclick="return showCalendar('start', '%Y-%m-%d %H:%M', '24', true);">

本文来源:https://www.dywdw.cn/9a0636307f1922791788e802.html

相关推荐
推荐阅读