add a comment and improve functionality

This commit is contained in:
hlq07 2018-05-12 12:54:13 +08:00
parent 19f4f9cc9e
commit d776dbf137
1 changed files with 11 additions and 2 deletions

View File

@ -151,12 +151,17 @@ public class PaintCalendarStrategy {
}
}
@Nullable
/**
* Returns a Calendar value this calendar showing
*
* @return the Calendar value
* @throws NullPointerException if no invoking paintCalendar before
*/
public Calendar getCalendarShowingDate() {
return (Calendar) mNow.clone();
}
public void onClickUnit(@Nullable Calendar date) {
private void onClickUnit(@Nullable Calendar date) {
if (date != null) {
Calendar[] whole = CalendarUtil.getWholeDayPeriod(date);
mPresenter.listTodoItemDuring(whole[0], whole[1]);
@ -170,6 +175,8 @@ public class PaintCalendarStrategy {
if (y.matches(regex) && m.matches(regex)) {
String time = String.format("%s-%s-1/0:0", y, m);
mPresenter.paintCalendar(CalendarUtil.constructCalendar(time));
} else {
showAlert("give a number");
}
}
@ -177,4 +184,6 @@ public class PaintCalendarStrategy {
mPresenter.paintCalendar(Calendar.getInstance());
}
private void showAlert(String text) {
}
}