Stump the Panel » End Users and Information Workers

Calendar View - Time Ranges

(13 posts)
  • Started 11 months ago by iamspartacus
  • Latest reply from mahendradeva

Tags:

  1. iamspartacus
    Member

    Any way to have MOSS list the time range of an event in a Calendar View of a list instead of just the start time? Need to create an after hours schedule that shows start and end times but don't really want to buy Calendar Plus if I don't have to.

    Posted 11 months ago #
  2. Make the date a string and concatenate them with Title you can make a calc column to use in the month/week view.

    =Title&" : "&TEXT([Start Time],"h:mm")&"-"&TEXT([End Time],"h:mm")

    Posted 11 months ago #
  3. iamspartacus
    Member

    Awesome - thanks, AutoSponge. Now how do I get rid of the Start Time that appears by default above my list data on the actual calendar? With multiple entries per day, each of those Start Times eats up space.

    i.e.:

    5:00 AM <--- this appears by default *
    Krystal Winters : 5:00-14:00
    8:00 AM
    Fred Catalba : 8:00-14:00
    2:00 PM
    Theresa Knoll : 14:00-23:00

    * this time appearing by default would be fine if it reflected the time range of 5AM - 2PM but it won't. So our calculated column that shows the time range makes the default Start Time repetitive and space-consuming. Can I have one or the other or does it have to be both?

    Posted 11 months ago #
  4. Yeah, that's the web part doing that and it's not configurable. So I'd probably "fix" that with JavaScript, placing a CEWP on the page to remove those items.

    <td class="ms-cal-monthitem">
      <a tabindex="25" target="_self" onclick="GoToLink(this);return false;" href="/Lists/Calendar/DispForm.aspx?ID=2" onfocus="OnLink(this)">
        <nobr>
          <b>1:00 PM</b>
        </nobr>
        <br />
        Test : 13:00-14:00
      </a>
    </td>

    If the rendered code looks like this, we can attack the <nobr> and <br /> elements within the .ms-cal-monthitem class. In jQuery it would look like this:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function() {
    	$("td.ms-cal-monthitem> a")
    		.find("nobr").remove()
    		.end()
    		.find("br").remove();
    });
    </script>
    Posted 11 months ago #
  5. rachels
    Member

    How do you place a CEWP on the page to remove the start time from the Sharepoint calendar?

    Posted 6 months ago #
  6. rilebeau
    Member

    This works great for a calendar in month view, but is there any way to achieve the same results for a day view?

    Posted 5 months ago #
  7. iamspartacus
    Member

    Hi rachels,

    You can place a CEWP on a page by going to Site Actions / Edit Page (assuming you have the rights and the page in question is a web part page). Thsi opens the page up in edit mode.

    You should see a gold bar that says "Add a Web Part" - click on that and a pop-up window will coem up and display a list of available web parts. Scroll down and, under Miscellaneous, you should see "Content Editor Web Part". Check the box next to it and click the "Add" button. That will place a CEWP on the page so you can insert AutoSponge's bit of code.

    Hi rilebeau,

    Great question - I have no idea. Anyone?

    Posted 4 months ago #
  8. iamspartacus
    Member

    Since I'm in here...

    The above snippet of code from AutoSponge does exactly what it's suppossed to do which is a big help! Unfortunately, it does a little more than we may want.

    When using it, and setting up a multiple-day event, the listing will only show for one day on the calendar view (i.e. a Mon-Wed event will only show in Mon) unless the event is longer than a week. If it is longer than a week, it will end on the calendar view one day before the actual end date. Wierd, huh?

    Any ideas?

    Posted 4 months ago #
  9. iamspartacus
    Member

    Hello out there.

    Checking in to see if anyone has any ideas of how to allow a multi-day event to appear correctly (strecthed over a few days as oppossed to only showing on the first day of the event) in a list's calendar view?

    Posted 4 months ago #
  10. dsslayers
    Member

    iamspartacus,

    You can create a calculated column that is equal to your [end time] + 1

    Use this calculated column as your end time column, and it will display correctly on the calendar view. If you get errors when trying to put a calculated column as a time field in a calendar, there is a patch from microsoft that fixes the issue.

    Posted 3 months ago #
  11. edw3105
    Member

    Thanks so much for this snippet, I have a question though...this works great until I need to add other JavaScript code to the CEWP, then it doesn't work at all. Any ideas???

    Posted 3 months ago #
  12. edw3105
    Member

    Anyone have any ideas on this??

    Posted 2 months ago #
  13. mahendradeva
    Member

    for monthly, weekly and day view in sharepoint calender we can add the following:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(
    function()
    {
    $("a.ms-cal-dayitem>")
    .find("NOBR").remove()
    .end()
    $("td.ms-cal-monthitem>")
    .find("nobr").remove()
    .end()
    .find("br").remove();
    }
    );
    </script>

    The above worked fine in my case!
    HTH

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.