[PATCH] CSV import: add min:sec format support

Miika Turkia miika.turkia at gmail.com
Sun Jul 27 22:18:39 PDT 2014


On CSV import the time can be represented with seconds, min:sec or
hour:min:sec. This patch adds support for the min:sec format that was
missing.

See #662

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 xslt/csv2xml.xslt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index f2a11da..4d9aa86 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -105,6 +105,11 @@
                 </xsl:with-param>
               </xsl:call-template>
             </xsl:when>
+            <xsl:when test="substring-after(substring-after($value, ':'), ':') = ''">
+              <!-- We assume time format m:s -->
+
+              <xsl:value-of select="substring-before($value, ':') * 60 + substring-after($value, ':')" />
+            </xsl:when>
             <xsl:otherwise>
               <!-- We assume time format h:m:s -->
 
-- 
1.9.1



More information about the subsurface mailing list