verbb / events

Craft CMS Plugin for events management and ticketing.
Other
22 stars 13 forks source link

Event & ticket date / time validation #68

Closed dr-codswallop closed 2 years ago

dr-codswallop commented 4 years ago

It would be useful to have some validation errors in the admin panel which prevents an Event being saved if incorrect dates and times are defined by users.

EVENTS Some time_field validation so the event's End Date[time] is always after the Start Date[time].

Example : Currently a user can set an event to start at 9pm but end at 4pm the same night. Can't think of a real world use case where this is a desired behaviour.

EVENT TICKETS Like events, Available To should not be able to predate Available From

Lastly some validation of Available From & Available To so neither can be defined as date/times after the event's actual End Date[time]. This would still allow tickets to be purchased while the event is in progress but not once the event has ended.

engram-design commented 4 years ago

Clearly an oversight on my part, will fix.

anchovy commented 2 years ago

Hi @engram-design - any time frame for this?

engram-design commented 2 years ago

You shouldn't be able to actually set these dates to invalid times, as there's JS to prevent that from happening. But it is indeed an issue with the time. Same for Available From/To.

And correct on the secondary validation. We want people to be able to purchase before the event, during the event, but not after.

Added for the next release. To get the fix early, change your verbb/events requirement in composer.json to:

"require": {
  "verbb/events": "dev-craft-3 as 1.4.22",
  "...": "..."
}

Then run composer update.

engram-design commented 2 years ago

Added in 1.4.23