code: private static int getDailyRecIndex(ArrayList<Map> dailyData, String findDate, int start, int expectedDiff) {
          String date;
          if (start + expectedDiff < dailyData.size()) {
              date = getValueOr(dailyData.get(start + expectedDiff), "w_date", "");
              if (isSameDate(date, findDate, "-")) {
                  return start + expectedDiff;
              } else {
                  expectedDiff++;
                  date = getValueOr(dailyData.get(start + expectedDiff), "w_date", "");
                  if (isSameDate(date, findDate, "-")) {
                      return start + expectedDiff;
                  }
              }
          }
  
          for (int j = start; j < dailyData.size(); j++) {
              date = getValueOr(dailyData.get(j), "w_date", "");
              if (isSameDate(date, findDate, "-")) {
                  return j;
              }
          }
          return dailyData.size();
      }
docs: Find the index of daily data array for the particular date
  
  @param dailyData The array of daily data
  @param findDate The expected date
  @param start The start index for searching
  @param expectedDiff The default difference between start index and
  expected index (will try this index first, if failed then start loop)
  @return The index for the expected date, if no matching data, will return
  the size of array