Changeset 1616 for trunk/system/views

Show
Ignore:
Timestamp:
12/26/2007 08:43:14 AM (13 months ago)
Author:
Shadowhand
Message:

Updates to Calendar

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/views/kohana_calendar.php

    r1615 r1616  
    11<?php 
     2 
     3$first_day = mktime(1, 0, 0, $month, 1, $year); 
     4$today = (date('Y/m') === date('Y/m', $first_day)) ? date('j') : FALSE; 
     5 
    26/** 
    37 * @todo This needs to be moved to an i18n file, or be configured in the library. 
     
    1115table.calendar { text-align: right; } 
    1216table.calendar caption { font-size: 1.5em; padding: 0.2em; } 
    13 table.calendar th, table.calendar td { padding: 0.2em; background: #fff; } 
     17table.calendar th, table.calendar td { padding: 0.2em; background: #fff; border: 0; } 
    1418table.calendar td:hover { background: #ddf; } 
    15 table.calendar td.prev-next { background: #fff; color: #666; } 
     19table.calendar td.prev-next { background: #ccc; color: #999; } 
     20table.calendar td.today { color: #800; } 
    1621</style> 
    1722 
    1823<table class="calendar"> 
    19 <caption><?php echo strftime('%B %Y', mktime(1, 0, 0, $month, 1, $year)) ?></caption> 
     24<caption><?php echo strftime('%B %Y', $first_day) ?></caption> 
    2025<tr> 
    2126<?php foreach ($headings as $day): ?> 
     
    3035<?php else: ?> 
    3136<?php 
     37 
     38if ($today > 0 AND $day[0] == $today) 
     39{ 
     40        $class = ' class="today"'; 
     41} 
     42else 
     43{ 
     44        $class = ''; 
     45} 
    3246/** 
    3347 * @todo Need to add assignable stuff to this. For example, making certain dates into links. 
    3448 */ 
    3549?> 
    36 <td><?php echo $day[0] ?></td> 
    37 <?php endif ?> 
     50<td<?php echo $class ?>><?php echo $day[0] ?></td> 
     51<?php endif; ?> 
    3852<?php endforeach ?> 
    3953</tr>