Skip to content

Commit 1c5f928

Browse files
committed
Show book last export date as "never" when it has never been exported.
The epoch date was shown instead. Fixes #615
1 parent 8372102 commit 1c5f928

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

app/src/main/java/org/gnucash/android/ui/settings/BookManagerFragment.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
import org.gnucash.android.ui.common.Refreshable;
5555
import org.gnucash.android.util.PreferencesHelper;
5656

57+
import java.sql.Timestamp;
58+
5759
/**
5860
* Fragment for managing the books in the database
5961
*/
@@ -159,8 +161,12 @@ public void bindView(View view, final Context context, Cursor cursor) {
159161

160162
final String bookUID = cursor.getString(cursor.getColumnIndexOrThrow(BookEntry.COLUMN_UID));
161163

164+
Timestamp lastSyncTime = PreferencesHelper.getLastExportTime(bookUID);
162165
TextView lastSyncText = (TextView) view.findViewById(R.id.last_sync_time);
163-
lastSyncText.setText(PreferencesHelper.getLastExportTime(bookUID).toString());
166+
if (lastSyncTime.equals(new Timestamp(0)))
167+
lastSyncText.setText(R.string.last_export_time_never);
168+
else
169+
lastSyncText.setText(lastSyncTime.toString());
164170

165171
TextView labelLastSync = (TextView) view.findViewById(R.id.label_last_sync);
166172
labelLastSync.setText(R.string.label_last_export_time);

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,4 +486,5 @@
486486
<string name="repeat_x_times">for %1$s times</string>
487487
<string name="menu_show_compact_view">Compact View</string>
488488
<string name="book_default_name">Book %1$d</string>
489+
<string name="last_export_time_never">never</string>
489490
</resources>

0 commit comments

Comments
 (0)