我使用alamkanak / Android-Week-View库并且工作正常,但我想阻止这种情况发生:
我试试这个:
Calendar oldEndTime = null;
Calendar oldStartTime = null;
for (int i = 0; i < mNewEvents.size(); i++) {
oldEndTime = mNewEvents.get(i).getEndTime();
oldStartTime = mNewEvents.get(i).getStartTime();
}
if ( mNewEvents.size() == 0
|| event.getEndTime().before(oldStartTime)
|| event.getStartTime().after(oldEndTime) ){
mNewEvents.add(event);
} else {
Toast.makeText(this, "Noop", Toast.LENGTH_SHORT).show();
}
答案 0 :(得分:0)
请检查react-select@2.0.0-alpha.2
循环的右括号是否设置正确。您在循环中设置for
和oldStartTime
,但您的测试仅在循环之后完成一次。也许是这样的?
oldEndTime