Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Validate start time to be in the future if event has no end time #297

Open
Rikuoja opened this issue Feb 2, 2018 · 1 comment
Open

Validate start time to be in the future if event has no end time #297

Rikuoja opened this issue Feb 2, 2018 · 1 comment

Comments

@Rikuoja
Copy link
Contributor

Rikuoja commented Feb 2, 2018

Currently, trying to create an event that starts in the past and has no end time fails. This is because the API assumes that events with only start time end at midnight, as per Linkedevents conventions, and past events may not be edited.

However, the UI is unable to process the API response "end time cannot be in the past", and yields

Uncaught TypeError: Cannot read property 'path' of undefined
    at exports.default (validator.js?3f13:34)

if the API returns HTTP 400.

Therefore, if the end time field is left empty, we must have a validator that checks that the start time is today or in the future, so the API will accept the PUT/POSTed event.

@aleksisalonen
Copy link
Contributor

This is still an issue, UI gives error (on indicator arrow)
"validation-defaultEndInTheFuture"
that persists, even if corrected.

PS. Error text on arrow should ead: "Tapahtuma ei voi alkaa menneisyydessä" / "Event cannot start in the past"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants