wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes disabling weekend dates in calender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "disabling weekend dates in calender" Watch "disabling weekend dates in calender" New topic
Author

disabling weekend dates in calender

pankaj upreti
Greenhorn

Joined: Nov 28, 2011
Posts: 3
I have datetimepicker.js inside this I have a function through which a calender opens. I want to disable weekend dates in this calender . How do I do that?

this is the function can somebody help.? the calender is a date time picker type of calender of jsp


function NewCal(pCtrl, pFormat, pShowTime, pTimeMode) {
Cal = new Calendar(dtToday);
if ((pShowTime != enter code here null) && (pShowTime)) {
Cal.ShowTime = true;
if ((pTimeMode != null) && ((pTimeMode == '12') || (pTimeMode == '24'))) {
TimeMode = pTimeMode;
}
}
if (pCtrl != null) Cal.Ctrl = pCtrl;
if (pFormat != null) Cal.Format = pFormat.toUpperCase();

exDateTime = document.getElementById(pCtrl).value;
if (exDateTime != "") //Parse Date String
{
var Sp1;
var Sp2;
var tSp1;
var tSp1;
var strMonth;
var strDate;
var strYear;
var intMonth;
var YearPattern;
var strHour;
var strMinute;
var strSecond;
//parse month
Sp1 = exDateTime.indexOf(DateSeparator, 0)
Sp2 = exDateTime.indexOf(DateSeparator, (parseInt(Sp1) + 1));

if ((Cal.Format.toUpperCase() == "DDMMYYYY") || (Cal.Format.toUpperCase() == "DDMMMYYYY")) {
strMonth = exDateTime.substring(Sp1 + 1, Sp2);
strDate = exDateTime.substring(0, Sp1);
} else if ((Cal.Format.toUpperCase() == "MMDDYYYY") || (Cal.Format.toUpperCase() == "MMMDDYYYY")) {
strMonth = exDateTime.substring(0, Sp1);
strDate = exDateTime.substring(Sp1 + 1, Sp2);
}
if (isNaN(strMonth)) intMonth = Cal.GetMonthIndex(strMonth);
else intMonth = parseInt(strMonth, 10) - 1;
if ((parseInt(intMonth, 10) >= 0) && (parseInt(intMonth, 10) < 12)) Cal.Month = intMonth;

if ((parseInt(strDate, 10) <= Cal.GetMonDays()) && (parseInt(strDate, 10) >= 1)) Cal.Date = strDate;
strYear = exDateTime.substring(Sp2 + 1, Sp2 + 5);
YearPattern = /^\d{4}$/;
if (YearPattern.test(strYear)) Cal.Year = parseInt(strYear, 10);
if (Cal.ShowTime == true) {
tSp1 = exDateTime.indexOf(":", 0)
tSp2 = exDateTime.indexOf(":", (parseInt(tSp1) + 1));
strHour = exDateTime.substring(tSp1, (tSp1) - 2);
Cal.SetHour(strHour);
strMinute = exDateTime.substring(tSp1 + 1, tSp2);
Cal.SetMinute(strMinute);
strSecond = exDateTime.substring(tSp2 + 1, tSp2 + 3);
Cal.SetSecond(strSecond);
}
}
winCal = window.open("", "DateTimePicker", "toolbar=0,status=0,menubar=0,fullscreen=no,width=195,height=245,resizable=0,top=" + cnTop + ",left=" + cnLeft);
docCal = winCal.document;
RenderCal();
}
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

You might consider using this


Learning some thing New Every Day
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: disabling weekend dates in calender