Exemplo n.º 1
0
 /**
  * 添加段子
  *
  * @param content
  * @param afterToday true今天之后,反之今天之前
  * @return
  */
 public boolean inSertContent(String content, boolean afterToday) {
   Date date = afterToday ? mDailyJokeDAO.getLastDate() : mDailyJokeDAO.getBeforeDate();
   if (date == null) {
     date = filterDateFormat(new Date());
     if (getByDate(date) != null) return false;
   } else {
     date = offsetDate(afterToday ? 1 : -1, date);
   }
   DailyJoke dj = new DailyJoke();
   dj.setContent(content);
   dj.setDate(date);
   return inSert(dj);
 }