Unique class for calendar days

  • Diane Cleaver
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 5 months ago #89417 by Diane Cleaver
Unique class for calendar days was created by Diane Cleaver
I love how well the calendar behaves responsively, however would it be possible to create a separate class for empty cells? Using our calendar as an example - www.sandwichpld.org/calendar - when the screen is sized down and the events stack on top of one another, the empty cells still display at the very top and very bottom of the list. It would be nice if we were able to hide these cells in the stylesheet.

Related to this, is it possible to add a style to the current day so that this can be colored differently than the other cells?

Thank you.

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #89419 by James Riley
Replied by James Riley on topic Unique class for calendar days
You could try something like this... NOTE: I have not tested this code :)

Edit components/com_eventbooking/view/common/tmpl/calendar.php

Find the line:
Code:
<li class="eb-calendarDay calendar-day regpro-calendarDay <?php echo $rowClass; ?>">

and try modifying it to something like:
Code:
<li class="eb-calendarDay calendar-day regpro-calendarDay <?php echo $rowClass; ?> <?php if (count($currentDay["events"])==0) echo 'no-events'; ?>">

Then in media/com_eventbooking/assets/css/custom.css, try the following:
Code:
@media screen and (max-width: 767px) { body .eb-calendar li.no-events { display: none; } }

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

Please Log in or Create an account to join the conversation.

  • Diane Cleaver
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 5 months ago #89420 by Diane Cleaver
Replied by Diane Cleaver on topic Unique class for calendar days
Thank you for the quick reply, however this is not an issue with cells containing no events, but with cells that are outside the month. For example, November has 2 cells at the beginning and 3 at the end.

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #89422 by James Riley
Replied by James Riley on topic Unique class for calendar days
Ahhh. I see. Sorry -- I misunderstood exactly what you were after.

I think you just need to move up 5 lines higher in the calendar.php file and apply the same code fix. Look for this line instead (the only difference is the </li> on the end:
Code:
<li class="eb-calendarDay calendar-day regpro-calendarDay <?php echo $rowClass; ?>"></li>

and modify to:
Code:
<li class="eb-calendarDay calendar-day regpro-calendarDay <?php echo $rowClass; ?> <?php if (count($currentDay["events"])==0) echo 'no-events'; ?>"></li>

Make the same change as above to the CSS code.

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago - 9 years 5 months ago #89425 by James Riley
Replied by James Riley on topic Unique class for calendar days
As for coloring TODAY's day differently, I think this should work. I discovered that @Tuan already has constructed the test for "is the event date = to today's date", so we just need to check if the existing variable = true.

Look for the line I mentioned in my first post (the one without the </li> at the end), and change to::
Code:
<li class="eb-calendarDay calendar-day regpro-calendarDay <?php echo $rowClass; ?> <?php if ($data["dates"][$dayCount]["today"]) echo 'eb-calendarDay-Today';?>">

And add the following to EB's custom.css (of course change YOURCOLOR to whatever color value you want):
Code:
.eb-calendarDay-Today {background-color:#YOURCOLOR;}

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 9 years 5 months ago by James Riley.

Please Log in or Create an account to join the conversation.

  • Diane Cleaver
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 5 months ago #89484 by Diane Cleaver
Replied by Diane Cleaver on topic Unique class for calendar days
Thank you, the code for indicating the non-day cells works great. However, the code for indicating "today" does not work.

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #89487 by James Riley
Replied by James Riley on topic Unique class for calendar days
I will try and look further into the TODAY issue when I have a chance :) Could be a week or two though...

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

Please Log in or Create an account to join the conversation.

  • Diane Cleaver
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 5 months ago #89488 by Diane Cleaver
Replied by Diane Cleaver on topic Unique class for calendar days
Thank you. It's not urgent, just something that would be nice to have.

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc