code: protected void moveToIntervalStart(Calendar cal) {
          int year = cal.get(Calendar.YEAR);
          int month = cal.get(Calendar.MONTH);
          int day = cal.get(Calendar.DAY_OF_MONTH);
          cal.clear();
          cal.set(year, month, day);
      }
docs: Moves calendar to beginning of day.