PDA

View Full Version : Basic calendar questions



bre
11-13-2004, 01:18 AM
Love the Basic calendar. Thanks.

And now the questions.

Is there a way to have the one year script start at current month and go forward one year from there? It's currently showing November 2004 and can only view up to December 2004. I'd like to be able to view current month and on only, like Nov 2004, Dec 2004, Jan 2005, etc.

Can this calendar be sized? I have columns on the side of my page and it is too big and stretching the column. I need it a little less wide if possible. I know a little (very little) php and JS.

Thanks for any help.

ddadmin
11-16-2004, 04:54 AM
.

Do you mean in the sequential display, to cross over a year when showing 3 calendar months all at once, for example?

Regarding 2nd question, all of the calendar's visuals is controlled in the CSS code of step 1 as far as I can tell. If you know CSS, you should be able to manipulate its dimensions any way you want really.

bre
11-16-2004, 11:25 AM
http://bayridge.com/calendar

I mean in the yearly view with the drop down box.

ddadmin
11-16-2004, 10:40 PM
Ok, technically this is possible, though the current code for the drop down calendar doesn't allow this easily. I'll consider updating this script in the near future for this. Just to clarify, you're simply looking for the script to present two years at once in the drop down menu, the current year and +1?

bre
11-21-2004, 03:59 PM
Not exactly. I just want to show 1 year from current month. Or even just 6 months. For instance, if someone was looking at the calendar now, it would show 12 months starting with Nov 2004 going to Oct 2005. The way it is now shows Jan 2004 to Dec 2004. I really don't care about past dates, I just want to see current and future months. FOr 6 months , it would show Nov 2004 to Apr 2005.

The purpose of it is to allow people to look at a calendar while they are entering events into my community event calendar. Surely they aren't going to enter an event for a past date, so there's no reason to show them.

ddadmin
11-23-2004, 03:26 AM
Ok, I had some time on my hand, so here's a modified script that displays the calendar for the current month all the way up to the next 6 months of the next year:


<form>
<select onChange="updatecalendar(this.options)">
<script type="text/javascript">

var themonths=['January','February','March','April','May','June',
'July','August','September','October','November','December']

var todaydate=new Date()
var curmonth=i=todaydate.getMonth()+1 //get current month (1-12)
var curyear=todaydate.getFullYear() //get current year
var nextyear=curyear+1

function updatecalendar(theselection, theyear){
var themonth=parseInt(theselection[theselection.selectedIndex].value)+1
var theyear=theselection[theselection.selectedIndex].getAttribute("year")
var calendarstr=buildCal(themonth, theyear, "main", "month", "daysofweek", "days", 0)
if (document.getElementById)
document.getElementById("calendarspace").innerHTML=calendarstr
}

document.write('<option value="'+(curmonth-1)+'" year="'+curyear+'" selected="yes">Current Month</option>')

while (i<12){
document.write('<option value="'+i+'" year="'+curyear+'">'+themonths[i]+' '+curyear+'</option>')
i++
}

var x=0

while (x<6){
document.write('<option value="'+x+'" year="'+nextyear+'">'+themonths[x]+' '+nextyear+'</option>')
x++
}


</script>
</select>

<div id="calendarspace">
<script>
//write out current month's calendar to start
document.write(buildCal(curmonth, curyear, "main", "month", "daysofweek", "days", 0))
</script>
</div>

</form>

Simply use the above instead of the current form code you have for the calendar, and it should work.

bre
11-23-2004, 06:16 PM
Way to go boss. Looks great, thanks a lot.

focallength
12-27-2004, 08:04 AM
I too, have found the Basic Calendar to be quite helpful. I have one question. Is there a way to have certain dates appear as a separate color? For example, if November 23, 2005 is unavailable, is there a way for that date to appear in red and all the available dates to appear in black? Thanks for the help.

rescue271
11-03-2005, 04:24 AM
Love The basic calendar
http://www.dynamicdrive.com/dynamicindex7/basiccalendar.htm

I was just wondering How I could position In a certin spot ( Like the bottom left or right of the webpage )
I also would like to do the same with the Live clock
http://www.dynamicdrive.com/dynamicindex6/clock2.htm