private void groupShowByDate(List<ShowInfoBean> list) { todayList.clear(); tomorrrowList.clear(); theDayAfter.clear(); Date date = new Date(); String today = DateUtil.getDateString(date, "yyyy-MM-dd"); for (ShowInfoBean bean : list) { LogUtil.e(getClass(), "today==>" + today + ", bean fdate==>" + bean.getShowdate()); if (today.equals(bean.getShowdate())) { todayList.add(bean); } } Calendar c = Calendar.getInstance(); c.setTime(date); c.add(c.DATE, 1); String tomorrow = DateUtil.getDateString(c.getTime(), "yyyy-MM-dd"); for (ShowInfoBean bean : list) { if (tomorrow.equals(bean.getShowdate())) { tomorrrowList.add(bean); } } c.setTime(date); c.add(c.DATE, 2); String after = DateUtil.getDateString(c.getTime(), "yyyy-MM-dd"); for (ShowInfoBean bean : list) { if (after.equals(bean.getShowdate())) { theDayAfter.add(bean); } } }
private boolean canBuy(String time) { Date date = new Date(); Calendar c = Calendar.getInstance(); c.setTime(date); c.add(c.MINUTE, 15); String str = DateUtil.getDateString(c.getTime(), "HH:mm"); return Integer.parseInt(time) > Integer.parseInt(str.replace(":", "")); }