Date formatting improved

main
Inga 🏳‍🌈 15 years ago
parent 184f697a6f
commit 1d58254625
  1. 2
      Builder/IISMainHandler/build.txt
  2. 3
      Common/UserContext.cs
  3. 2
      IISMainHandler/handlers/AbstractGetHandler.cs
  4. 8
      templates/Full/elems/Header.xslt
  5. 34
      templates/Full/elems/Main.xslt

@ -45,7 +45,8 @@ namespace FLocal.Common {
new XElement("mday", dateTime.Day),
new XElement("hour", dateTime.Hour),
new XElement("minute", dateTime.Minute),
new XElement("second", dateTime.Second)
new XElement("second", dateTime.Second),
new XElement("ticks", dateTime.Ticks)
);
}

@ -19,7 +19,7 @@ namespace FLocal.IISHandler.handlers {
new XElement("root",
this.getSpecificData(context),
new XElement("title", Config.instance.AppInfo),
new XElement("timestamp", DateTime.Now.Ticks.ToString()),
new XElement("current", DateTime.Now.ToXml()),
context.exportSession(),
context.userSettings.skin.exportToXml()
)

@ -35,13 +35,13 @@
<tr>
<td align="center" class="menubar">
<a target="_top">
<xsl:attribute name="href">/Boards/?<xsl:value-of select="timestamp"/></xsl:attribute>
<xsl:attribute name="href">/Boards/?<xsl:value-of select="current/date/ticks"/></xsl:attribute>
<xsl:text>Ñïèñîê ôîðóìîâ</xsl:text>
</a>
<xsl:text> | </xsl:text>
<a target="_top">
<xsl:if test="session/sessionKey">
<xsl:attribute name="href">/Conversations/?<xsl:value-of select="timestamp"/></xsl:attribute>
<xsl:attribute name="href">/Conversations/?<xsl:value-of select="current/date/ticks"/></xsl:attribute>
<xsl:if test="session/indicators/unreadPrivateMessages != '0'">
<img src="/static/images/newpm.gif" border="0">
<xsl:attribute name="alt">
@ -57,7 +57,7 @@
<xsl:text> | </xsl:text>
<a target="_top">
<xsl:if test="session/sessionKey">
<xsl:attribute name="href">/Upload/List/?<xsl:value-of select="timestamp"/></xsl:attribute>
<xsl:attribute name="href">/Upload/List/?<xsl:value-of select="current/date/ticks"/></xsl:attribute>
</xsl:if>
<xsl:text>Àïëîàä</xsl:text>
</a>
@ -77,7 +77,7 @@
</a>
<xsl:text> | </xsl:text>
<a target="_top">
<xsl:attribute name="href">/Users/Online/?<xsl:value-of select="timestamp"/></xsl:attribute>
<xsl:attribute name="href">/Users/Online/?<xsl:value-of select="current/date/ticks"/></xsl:attribute>
<xsl:text>Êòî â îíëàéíå</xsl:text>
</a>
<xsl:text> | </xsl:text>

@ -64,13 +64,31 @@
<xsl:value-of select="*/name"/>
</xsl:template>
<xsl:template match="date" mode="_date">
<xsl:choose>
<xsl:when test="year=/root/current/date/year and month=/root/current/date/month and mday=/root/current/date/mday">
<xsl:text>ñåãîäíÿ</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="year=/root/current/date/year and month=/root/current/date/month and (mday+1)=/root/current/date/mday">
<xsl:text>â÷åðà</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(mday, '00')"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="format-number(month, '00')"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="year"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="date" mode="dateTime">
<span nowrap="nowrap">
<xsl:value-of select="format-number(mday, '00')"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="format-number(month, '00')"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="year"/>
<xsl:apply-templates select="current()" mode="_date"/>
<xsl:text> </xsl:text>
<xsl:value-of select="format-number(hour, '00')"/>
<xsl:text>:</xsl:text>
@ -82,11 +100,7 @@
<xsl:template match="date" mode="date">
<span nowrap="nowrap">
<xsl:value-of select="format-number(mday, '00')"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="format-number(month, '00')"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="year"/>
<xsl:apply-templates select="current()" mode="_date"/>
</span>
</xsl:template>

Loading…
Cancel
Save