فهرست منبع

gracefully handle non-conformant timestamps

[SVN r28759]
Aleksey Gurtovoy 21 سال پیش
والد
کامیت
9f33118317
1فایلهای تغییر یافته به همراه13 افزوده شده و 8 حذف شده
  1. 13 8
      tools/regression/xsl_reports/xsl/v2/common.xsl

+ 13 - 8
tools/regression/xsl_reports/xsl/v2/common.xsl

@@ -192,14 +192,19 @@ http://www.boost.org/LICENSE_1_0.txt)
     
     <func:function name="meta:format_timestamp">
         <xsl:param name="timestamp"/>
-
-        <xsl:variable name="time" select="substring-before( date:time( $timestamp ), 'Z' )"/>
-        <xsl:variable name="day" select="date:day-in-month( $timestamp )"/>
-        <xsl:variable name="day_abbrev" select="date:day-abbreviation( $timestamp )"/>
-        <xsl:variable name="month_abbrev" select="date:month-abbreviation( $timestamp )"/>
-        <xsl:variable name="year" select="date:year( $timestamp )"/>        
-        
-        <func:result select="concat( $day_abbrev, ', ', $day, ' ', $month_abbrev, ' ', $year, ' ', $time, ' +0000' )"/>
+        <xsl:choose>
+            <xsl:when test="date:date( $timestamp ) = ''">
+                <func:result select="$timestamp"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:variable name="time" select="substring-before( date:time( $timestamp ), 'Z' )"/>
+                <xsl:variable name="day" select="date:day-in-month( $timestamp )"/>
+                <xsl:variable name="day_abbrev" select="date:day-abbreviation( $timestamp )"/>
+                <xsl:variable name="month_abbrev" select="date:month-abbreviation( $timestamp )"/>
+                <xsl:variable name="year" select="date:year( $timestamp )"/>
+                <func:result select="concat( $day_abbrev, ', ', $day, ' ', $month_abbrev, ' ', $year, ' ', $time, ' +0000' )"/>
+            </xsl:otherwise>
+        </xsl:choose>
 
     </func:function>
     

粤ICP备19079148号