Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fix version build date in settings widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Randall Barker committed Oct 8, 2018
1 parent e674612 commit 7d8f642
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,16 @@ private void onDeveloperOptionsClick() {
* For local debug builds we use a fixed versionCode to not mess with the caching mechanism of the build
* system. The fixed local build number is 1.
*
* @param aVersionCode
* @param aVersionCode Application version code minus the leading architecture digit.
* @return String The converted date in the format yyyy-MM-dd
*/
private String versionCodeToDate(int aVersionCode) {
private String versionCodeToDate(final int aVersionCode) {
String versionCode = Integer.toString(aVersionCode);

String formatted;
try {
int year = Integer.parseInt(versionCode.substring(1, 2)) + 2016;
int dayOfYear = Integer.parseInt(versionCode.substring(2, 5));
int year = Integer.parseInt(versionCode.substring(0, 1)) + 2016;
int dayOfYear = Integer.parseInt(versionCode.substring(1, 4));

GregorianCalendar cal = (GregorianCalendar)GregorianCalendar.getInstance();
cal.set(Calendar.YEAR, year);
Expand Down

0 comments on commit 7d8f642

Please sign in to comment.