I am trying to create an xsl template for displaying a calendar and am having an issue pulling the event date out of the calendar items.

Here is what I have:

<xsl:template name="DateCustomStyle" match="Row[@Style='DateCustomStyle']" mode="itemstyle">
<xsl:variable name="day" select="ddwrt:FormatDateTime(string(@Created),1033,'dd')" />
<xsl:if test="count(preceding-sibling::*)=0">
<h3 class="thisweek-title">This Week</h3>
    <div class="thisweek-item">
                <div class="thisweek-date">
                    <span class="thisweek-abbr">
                            <xsl:value-of select="ddwrt:FormatDateTime(string(@EventDate),1033,'ddd')"/>
            <span class="thisweek-day">
                            <xsl:value-of select="ddwrt:FormatDateTime(string(@EventDate),1033,'dd')"/>
                <div class="thisweek-events">
                            <xsl:value-of select="@Title"/></span>

<xsl:if test="count(following-sibling::*)=0">
<div class="thisweek-opencalendar"><a href="/Lists/Calendar">Open Calendar</a></div>

For some reason, the EventDate (which is the internal field name for Start Time) is empty. I have tested it with Created to make sure it was parsing correctly, which it is.

I am at a complete loss. I know for a fact that the date is in there, but its just not coming through.


I have also replaced EventDate with Start_x0020_Time, which is the display name of the field. Also yielded nothing.

If anyone has a suggestion I would be grateful



Just to make sure, did you add the reference for the date-formats in the top in the ItemStyle.xsl file?


And this is how i'm using the EventDate in our SharePoint. I think the problem is that you are trying to convert the date into a string. Try to remove that and try this instead.

<span class="thisweek-day">
                        <xsl:value-of select="ddwrt:FormatDateTime(@EventDate, 1033, 'dd')"/>

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.