Round duration to next hour

pull/152/head
M66B 6 years ago
parent 9e224f5918
commit c8238ae1ae

@ -24,7 +24,7 @@ public class DialogDuration {
final DatePicker datePicker = dview.findViewById(R.id.datePicker); final DatePicker datePicker = dview.findViewById(R.id.datePicker);
final Calendar cal = Calendar.getInstance(); final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(new Date().getTime() / (60 * 1000L) * (60 * 1000L)); cal.setTimeInMillis((new Date().getTime() / (3600 * 1000L) + 1) * (3600 * 1000L));
Log.i("Set init=" + new Date(cal.getTimeInMillis())); Log.i("Set init=" + new Date(cal.getTimeInMillis()));
final DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.FULL, SimpleDateFormat.SHORT); final DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.FULL, SimpleDateFormat.SHORT);

Loading…
Cancel
Save