Correct month calculation in ol.format.IGC

This commit is contained in:
Tom Payne
2014-01-20 11:21:59 +01:00
parent 52a0263310
commit 3e95df495e
+2 -2
View File
@@ -94,7 +94,7 @@ ol.format.IGC.prototype.readFeatureFromText = function(text) {
var properties = {}; var properties = {};
var flatCoordinates = []; var flatCoordinates = [];
var year = 2000; var year = 2000;
var month = 1; var month = 0;
var day = 1; var day = 1;
var i, ii; var i, ii;
for (i = 0, ii = lines.length; i < ii; ++i) { 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); m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line);
if (m) { if (m) {
day = parseInt(m[1], 10); day = parseInt(m[1], 10);
month = parseInt(m[2], 10); month = parseInt(m[2], 10) - 1;
year = 2000 + parseInt(m[3], 10); year = 2000 + parseInt(m[3], 10);
} else { } else {
m = ol.format.IGC.H_RECORD_RE_.exec(line); m = ol.format.IGC.H_RECORD_RE_.exec(line);