End time in a calender
Hi, I have a calendar and it is working really well but I need to be able to show an end time as well as a start time to an event, I have it got it to show but how can I only show it if an end time is put in?
Not a lot of specifics, and you'd have to check the code and see what format the end time is in, but you could try an if statement in your page that only showed the end time if it was not equal to 0 IE: $your_end_time != "0000-00-00 00:00:00"
Hope that gives you an idea or two.
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
I think Jerry has the right idea here. Let me know if you have any more trouble!
Hi, I have this code and it does work so that if an end time is not put into the CMS editor nothing will show but I need it to display in the same time format as the start time, so in a 12 hour clock format and without the date reference, I have tried different things but i just can't get it to work:
<h3><?php echo htmlencode($record['title']) ?></h3>
<p><strong><?php echo date("g:i a", strtotime($record['start_date'])) ?></strong></p>
<?php if($record['end_time'] != "0000-00-00 00:00:00") : ?>
<?php echo $record['end_time'] ?>
<?php endif; ?>
<p><?php echo htmlencode($record['location']) ?></p>
So if there is a start and end time I want it to display as 9.30 am - 2.00 pm, if there is no end time it will just display as 9.30 am