1

I am upgrading a calendar from the 2007 template to a 2010 template and found that for 2 years worth of data, nobody set the end time for the events. When I switch over to the 2010 template, none of the events show up on the calendar view unless I manually add the end time. I have tried several different types of workflows in both Nintex and SPD and none of them work.

  1. I have tried setting a calculated value column that adds 15 minutes to the start time, then set the End Time to the calculated value, SPD and Nintex workflows error out

  2. I tried the several jquery scripts in this forum, none have worked This one doesn't work

  3. Used the calculated calendar feature in Nintex WF, it changes to the correct time but unable to insert into End Time field

I tried a modified version of #2

    // Set the hours to add - can be over 24
  var hoursToAdd = 0;
  // Mins must be 0 or div by 5, e.g. 0, 5, 10, 15 ...
  var minutesToAdd = 5;

  // JavaScript assumes dates in US format (MM/DD/YYYY)
  // Set to true to use dates in format DD/MM/YYYY
  var bUseDDMMYYYYformat = false;

  $(function() {

    // Find the start and end time/minutes dropdowns by first finding the
    // labels then using the for attribute to find the id's
    // NOTE - You will have to change this if your form uses non-standard
    // labels and/or non-english language packs
    var cboStartHours = $("#" + $("label:contains('Start Time Hours')").attr("for"));
    var cboEndHours = $("#" + $("label:contains('End Time Hours')").attr("for"));
    cboStartHours.val("08:");
    cboEndHoursHours.val("17:");
});

// Some utility functions for parsing and formatting - could use a library
// such as www.datejs.com instead of this
function dtParseDate(sDate)
{
    if (bUseDDMMYYYYformat)
    {
        var A = sDate.split(/[\\\/]/);
        A = [A[1],A[0],A[2]];
        return new Date(A.join('/'));
    }
    else
        return new Date(sDate);
}

function formatDate(dtDate)
{
    if (bUseDDMMYYYYformat)
        return dtDate.getDate() + "/" + dtDate.getMonth()+1 + "/" + dtDate.getFullYear();
    else
        return dtDate.getMonth()+1 + "/" + dtDate.getDate() + "/" + dtDate.getFullYear();
}
_spBodyOnLoadFunctionNames.push("initEndDateEvent");

I'm at my wits end, can the End Time column for calendars be edited in a workflow or script?

1 Answer 1

0

What error are the workflows reporting?

Can you run PowerShell on the farm? Would be an easy enough script to loop through and set the field values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.