do not allow scheduling events in the past
This commit is contained in:
parent
2268100a20
commit
5f084488ac
|
@ -188,6 +188,11 @@ public class EventActivity extends AppCompatActivity implements DBHelper.DBOpera
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DateTime.now().isAfter(mEventStartDateTime.getMillis())) {
|
||||||
|
Utils.showToast(getApplicationContext(), R.string.start_in_past);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final DBHelper dbHelper = DBHelper.newInstance(getApplicationContext(), this);
|
final DBHelper dbHelper = DBHelper.newInstance(getApplicationContext(), this);
|
||||||
final String description = mDescriptionET.getText().toString().trim();
|
final String description = mDescriptionET.getText().toString().trim();
|
||||||
final int reminderMinutes = getReminderMinutes();
|
final int reminderMinutes = getReminderMinutes();
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<string name="delete">Delete</string>
|
<string name="delete">Delete</string>
|
||||||
<string name="title_empty">Title cannot be empty</string>
|
<string name="title_empty">Title cannot be empty</string>
|
||||||
<string name="end_before_start">The event cannot end earlier than it starts</string>
|
<string name="end_before_start">The event cannot end earlier than it starts</string>
|
||||||
|
<string name="start_in_past">You cannot schedule events in the past</string>
|
||||||
<string name="event_added">Event added successfully</string>
|
<string name="event_added">Event added successfully</string>
|
||||||
<string name="event_updated">Event updated successfully</string>
|
<string name="event_updated">Event updated successfully</string>
|
||||||
<string name="reminder">Reminder</string>
|
<string name="reminder">Reminder</string>
|
||||||
|
|
Loading…
Reference in New Issue