Ticket #404 (closed defect: fixed)
Events: end-date shows up, even when it is the same as start date
| Reported by: | jake | Owned by: | jake |
|---|---|---|---|
| Priority: | major | Milestone: | 1.5 |
| Component: | apostropheBlogPlugin | Version: | 1.4 |
| Keywords: | 1.5rc2 | Cc: | agilbert, boutell, rickybanister, johnnyoffline, |
| Symfony version: | 1.4 |
Description
This could be part of a slightly larger project to reformat how we deal with dates/times all together. But for now, we should set it so if the start day and end day are the same, the end day is hidden.
The reason this is failing right now is because in this block:
<ul class="a-blog-item-meta"> <li class="start-day"><?php echo aDate::dayAndTime($aEvent->getStartDate()) ?></li> <li class="start-date"><?php echo aDate::dayMonthYear($aEvent->getStartDate()) ?><?php if ($aEvent->getStartDate() != $aEvent->getEndDate()): ?> —<?php endif ?></li> <?php if ($aEvent->getStartDate() != $aEvent->getEndDate()): ?> <li class="end-day"><?php echo aDate::dayAndTime($aEvent->getEndDate()) ?></li> <li class="end-date"><?php echo aDate::dayMonthYear($aEvent->getEndDate()) ?></li> <?php endif ?> </ul>
<?php if ($aEvent->getStartDate() != $aEvent->getEndDate()): ?>
returns both the date and the time. We should be comparing the month and day only here.
I fixed it in a client project with this:
<?php if ((date('M j', strtotime($a_event->getStartDate()))) == (date('M j', strtotime($a_event->getEndDate())))): ?>
But there's probably a more elegant way to solve the issue in the plugin.
Now that I look at it, it is showing the times in the meta block. We should take the times out.
It should be formatted like this:
--Single-day Event
Saturday, May 29th, 2010
--Multi-day Event


