]> iEval git - unical.git/commitdiff
Fix date/time formats in AddEventActivity
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 13 Jun 2013 14:09:08 +0000 (17:09 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 13 Jun 2013 14:09:08 +0000 (17:09 +0300)
src/ro/ieval/unical/AddEventActivity.java

index 59ddd5bf311a9247cb2c00cfa201f33a5edca19e..17c86d4bdb9102d3761604d13e7e5f8afa8550b0 100644 (file)
@@ -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)));
This page took 0.023536 seconds and 4 git commands to generate.