[PATCH] Treat duration as minutes if dive would be short
Davide DB
dbdavide at gmail.com
Wed Dec 31 03:46:55 PST 2014
Why do not add a format selector tas date? It's just a radio button min/sec.
davide at mobile
Il 31/dic/2014 12:41 "Miika Turkia" <miika.turkia at gmail.com> ha scritto:
> 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 at gmail.com>
> ---
> xslt/manualcsv2xml.xslt | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/xslt/manualcsv2xml.xslt b/xslt/manualcsv2xml.xslt
> index 55968b5..d749443 100644
> --- a/xslt/manualcsv2xml.xslt
> +++ b/xslt/manualcsv2xml.xslt
> @@ -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>
>
> --
> 1.9.1
>
> _______________________________________________
> subsurface mailing list
> subsurface at subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20141231/ab932548/attachment.html>
More information about the subsurface
mailing list