Skip to content

Commit

Permalink
Minor Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan Khanna committed Jul 30, 2014
1 parent a416492 commit 3ea97d0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,14 @@
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicBoolean;

import butterknife.ButterKnife;
Expand Down Expand Up @@ -439,12 +444,20 @@ public void success(final Client client, Response response) {
tv_externalId.setText(client.getExternalId());

try {

tv_activationDate.setText(DateHelper.getDateAsString(client.getActivationDate()));
List<Integer> dateObj = client.getActivationDate();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd MMM yyyy");
Date date = simpleDateFormat.parse(DateHelper.getDateAsString(dateObj));
Locale currentLocale = getResources().getConfiguration().locale;
DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, currentLocale);
//Date date = new Date(dateObj.get(0),dateObj.get(1)-1,dateObj.get(2));
String dateString = df.format(date);
tv_activationDate.setText(dateString);

}catch (IndexOutOfBoundsException e) {
Toast.makeText(getActivity(), getString(R.string.error_client_inactive), Toast.LENGTH_SHORT).show();
tv_activationDate.setText("");
} catch (ParseException e) {
e.printStackTrace();
}

tv_office.setText(client.getOfficeName());
Expand Down
6 changes: 6 additions & 0 deletions mifosng-android/src/main/java/com/mifos/utils/DateHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public static String getCurrentDateAsDateFormat() {

}

/**
*
* @param integersOfDate
* @return date in format dd MMM yyyy
*/

public static String getDateAsString(List<Integer> integersOfDate) {

StringBuilder stringBuilder = new StringBuilder();
Expand Down

0 comments on commit 3ea97d0

Please sign in to comment.