From 3ddbb6be0f2df1011a6c09673608fe156131c641 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 16 Mar 2015 07:38:20 -0700 Subject: [PATCH] include build timestamp as a long, and let android utilities format it based on locale and timezone. --- .../src/org/eehouse/android/xw4/DlgDelegate.java | 10 ++++++++-- xwords4/android/scripts/genvers.sh | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java index 8e3659c65..17c5c868b 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java @@ -35,7 +35,9 @@ import android.widget.Button; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; +import java.text.DateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.Iterator; @@ -490,10 +492,14 @@ public class DlgDelegate { { final View view = LocUtils.inflate( m_activity, R.layout.about_dlg ); TextView vers = (TextView)view.findViewById( R.id.version_string ); + + DateFormat df = DateFormat.getDateTimeInstance( DateFormat.SHORT, + DateFormat.SHORT ); + String dateString + = df.format( new Date( BuildConstants.BUILD_STAMP * 1000 ) ); vers.setText( getString( R.string.about_vers_fmt, getString( R.string.app_version ), - BuildConstants.GIT_REV, - BuildConstants.BUILD_STAMP ) ); + BuildConstants.GIT_REV, dateString ) ); TextView xlator = (TextView)view.findViewById( R.id.about_xlator ); String str = getString( R.string.xlator ); diff --git a/xwords4/android/scripts/genvers.sh b/xwords4/android/scripts/genvers.sh index 262b2d0e2..05e85bad9 100755 --- a/xwords4/android/scripts/genvers.sh +++ b/xwords4/android/scripts/genvers.sh @@ -55,7 +55,7 @@ class BuildConstants { public static final short CLIENT_VERS_RELAY = $CLIENT_VERS_RELAY; public static final boolean CHAT_SUPPORTED = $CHAT_SUPPORTED; public static final boolean THUMBNAIL_SUPPORTED = $THUMBNAIL_SUPPORTED; - public static final String BUILD_STAMP = "$(date +'%F at %R %Z')"; + public static final long BUILD_STAMP = $(date +'%s'); } EOF