summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-03-29 09:39:27 -0700
committerKeith Packard <keithp@keithp.com>2011-03-29 09:39:27 -0700
commit56d045040c49728a854741e99545766f3723da5e (patch)
treef31d7a38020f49c673b955644679fd23266d1e6c
parent8ade7d99f02df825e70d0a964b4648156101ef78 (diff)
altosui: Don't display 0000-00-00 for missing flight log dates
With Tm/Tn not having GPS to get the current date, it's no longer unusual to have no date for a flight log, so don't show the 0000-00-00 piece in that case. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--altosui/AltosEepromSelect.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/altosui/AltosEepromSelect.java b/altosui/AltosEepromSelect.java
index cb71524d..0a6eec17 100644
--- a/altosui/AltosEepromSelect.java
+++ b/altosui/AltosEepromSelect.java
@@ -45,8 +45,14 @@ class AltosEepromItem implements ActionListener {
public AltosEepromItem(AltosEepromLog in_log) {
log = in_log;
- label = new JLabel(String.format("Flight #%02d - %04d-%02d-%02d",
- log.flight, log.year, log.month, log.day));
+ String text;
+ if (log.year != 0)
+ text = String.format("Flight #%02d - %04d-%02d-%02d",
+ log.flight, log.year, log.month, log.day);
+ else
+ text = String.format("Flight #%02d", log.flight);
+
+ label = new JLabel(text);
download = new JCheckBox("", log.download);
download.addActionListener(this);