CSV import might have time in sec.fraction format

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2016-11-09 21:39:26 +02:00 committed by Dirk Hohndel
parent c78bbf6883
commit b88d403fb6

View file

@ -226,14 +226,14 @@
</xsl:call-template>
</xsl:when>
<xsl:when test="number(translate($value, ',', '.')) = translate($value, ',', '.')">
<!-- We assume time in seconds -->
<!-- We assume time in seconds with possibly fractions -->
<xsl:call-template name="sec2time">
<xsl:with-param name="timeSec">
<xsl:choose>
<xsl:when test="substring-after($value, '.') != ''">
<!-- Well, I suppose it was min.sec -->
<xsl:value-of select="substring-before($value, '.') * 60 + substring-after($value, '.')" />
<xsl:value-of select="substring-before($value, '.') * 60 + substring(substring-after($value, '.') * 60, 1, 2)" />
</xsl:when>
<xsl:when test="substring-after($value, ',') != ''">
<!-- Well, I suppose it was min.sec -->