vendredi 2 janvier 2015

Why is Sharepoint designer showing the correct information but the browser is different



I'm wondering if anyone can help me with a sharepoint designer issue. I have some code I'm using to make a column in a summary table in SPD in a data view web part.



<xsl:variable name="X"

select="number((ddwrt:DateTimeTick(ddwrt:GenDisplayName(
string(ddwrt:Today())))-(ddwrt:DateTimeTick(ddwrt:GenDisplayName(
string(@Date_x0020_only))))) div 864000000000)">

</xsl:variable>

<xsl:if test="$X &gt; 0 div 864000000000 and $X &lt;= 7 div 864000000000">

<xsl:text> WEEK 1</xsl:text>

</xsl:if>

<xsl:if test="$X &gt; 7 div 864000000000 and $X &lt;= 14 div 864000000000">

<xsl:text> WEEK 2</xsl:text>

</xsl:if>

<xsl:if test="$X &gt; 14 div 864000000000 and $X &lt;= 21 div 864000000000">

<xsl:text> WEEK 3</xsl:text>

</xsl:if>

<xsl:if test="$X &gt; 21 div 864000000000">

<xsl:text> Escalation</xsl:text>

</xsl:if>


SO here is what the result looks like in SPD:


SPD Preview


And here is what it looks like in Internet Explorer:


SP Browser


The 1st column is the date created, the 2nd column is the formula aging result, and the 3rd column is the value of the X variable in the formula. Notice how the 2nd column values values are different between the broswer and SPD preview.


So for some reason in the SPD the code works perfectly and displays the correct Aging label I've given it in the code. In IE though its just lists everything as escalation. Some more background of the code I'm using.


If you notice I'm dividing every calculation by 864000000000. Apparently SPD and SharePoint server use different time and date methods or something so in order for the calculations to be displayed correctly all days must be div by 864000000000. Here is where I originally found my date time fix:


http://ift.tt/1xeQQBC


So that may have nothing to do with it but I just wanted everyone to have the background. If anyone can help me with this I would Greatly appreciate it.








0 commentaires:

Enregistrer un commentaire