@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));
}
@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)));