From 663071229ca209ed500c5a0b1100f049aee85219 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 13 Jun 2013 17:09:08 +0300 Subject: [PATCH] Fix date/time formats in AddEventActivity --- src/ro/ieval/unical/AddEventActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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))); -- 2.39.2