From 3e95df495ed2f82b3e3fe1c0c3998b33e605edb9 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 20 Jan 2014 11:21:59 +0100 Subject: [PATCH] Correct month calculation in ol.format.IGC --- src/ol/format/igcformat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/format/igcformat.js b/src/ol/format/igcformat.js index 2100a10b33..ea4005822e 100644 --- a/src/ol/format/igcformat.js +++ b/src/ol/format/igcformat.js @@ -94,7 +94,7 @@ ol.format.IGC.prototype.readFeatureFromText = function(text) { var properties = {}; var flatCoordinates = []; var year = 2000; - var month = 1; + var month = 0; var day = 1; var i, ii; for (i = 0, ii = lines.length; i < ii; ++i) { @@ -134,7 +134,7 @@ ol.format.IGC.prototype.readFeatureFromText = function(text) { m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line); if (m) { day = parseInt(m[1], 10); - month = parseInt(m[2], 10); + month = parseInt(m[2], 10) - 1; year = 2000 + parseInt(m[3], 10); } else { m = ol.format.IGC.H_RECORD_RE_.exec(line);