Title: Availability Calendar
Last modified: August 19, 2016

---

# Availability Calendar

 *  Resolved [Mattijn](https://wordpress.org/support/users/mattijn/)
 * (@mattijn)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/availability-calendar/)
 * Hello Everyone,
 * I am building a website, but I want to tweak this plugin. I recon it’s a quick
   fix, but I’m not that good with PHP.
 * I’ve got this plugin: [http://wordpress.org/extend/plugins/availability/](http://wordpress.org/extend/plugins/availability/)
 * on this page: [http://www2.webhelden.net/watermerk/boten/admiraal/](http://www2.webhelden.net/watermerk/boten/admiraal/)
 * What I want to do is fix the dropdown menu (it doesn’t work) and make it so that
   it doesn’t display months that have passed. So right now it should display Juli
   2010 as the first month.
 * Anyone wants to help?
 *     ```
       <div id="wp-availability">
       	<?php for ($month = 1; $month <= 12; $month++) : ?>
       	<div class="wp-availability-month">
       		<table>
       			<thead>
       				<tr>
       					<th colspan="7"><?=date('F Y', mktime(0, 0, 0, $month, 1, $this->year))?></th>
       				</tr>
       			</thead>
       			<tbody>
       				<tr>
       					<th>M</th>
       					<th>T</th>
       					<th>W</th>
       					<th>T</th>
       					<th>F</th>
       					<th>S</th>
       					<th>S</th>
       				</tr>
       				<tr>
       				<?php
       					 // Total number of days in the month...
       					$total = cal_days_in_month(CAL_GREGORIAN, $month, $this->year);
       					 // Numerical value of start day...
       					$starts = date('N', mktime(0, 0, 0, $month, 1, $this->year));
       					 // Create month grid...
       					for ($grid = 1; $grid <= 42; $grid++) :
       						$available = $class = null;
       						if ($grid < $starts || $grid > ($total + $starts - 1)) {
       							$day = null;
       							$class = 'wp-availability-disabled';
       						} else {
       							$day = ($grid - $starts) + 1;
       							if (isset($booked[$month]) && array_key_exists($day, $booked[$month])) {
       								$available = false;
       								$class = 'wp-availability-booked';
       							}
       						}
       				?>
       					<td<?=($class !== null ? ' class="'.$class.'"' : null)?>><?=($day ? $day : '&nbsp;')?></td>
       				<?php if ($grid % 7 == 0 && $grid < 42) : ?>
       				</tr>
       				<tr>
       				<?php endif; endfor; ?>
       				</tr>
       			</tbody>
       		</table>
       	</div>
       	<?php endfor; ?>
       </div>
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Steve](https://wordpress.org/support/users/36flavours/)
 * (@36flavours)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/availability-calendar/#post-1594907)
 * Hiya,
 * This could be solved by using something as follows:
 * `<?php if ($this->year == date('Y') && $month < date('m')) continue; ?>`
 * (Place this on the next line after <?php for ($month = 0 …
 * The dropdown menu should be fixed with version 0.1.1.
 * If you download this version, the setting should be set correctly.
 *  [Steve](https://wordpress.org/support/users/36flavours/)
 * (@36flavours)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/availability-calendar/#post-1594908)
 * Also, the settings page doesn’t actually exist in this version but it appears
   the link was left.
 *  [Corinne tite route](https://wordpress.org/support/users/corinne-tite-route/)
 * (@corinne-tite-route)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/availability-calendar/#post-1594924)
 * Hello,
 * Sorry, I’m French and my English is not perfect.
 * I made the website (freely) for the village where I live in France. We have a
   rest center (?) and I used the plugin avaibility to show the reservation calendar,
   it’s exactly what we needed.
    It’s here : [http://www.orbeil.fr/?page_id=81](http://www.orbeil.fr/?page_id=81)
 * But now, we need to have the 2011 calendar online (and the last months of 2010)
   and I don’t know how to do. Is there any solution ? I can make some changes in
   the css but I’m not comfortable with php.
 * Thank you
 *  [jamescgarrett](https://wordpress.org/support/users/jamescgarrett/)
 * (@jamescgarrett)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/availability-calendar/#post-1594951)
 * Hey,
 * [@36flavours](https://wordpress.org/support/users/36flavours/)
    I’ve implemented
   the code you provided to show only the remaining months of the year, I’ve also
   changed the code above that, to show 24 months rather than 12, but by doing so
   the day numbers do not show up in the 2011 calendars. Any thoughts?
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Availability Calendar’ is closed to new replies.

## Tags

 * [calendar](https://wordpress.org/support/topic-tag/calendar/)

 * 4 replies
 * 4 participants
 * Last reply from: [jamescgarrett](https://wordpress.org/support/users/jamescgarrett/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/availability-calendar/#post-1594951)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
