When using the Calendar widget, I have some events that will be for a certain amount of time (like 1 hour) that I would like to show a start time for, but then for the all day events, I’d like to show it as “All Day” rather than the start time at 12:00 am. Is there a way to differentiate between the two?
I was able to do something similar by using parts of the date data in the HTML markup in the template. You could probably write some javascript to do it, but just using the template and CSS, it will be a lot more simple. See the calendar manual for specific info on what all the letters mean and how to display only parts of the event times: Xibo Documentation.
Here is an example of what I use in the main template:
In the optional stylesheet, I have a CSS style like this:
.allDay00{display:none;}
If the start time hour is 00 (which equals 12 am), the span will not display.
Your solution would need to be a bit different. You would need 2 span tags with multiple classes.
<span class="theStartTime allDay[StartDate|H]"> @ [StartDate|g:i A]</span>
<span class="theAllDay allDay[StartDate|H]"> All Day Event</span>
Your CSS would need something like this.
.allDay00 {display:none;} /*This will hide both by default*/
.theStartTime.allDay00 {display:none;} /*hides start time is 12 am*/
.theAllDay.allDay00 {display:inline;} /*Displays all day text if start time is 12 am*/
I might have missed something along the way, but I think that might cover what you’re trying to do.
First of all, thank you, thank you, THANK YOU! I really appreciate such a thorough response. Now let me say that I’m pretty CSS illiterate.
You’ve gotten me almost all the way there, but for some reason, even on events that don’t have a 12 am start time, it’s still showing the “All Day Event”, and I can’t figure out why. Here is what I have for my code. Any advice?
.allDay00 {display:none;} /*This will hide both by default*/
.theStartTime.allDay00 {display:none;} /*hides start time is 12 am*/
.theAllDay.allDay00 {display:inline;} /*Displays all day text if start time is 12 am*/
Actually, I leaned on my brother who knows a thing or two about CSS, and he was able to help me get it straightened out. For anyone else ever trying to do something similar, here’s the final code that got it working. This calendar is displaying 5 objects on a region that’s 772px high and 653px wide:
.hide {display:none;}
.show {display:inline;}
.timeHide00 {display:none;} /*hides start time is 12 am*/
.allDayDisplay00 {display:inline;} /*Displays all day text if start time is 12 am*/
.eDate {
color:#ffffff;
font-size:36px;
}
.eTitle {
color:#ffffff;
font-size:24px;
}