Skip to content

Commit

Permalink
GMT date fix as suggested by @ThomasDaheim
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-soni committed Jun 15, 2017
1 parent 5c07bd9 commit a9f2d0a
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 20 deletions.
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,64 @@ bin/

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Java template
# Compiled class file

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)

# Package Files #
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
44 changes: 24 additions & 20 deletions src/com/hs/gpxparser/BaseGPX.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.TimeZone;

import com.hs.gpxparser.extension.IExtensionParser;

class BaseGPX {

protected final SimpleDateFormat xmlDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
protected final ArrayList<IExtensionParser> extensionParsers = new ArrayList<IExtensionParser>();
final SimpleDateFormat xmlDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
final ArrayList<IExtensionParser> extensionParsers = new ArrayList<>();

/**
* Adds a new extension parser to be used when parsing a gpx steam
*
* @param parser
* an instance of a {@link IExtensionParser} implementation
*/
public void addExtensionParser(IExtensionParser parser) {
this.extensionParsers.add(parser);
}
BaseGPX() {
// TF, 20170515: iso6801 dates are always in GMT timezone
xmlDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
}

/**
* Removes an extension parser previously added
*
* @param parser
* an instance of a {@link IExtensionParser} implementation
*/
public void removeExtensionParser(IExtensionParser parser) {
this.extensionParsers.remove(parser);
}
/**
* Adds a new extension parser to be used when parsing a gpx steam
*
* @param parser an instance of a {@link IExtensionParser} implementation
*/
public void addExtensionParser(IExtensionParser parser) {
this.extensionParsers.add(parser);
}

/**
* Removes an extension parser previously added
*
* @param parser an instance of a {@link IExtensionParser} implementation
*/
public void removeExtensionParser(IExtensionParser parser) {
this.extensionParsers.remove(parser);
}
}

0 comments on commit a9f2d0a

Please sign in to comment.