Creating a calendar event with recurrence and all day event enabled programmatically?

  • Creating a calendar event with recurrence and all day event enabled programmatically? user1211

    I'm trying to creat a calender event that will be an all day event and will repeat every year from a list that has everyone's birthday. The recurrence works great and so does the All day event.

    The problem is when I set newBirthDay["All Day Event"] = 1; the recurrence all of a sudden doesn't put the event in the correct day, but in the next day.

    So say your birthday is on the 8th month and 3rd day, it will actually show up on the calender on August 4th and this only happens when I try to make it an All Day Event. If I leave it as normal it will show up on the correct day August 3rd. Anyone have any idea what could cause this? the C# code is included that handles it.

    Thanks for looking

    newBirthDay = calList.Add();
                newBirthDay["Title"] = "Happy Birthday, " + addBirthday["Title"].ToString();
                newBirthDay["Entry Type"] = "Birthday";
                string recurrence = "<recurrence><rule>" +
                                    "<firstDayOfWeek>su</firstDayOfWeek>" +
                                    "<repeat><yearly yearFrequency='1' month='" + addBirthday["Month"].ToString() + 
                                                                    "' day='" + addBirthday["Day"].ToString() + "'/></repeat>" +
                                    "<repeatForever>FALSE</repeatForever>" +
                newBirthDay["RecurrenceData"] = recurrence;
                newBirthDay["EventType"] = 1;
                newBirthDay["All Day Event"] = 1;
                newBirthDay["Recurrence"] = 1;
                newBirthDay["EventDate"] = new DateTime(DateTime.Now.Year, int.Parse(addBirthday["Month"].ToString()), int.Parse(addBirthday["Day"].ToString()));
                newBirthDay["EndDate"] = new DateTime(DateTime.Now.AddYears(100).Year, int.Parse(addBirthday["Month"].ToString()), int.Parse(addBirthday["Day"].ToString()));                
                newBirthDay["UID"] = System.Guid.NewGuid();
                newBirthDay["Description"] = "Happy Birthday, " + addBirthday["Name1"].ToString() + "\nbrithday = " + int.Parse(addBirthday["Day"].ToString()) + "|" + addBirthday["Day"].ToString();

  • I had a colleague look at programmatically setting recurrence lately, I can't remember the details of his issue or how he resolved it but basically the "end time" for your events in the series should represent the end of the recurrence.

wss-3.0 calendar visual-studio
Related questions and answers
  • (ContactPicker.OnEditBoxMouseDown(this, event));" maxHeight="60">&lt;SPAN class=recipientResolvedUser tabIndex=-1 contentEditable=false ownerid="V1_I1_CP2" displayname="... (ContactPicker.OnEditBoxFocus(this, event));" title="" tabIndex=0>&lt;/DIV>&lt;/DIV>&lt;/SPAN>&lt;/TD> &lt;TD vAlign=top>&lt;BUTTON id=V1_I1_CP2_ResolveButton onfocus="return (ContactPicker.OnButtonFocus(this, event));" title="Resolve names" onclick="return (ContactPicker.OnResolveAllClick(this, event));">&lt;IMG style="VERTICAL-ALIGN

  • ; &lt;/Eq> &lt;/Where> &lt;/Query> then it is working. Here is the code: // create listViewByQuery ListViewByQuery listViewByQuery = new ListViewByQuery(); listViewByQuery.List...So I did create on an SPWeb 20 custom lists and then a tasks list. For each of those 20 lists I've created 20 site lookup columns. I then created 20 Content Types based on Task content type...' /> &lt;Value Type='Lookup'>1&lt;/Value> &lt;/Eq> &lt;/Where> &lt;/Query> The problem is that this SPQuery returns results only for the first 13 lookup

  • I have successfully created a DVWP which queries all lists in my subsites and returns the correct columns using the following selectcommand: &lt;View> &lt;Webs Scope="Recursive">&lt;/Webs> &lt;View> &lt;ViewFields> &lt;FieldRef Name="Development_x0020_Status" /> &lt;FieldRef Name="Title" /> &lt;FieldRef Name="FileDirRef" />...;FieldRef Name="StreamName" Ascending="TRUE" /> &lt;FieldRef Name="Title" Ascending="TRUE" /> &lt;/OrderBy> &lt;/Query> &lt;/View> One of the things i would now

  • ="EventType" /> &lt;/Expr> &lt;Case Value = "1"> &lt;HTML>New Content on Latest Events</HTML> &lt;/Case> &lt;Case Value = "2">...; &lt;Case Value = "1"> &lt;HTML> &lt;![CDATA[A new content has been added to Latest Events. To view, please visit: &lt;a href..._event_lastmodified; &lt;/Footer> &lt;/Immediate> The problems I'm facing are following: The subject contains all the values irrespective of the type of event (1,2,4) there was no &lt

  • I have a webpart that pops up a jquery modal on page load. The modal prompts them to answer a question using a radio button list. They select an answer and click Answer (a modal button) which calls the btnAnswer onclick event. Code is below. The issue is that the page is posting back but the btnAnswer_Click event in the code fires but the radiobuttonlist doesn't have a selected value anymore. If I remove all JQuery references it works fine. Webpart CreateChildControls btnAnswer = new Button(); btnAnswer.ID = "btnAnswer"; btnAnswer.Text = "Answer"; btnAnswer.CssClass = "ms-buttonheightwidth

  • , but that ends up rendering the actual anchor tag, as opposed to a clickable hyperlink: &lt;a href="">;/a> So then I tried creating a XSL transform, since that is supposed to be the new and improved way of doing this. Unfortunately, I can't get that to work either. I am getting the same thing I got using the RenderPattern. I'm no XSL expert, so can anyone...Has anybody upgraded an old custom field type to use the new XSL transform in SharePoint 2010? I have a multi-column field type, and want the Display pattern to render the 2nd "column", which

  • when using these two properties. My reusable content list basically looks like so: Title ReusableHTML Static 1 &lt;a href="#">Link 1&lt;/a> Static 2 &lt;a href="#">Link 2&lt;/a> And basically I want to display these global links via the masterpage of my site - easily editable for the end user in the reusable content list. Anyone up for a .webpart file or could show me... it always shows me the LINK to the item in the reusable content list - what I want it to show is the ReusableHTML Column of the specific item in the list. I tried doing so with &lt;property name

  • I have this (an attempt to solve the task): &lt;xsl:stylesheet xmlns:x="" xmlns:d="" version="1.0" exclude-result-prefixes..."/> &lt;xsl:value-of select="sum($Rows/@Distance[.!=''])" /> &lt;/xsl:template> &lt;/xsl:stylesheet> The result is: "NaN", so I figure that my XSLT is wrong. Question is: How do I write the XSLT to calculate and show the sum of all values in the "Distance" column in a Data View Web Part? The column might have empty values (does not have empty values now by the way

  • Nullable="TRUE" and Type="UserMulti". This works, in the query now returns the correct number of records, however the value in my 2 multi user fields is empty. &lt;View> &lt;Webs Scope="Recursive">&lt;/Webs> &lt;View> &lt;ViewFields> &lt;FieldRef Name="Development_x0020_Status" /> &lt;FieldRef Name="Title" /> &lt;FieldRef Name="FileDirRef" />..." Nullable="TRUE" Type="UserMulti" /> &lt;!-- // Field which do not return values --> &lt;ProjectProperty Name="Title" /> &lt;/ViewFields> &lt;/View> &lt;Query>

Data information