Results 1 to 9 of 9

Thread: Basic calendar questions

  1. #1
    Join Date
    Nov 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Basic calendar questions

    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.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.

    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.

  3. #3
    Join Date
    Nov 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    http://bayridge.com/calendar

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

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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?

  5. #5
    Join Date
    Nov 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    <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.

  7. #7
    Join Date
    Nov 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Way to go boss. Looks great, thanks a lot.

  8. #8
    Join Date
    Dec 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  9. #9
    Join Date
    Nov 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Basic Calendar

    Love The basic calendar
    http://www.dynamicdrive.com/dynamici...iccalendar.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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •