Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Heather Floyd 605 posts 1004 karma points MVP 5x c-trib
    Jul 21, 2009 @ 18:37
    Heather Floyd
    0

    Suggestion for Enhancement - Multi-day events boolean

    I really like PDCalendar. Thanks for the great Package.

    One suggestion I have is to add an option to the datatype like "Multi-day Event" (true/false) because it's possible that someonce could have a conference (like CodeGarden) which spans several days, but is not actually recurring separately on several days. This would allow the calendar to render the event differently, and when I display the event details, I could differentiate between an event which is occuring, for instance, from 7/20 thru 7/22 vs. on 7/20, on 7/21 and on 7/22 (as a repeated event).

    Thanks for the consideration!

    ~Heather

  • Heather Floyd 605 posts 1004 karma points MVP 5x c-trib
    Jul 21, 2009 @ 19:35
    Heather Floyd
    1

    Well, I was able to achieve thesomething similar by adding a separate property to my 'Event' doctype. Here is some XSLT I use to display the dates on the Event detail page.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
        version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:Designit.VideoEmbed="urn:Designit.VideoEmbed" xmlns:pdcalendar="urn:pdcalendar" 
        exclude-result-prefixes="pdcalendar msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Designit.VideoEmbed pdcalendar ">

    <!--Event_DisplayDates.xslt-->

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <!--MACRO PARAMS
        DateFormatString    Format string for the date (ex: yyyy-MM-dd or MMM d, yyyy)    text
        StartEndSeparator    Text used to separate start & end dates (ex: -)    text
    -->

    <!--VARIABLES -->
    <xsl:param name="currentPage"/>
    <xsl:variable name="DateFormatString" select="macro/DateFormatString"/>
    <xsl:variable name="StartEndSeparator" select="macro/StartEndSeparator"/>

    <xsl:template match="/">
    <!--<p><xsl:copy-of select="umbraco.library:GetXmlNodeById($currentPage/@id)/data/pdcalendarevent"/></p>-->

    <xsl:variable name="RepeatsNum" select="umbraco.library:GetXmlNodeById($currentPage/@id)/data/pdcalendarevent/pdcrec"/>
    <xsl:variable name="IsMultiDay" select="umbraco.library:GetXmlNodeById($currentPage/@id)/data[@alias='EventIsMultiDay']"/>
    <xsl:variable name="DateStart" select="umbraco.library:GetXmlNodeById($currentPage/@id)/data/pdcalendarevent/pdcstart"/>
    <xsl:variable name="DateEnd" select="umbraco.library:GetXmlNodeById($currentPage/@id)/data/pdcalendarevent/pdcend"/>

    <!--
    <br/>DEBUG-RepeatsNum=<xsl:value-of select="$RepeatsNum"/>
    <br/>DEBUG-DateStart=<xsl:value-of select="$DateStart"/>
    <br/>DEBUG-DateEnd=<xsl:value-of select="$DateEnd"/>
    <br/>DEBUG-DateFormatString=<xsl:value-of select="$DateFormatString"/>
    <br/>DEBUG-StartEndSeparator=<xsl:value-of select="$StartEndSeparator"/>
    -->

    <xsl:choose>
        <xsl:when test="$RepeatsNum=0"> <!-- None -->
            <xsl:choose>
                <xsl:when test="string($DateEnd)=''"> <!--only start date-->
                    <xsl:value-of select="umbraco.library:FormatDateTime($DateStart, $DateFormatString)"/>
                </xsl:when>
                <xsl:when test="string($DateEnd)=string($DateStart)"> <!--only start date-->
                    <xsl:value-of select="umbraco.library:FormatDateTime($DateStart, $DateFormatString)"/>
                </xsl:when>
                <xsl:otherwise> <!--show both-->
                    <xsl:variable name="Date1String"  select="umbraco.library:FormatDateTime($DateStart, $DateFormatString)"/>
                    <xsl:variable name="Date2String"  select="umbraco.library:FormatDateTime($DateEnd, $DateFormatString)"/>
                    <xsl:value-of select="concat($Date1String,$StartEndSeparator,$Date2String)" disable-output-escaping="yes"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:when>    
        <xsl:when test="$RepeatsNum=1 and $IsMultiDay=1"> <!-- Daily - multi-day -->
            <xsl:choose>
                <xsl:when test="string($DateEnd)=''"> <!--only start date-->
                    <xsl:value-of select="umbraco.library:FormatDateTime($DateStart, $DateFormatString)"/>
                </xsl:when>
                <xsl:when test="string($DateEnd)=string($DateStart)"> <!--only start date-->
                    <xsl:value-of select="umbraco.library:FormatDateTime($DateStart, $DateFormatString)"/>
                </xsl:when>
                <xsl:otherwise> <!--show both-->
                    <xsl:variable name="Date1String"  select="umbraco.library:FormatDateTime($DateStart, $DateFormatString)"/>
                    <xsl:variable name="Date2String"  select="umbraco.library:FormatDateTime($DateEnd, $DateFormatString)"/>
                    <xsl:value-of select="concat($Date1String,$StartEndSeparator,$Date2String)" disable-output-escaping="yes"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:when>    
        <xsl:otherwise>
            <!--check for query string date -->
            <xsl:variable name="PageDate" select="umbraco.library:RequestQueryString('d')"/>
            <xsl:variable name="Date1String"  select="umbraco.library:FormatDateTime($PageDate, $DateFormatString)"/>
            <xsl:value-of select="$Date1String" disable-output-escaping="yes"/>
        </xsl:otherwise>
    </xsl:choose>


    <!--TEST: <xsl:variable name="messages" select="pdcalendar:GenerateDates(umbraco.library:RequestQueryString('d'),umbraco.library:RequestQueryString('d'),'EventDateInfo')" />
    <xsl:value-of select="$messages"/> -->

    </xsl:template>

    </xsl:stylesheet>

    I hope this can help someone out!

    ~Heather

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 21, 2009 @ 20:23
    Peter Dijksterhuis
    0

    Hi Heather,

    I like the idea and I allready been thinking on how to implement this. At the moment I think the EndDate is not implemented as is should be. The EndDate should reflect the actual EndDate of a single event. Right now it reflects the Enddate of the series of events. In a future release I will change this and add a third date (FinalDate or something) which reflects the date after which the event never occurs anymore. The current EndDate will then reflect the date a single event ends.

    I love the way how you solved it though :) Glad you figured out which values the pdrec stands for ;)

    Peter

  • Heather Floyd 605 posts 1004 karma points MVP 5x c-trib
    Jul 21, 2009 @ 20:45
    Heather Floyd
    0

    Sounds great, Peter, because then you could possibly have multi-day recurring events (like if you had a monthly weekend workshop, for instance.)

    Glad you figured out which values the pdrec stands for ;)

    Gotta love "xsl:copy" ;-)

    ~Heather

     

Please Sign in or register to post replies

Write your reply to:

Draft