locked
Calendar view date only - time issue RRS feed

  • Question

  • Ok, here's the way this is supposed to work:

    I have a list with a Start and End date, these fields are Date only, because I want the times in the calendar based upon a choice value.
    These choices are: Full day(s), Morning or afternoon.

    A full day begins at 8am and goes to 6pm, and both half days are split at 12.30pm.
    Since the date fields have no times, I set up some calculated columns, and added the right times to the dates, since they should be 12am by default.

    This worked fine until we recently, when I noticed some items where completely wrong on the calendar:

    Any normal day should only contain items from 8am to 6pm only, and the items with different start- and end dates on top.
    When I look at the item properties for one item, I see the start- and end date (which should be date only) displayed like this:

    Theres nowhere where you can enter a time for these dates, so I'm wondering how this is happening.

    The big problem is that I'm adding to these times, so a lot of items are in the wrong place on the calendar, some are even split over different dates.

    Can anyone help me correct this issue?

    *EDIT* This has started happening ever since I started using an Infopath form for new items
    Thursday, April 5, 2012 3:11 PM

Answers

  • Alright, solved the problem (not the cause though) myself

    Instead of adding time directly to the date field (which had the weird times because of the infopath form), I parsed that field to a Date only like this:

    =IF(Period="Afternoon";Start+(12,5/24);Start+(8/24))
    Became
    =IF(Period="Afternoon";DATE(YEAR(Start);MONTH(Start);DAY(Start))+(12,5/24);DATE(YEAR(Start);MONTH(Start);DAY(Start))+(8/24))

    Friday, April 6, 2012 8:52 AM