From: Marius Gavrilescu Date: Thu, 13 Jun 2013 14:09:08 +0000 (+0300) Subject: Fix date/time formats in AddEventActivity X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=663071229ca209ed500c5a0b1100f049aee85219;p=unical.git Fix date/time formats in AddEventActivity --- diff --git a/src/ro/ieval/unical/AddEventActivity.java b/src/ro/ieval/unical/AddEventActivity.java index 59ddd5b..17c86d4 100644 --- a/src/ro/ieval/unical/AddEventActivity.java +++ b/src/ro/ieval/unical/AddEventActivity.java @@ -82,7 +82,7 @@ public final class AddEventActivity extends Activity implements OnDateSetListene @Override public void onTimeSet(final TimePicker picker, final int hour, final int minute) { - dateTimeTextView.setText(String.format("%2d:%2d",hour,minute)); + dateTimeTextView.setText(String.format("%02d:%02d",hour,minute)); if(dateTimeTextView.getId() == R.id.time_start) ((TextView)findViewById(R.id.time_end)).setText(String.format("%2d:%2d",hour,minute)); } @@ -90,7 +90,7 @@ public final class AddEventActivity extends Activity implements OnDateSetListene @Override public void onDateSet(final DatePicker picker, final int year, final int monthOfYear, final int dayOfMonth) { final Calendar calendar=new GregorianCalendar(year, monthOfYear, dayOfMonth); - dateTimeTextView.setText(String.format("%4d-%2d-%2d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH))); + dateTimeTextView.setText(String.format("%4d-%02d-%02d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH))); calendar.add(Calendar.DAY_OF_MONTH, 1); if(dateTimeTextView.getId() == R.id.date_start) ((TextView)findViewById(R.id.date_end)).setText(String.format("%4d-%2d-%2d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)));