aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2013-06-04 23:04:01 +0200
committerrsudev <rasch@munin-soft.de>2013-06-04 23:04:01 +0200
commit70c2bec739bd01224d729abd643a4c2ce4d4dce1 (patch)
treee89af9b0c2c39f5bcc46ef23e0ef766a4d05d0ca
parent51cd584bea567259ed7df4a01881d026b41addf8 (diff)
parentd6db97c0057f15474e16a1ee78f85ef20d8c527a (diff)
downloadcgeo-70c2bec739bd01224d729abd643a4c2ce4d4dce1.zip
cgeo-70c2bec739bd01224d729abd643a4c2ce4d4dce1.tar.gz
cgeo-70c2bec739bd01224d729abd643a4c2ce4d4dce1.tar.bz2
Merge remote-tracking branch 'upstream/release' into currdev
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCParser.java5
-rw-r--r--main/src/cgeo/geocaching/connector/gc/Login.java9
2 files changed, 12 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java
index 87f5985..15958ba 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCParser.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java
@@ -54,6 +54,7 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.EnumSet;
+import java.util.GregorianCalendar;
import java.util.List;
import java.util.Locale;
import java.util.Set;
@@ -975,7 +976,7 @@ public abstract class GCParser {
"__EVENTARGUMENT", "",
"__LASTFOCUS", "",
"ctl00$ContentBody$LogBookPanel1$ddLogType", Integer.toString(logType.id),
- "ctl00$ContentBody$LogBookPanel1$uxDateVisited", String.format("%02d", month) + "/" + String.format("%02d", day) + "/" + String.format("%04d", year),
+ "ctl00$ContentBody$LogBookPanel1$uxDateVisited", Login.getCustomGcDateFormat().format(new GregorianCalendar(year, month - 1, day).getTime()),
"ctl00$ContentBody$LogBookPanel1$uxDateVisited$Month", Integer.toString(month),
"ctl00$ContentBody$LogBookPanel1$uxDateVisited$Day", Integer.toString(day),
"ctl00$ContentBody$LogBookPanel1$uxDateVisited$Year", Integer.toString(year),
@@ -1176,7 +1177,7 @@ public abstract class GCParser {
params.put("ctl00$ContentBody$LogBookPanel1$uxDateVisited", "");
} else {
params.put("ctl00$ContentBody$LogBookPanel1$DateTimeLogged", Integer.toString(month) + "/" + Integer.toString(day) + "/" + Integer.toString(year));
- params.put("ctl00$ContentBody$LogBookPanel1$uxDateVisited", Integer.toString(month) + "/" + Integer.toString(day) + "/" + Integer.toString(year));
+ params.put("ctl00$ContentBody$LogBookPanel1$uxDateVisited", Login.getCustomGcDateFormat().format(new GregorianCalendar(year, month - 1, day).getTime()));
}
params.put(
"ctl00$ContentBody$LogBookPanel1$DateTimeLogged$Day", Integer.toString(day),
diff --git a/main/src/cgeo/geocaching/connector/gc/Login.java b/main/src/cgeo/geocaching/connector/gc/Login.java
index f3ef290..7351311 100644
--- a/main/src/cgeo/geocaching/connector/gc/Login.java
+++ b/main/src/cgeo/geocaching/connector/gc/Login.java
@@ -328,6 +328,15 @@ public abstract class Login {
return parseGcCustomDate(input, Settings.getGcCustomDate());
}
+ public static SimpleDateFormat getCustomGcDateFormat() {
+ final String format = Settings.getGcCustomDate();
+ if (gcCustomDateFormats.containsKey(format)) {
+ return gcCustomDateFormats.get(format);
+ }
+
+ return gcCustomDateFormats.get("MM/dd/yyyy");
+ }
+
/**
* checks if an Array of Strings is empty or not. Empty means:
* - Array is null