mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Treat duration as minutes if dive would be short
This will read duration from CSV in minutes if the dive would be less than 10 minutes when treating the duration as seconds. In practice, this means that free-divers cannot import dive duration properly from CSV, but this should be sensible for scuba divers. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
83ccf24e1e
commit
0f7c4ecd90
1 changed files with 11 additions and 1 deletions
|
@ -156,11 +156,21 @@
|
|||
</xsl:if>
|
||||
|
||||
<xsl:if test="$durationField >= 0">
|
||||
<xsl:attribute name="duration">
|
||||
<xsl:variable name="duration">
|
||||
<xsl:call-template name="getFieldByIndex">
|
||||
<xsl:with-param name="index" select="$durationField"/>
|
||||
<xsl:with-param name="line" select="$line"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:attribute name="duration">
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring-before($duration, ':') = '' and $duration < 600">
|
||||
<xsl:value-of select="$duration * 60"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$duration"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue