Don't highlight day if we're in a different month. :)

git-svn-id: http://svn.automattic.com/wordpress/trunk@512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-11-03 17:49:15 +00:00
parent c638c5429b
commit 9ac29ebf41
1 changed files with 2 additions and 2 deletions

View File

@ -247,7 +247,7 @@ if (!empty($monthnum) && !empty($year)) {
} elseif (!empty($w)) {
// We need to get the month from MySQL
$thisyear = ''.intval(substr($m, 0, 4));
$d = (($w - 1) * 7) + 6; //it seems mysqls weeks disagree with php's
$d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
$thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')");
} elseif (!empty($m)) {
$calendar = substr($m, 0, 6);
@ -342,7 +342,7 @@ for ($day = 1; $day <= $daysinmonth; ++$day) {
if ($newrow) echo "\n </tr>\n <tr>\n\t";
$newrow = false;
if ($day == date('j', (time() + ($time_difference * 3600)))) echo '<td id="today">';
if ($day == date('j', (time() + ($time_difference * 3600))) && $thismonth == date('m', time()+($time_difference * 3600))) echo '<td id="today">';
else echo "<td>";
if (in_array($day, $daywithpost)) {