Results 1 to 6 of 6

Thread: Show 12 months of calendar

  1. #1
    Experienced user
    Join Date
    06-10-09.
    Location
    Atlanta, Georgia
    Posts
    611

    Default Show 12 months of calendar

    I'm looking to display 12 months at a time, like what you see here: http://www.watershedcabins.com/reservations.phtml. I'm redesigning a website that I built many years ago and am trying to come up with a clever way to streamline the rate calendar. My plan is to have 3 event archives to represent the yellow, blue and green rates. Days without an "event" will simply be brown.

    So ... do you know of a way to list 12 calendars at once? Or, do you have any ideas on a decent solution to this? On the existing site, my client uses a wysiwyg editor to change the dates each year and he manually changes the bg color of each cell. I figured using the calendar and setting the bg color for .cal_2, etc.

    Thanks for any tips / ideas you all can offer.

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Atlanta, Georgia
    Posts
    611

    Default Re: Show 12 months of calendar

    One other idea (that I could use some pointers on) is to display only one month at a time. When someone goes to the next or previous month, the new data could be loaded with Ajax. Has anyone done this or know of any pointers to get me started? I'm aware of Andreas' Ajax class. I just don't know how to get started with this.

  3. #3
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Show 12 months of calendar

    On a site I did recently, I created a dropdown box with a list of months that a user could select to filter by month.
    *This isn't done with ajax so might not be of use*


    http://www.connect-elim.org.uk/index...tml?day=201011

    Don't know if this will be of any help to you

    Code:
    <?php 
    if (isset($_GET['month'])) { 
    $month = $_GET['month'];
    $year = $_GET['year'];
    header("Location: /index.php/calendar.html?day=$year$month");
    exit;
    } else {
    ?>
    <div class="caldropdown">
    <form method="get" action="<?php echo $PHP_SELF;?>" id="dateselect">
    <?php
    $viewingmonth = substr($_GET['day'], 4, 2);
    $months = array ('', 'January', 'February', 'March', 'April', 'May', 'June','July', 'August', 'September', 'October', 'November', 'December');
    $monthnum = array ('', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
    $monthrange = range (1, 12);
    $weekday = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
    
    $currentMonth = date('m');
    $currentYear = date('Y');
    $next2years = date('Y')+2;
    $years = range ($currentYear, $next2years);
    $i = 0;
    
    echo "Month: <select name='month'>";
    foreach ($monthrange as $value) {
        if($monthnum[$value] == $viewingmonth && $i == 0): 
                $default = ' selected="yes"';
                $i++;
            elseif ($monthnum[$value] == $currentMonth && $i == 0):
                $default = ' selected="yes"';
            else: 
                $default = '';
        endif;
        
      echo '<option'.$default.' value="'.$monthnum[$value].'">'.$months[$value].'</option>\n';
    } 
    echo '</select>';
    
    echo " Year: <select name='year'>";
    foreach ($years as $value) {
        if($value == $currentYear):
                $default = ' selected="yes"';
                else: $default = '';
            endif;
        echo '<option '.$default.' value="'.$value.'">'.$value.'</option>\n';
    } 
    ?>
    <input type="submit" value="View" />
    </form>
    </div>
    <?php } ?>
    It's could probably do with some editing as I'm no pro at coding but it works for me ok.

  4. #4
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Show 12 months of calendar

    Have a look here Ben
    http://keith-wood.name/datepick.html
    It may just do what you want.... i'm playing with it at the moment, pretty easy to implement.

  5. #5
    Experienced user
    Join Date
    06-10-09.
    Location
    Atlanta, Georgia
    Posts
    611

    Default Re: Show 12 months of calendar

    I'd prefer that it list a few months than have a navigator / selector, but thanks for the tip, vinchenzison.

    What exactly are you doing with the datepicker, ramjet? Are you able to feed events in by rss or something?

  6. #6
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Show 12 months of calendar

    I've just started toying with it today.
    Loosely I'm building a module for listing accommodation to let, and i need a way to select multiple dates at once, which the Contao calendar plugin doesn't do.
    At the moment I'm looking purely at data in.... theres a thread in "developers" describing more.
    I do know the calendar in the link i mentioned can display 12 months though

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
  •