none
Why start time and end time are not correct from display form in Calendar? RRS feed

  • Question

  • Good morning everyone,

    We have an dept. calendar. Staff can select time and category to save the events. The edit form is fine to have the correct time but the display form is not correct for start time and end time field. I checked the regional settings and the time zone is correct. I can't modify the display form for the start time and end time, any suggestions?

    Thanks you in advance!

    Miranda

    The following time should be Nov. 23 from 9 to 5 or maybe ov. 23 12:00am to 11:59pm




    • Edited by Miranda Lu Monday, November 12, 2012 10:04 PM
    Monday, November 12, 2012 5:07 PM

Answers

  • Hi Miranda,

    You need to remove the LocalId="2057" attribute which is you added in NewForm.aspx page, to resolve the error 'Microsoft.SharePoint.WebControls.FormField' does not have a public property named 'LocaleId'.

    You can change the format of the Start Time and End Time fields in DispForm.aspx page(display form), you need to open the DispForm.aspx page via SharePoint Designer 2010, then find and may change the code line from

    <xsl:value-of select="@EventDate" />

    To

    <xsl:value-of select="ddwrt:FormatDate(string(@EventDate) ,2057 ,'7')"/>

    Please make the same change for field End Time field. 

    Here are two article about this, see more below,

    http://blogs.msdn.com/b/joshuag/archive/2009/03/25/custom-date-formats-in-sharepoint-xsl.aspx

    http://blog.amtopm.be/2011/06/21/format-xslt-date/

    Thanks


    Daniel Yang

    TechNet Community Support

    Tuesday, November 13, 2012 7:23 AM
    Moderator
  • Good morning Daniel,

    I deleted the LocaleID=2057 and made the change as you suggested. It works perfectly!

    Thank you very much!

    Miranda

    • Marked as answer by Miranda Lu Tuesday, November 13, 2012 4:11 PM
    Tuesday, November 13, 2012 3:24 PM

All replies

  •  I found more about this calendar. It has used XSL editor to create a customer form with start time and end time. I searched forum here and added LocalId = "2057" in the default new form under start time and this form cann't open now! The code for start time is

    <H3 class="ms-standardheader">

    <nobr>

    </H3>

    </td>

    <td width="400px" valign="top" class="ms-formbody">

    <SharePoint:FormField runat="server" id="ff3{$Pos}" LocaleId="2057" ControlMode="New" FieldName="

    Start Time<span class="ms-formvalidation"> *</span></nobr>EventDate" __designer:bind="{ddwrt:DataBind('i',concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@EventDate')}"/>

    <SharePoint:FieldDescription runat="server" id="

    ff3description{$Pos}" FieldName="EventDate" ControlMode="New"/>

    </td>

    </tr>

    <tr>

    <td width="190px" valign="top" class="ms-formlabel">

    The error is 'Microsoft.SharePoint.WebControls.FormField' does not have a public property named 'LocaleId'. Any suggestion?

    Thank you in advance!

    Miranda


    • Edited by Miranda Lu Monday, November 12, 2012 10:02 PM
    Monday, November 12, 2012 10:02 PM
  • Hi Miranda,

    You need to remove the LocalId="2057" attribute which is you added in NewForm.aspx page, to resolve the error 'Microsoft.SharePoint.WebControls.FormField' does not have a public property named 'LocaleId'.

    You can change the format of the Start Time and End Time fields in DispForm.aspx page(display form), you need to open the DispForm.aspx page via SharePoint Designer 2010, then find and may change the code line from

    <xsl:value-of select="@EventDate" />

    To

    <xsl:value-of select="ddwrt:FormatDate(string(@EventDate) ,2057 ,'7')"/>

    Please make the same change for field End Time field. 

    Here are two article about this, see more below,

    http://blogs.msdn.com/b/joshuag/archive/2009/03/25/custom-date-formats-in-sharepoint-xsl.aspx

    http://blog.amtopm.be/2011/06/21/format-xslt-date/

    Thanks


    Daniel Yang

    TechNet Community Support

    Tuesday, November 13, 2012 7:23 AM
    Moderator
  • Good morning Daniel,

    I deleted the LocaleID=2057 and made the change as you suggested. It works perfectly!

    Thank you very much!

    Miranda

    • Marked as answer by Miranda Lu Tuesday, November 13, 2012 4:11 PM
    Tuesday, November 13, 2012 3:24 PM