WordPress.org

Ready to get started?Download WordPress

Forums

amr ical events lists
[resolved] What is the best way to hide weekends? (3 posts)

  1. John Carman
    Member
    Posted 8 months ago #

    In other words, what is the best way to display a five-day work week? I have identified at least two ways to do this using CSS or a combination of JS (to deal with colspan) and CSS, but I would prefer not to use a hack.

    http://wordpress.org/plugins/amr-ical-events-list/

  2. anmari
    Member
    Plugin Author

    Posted 8 months ago #

    Hi,

    hiding with css is probably the safest (I'm not a fan of js solutions). There are currently no settings to stop weekends being generated

    (what would one do if an event was on a weekend ??)

  3. John Carman
    Member
    Posted 8 months ago #

    On a public school cafeteria calendar, there are no weekend events, so I can safely hide weekends.

    CSS alone does not work, because if you hide the weekend columns, the colspan is wrong on the td.pad cells.

    I actually went with a pure jQuery solution. This way, it will degrade gracefully for users with JS disabled:

    $(document).ready(function(){
      $('table.largecalendar td.day6, table.largecalendar td.day7, table.largecalendar th.saturday, table.largecalendar th.sunday').hide();
      var colspans = $('table.largecalendar td.pad').attr('colSpan');
      if (colspans>1) $('table.largecalendar td.pad').attr('colSpan', parseInt(colspans)-1);
    	  });

    Thanks for the prompt response! I love the plugin. I also wanted to build a customized event listing, and I was able to do that easily by configuring a list type.

Reply

You must log in to post.

About this Plugin

About this Topic