Making WordPress.org

Opened 5 years ago

Closed 5 years ago

#4637 closed enhancement (fixed)

WP Events Dashboard widget could be improved for multi-days events

Reported by: imath's profile imath Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Events API Keywords: has-patch
Cc:

Description

Hi!

Following up with this conversation on Slack #meta-wordcamp about the Events Dashboard Widget. So far it only displayed the starting date of an event. It's great for meetups, it's a bit annoying for some WordCamps.

When a WordCamp is a multi-days event, only using a starting date is problematic :

  • It doesn't inform about the WordCamp's length
  • The first day of a WordCamp might be a Contributor Day (It's actually the case that generated this ticket)
  • There is some inconsistency with the schedule on central.wordcamp.org (which displays a range of days).

I've dived a bit into the Meta Repository and it looks like the end_date is an existing field into the wporg_events table, so I guess a first step would be to include this fiels into the JSON response. That's what I've tried to do in the first attached patch.

Then, the second step could be to update the WP_Community_Events from WordPress Core repository so that if the event is not a meetup and contains this end_date property, then display a range of day instead of the first day.

here's a screenshot of a test I've made with the wp-community-events.patch attached to this ticket:
https://cldup.com/H5h3x9a267.png

Thanks in advance for your help.

Attachments (3)

4637.patch (1.5 KB) - added by imath 5 years ago.
wp-community-events.patch (1.4 KB) - added by imath 5 years ago.
Proposal2.PNG (23.1 KB) - added by casiepa 5 years ago.
Adding number of days instead of enddate

Download all attachments as: .zip

Change History (14)

@imath
5 years ago

#1 @casiepa
5 years ago

Some comments/ideas:

  1. I confirm that the standard Central API is already exposing the end-date, so it should be easy to get/add it: https://central.wordcamp.org/wp-json/wp/v2/wordcamps (I have been using it for years on some pages)
  2. I don't really see why having the first day a Contrib Day can start confusion. Contributor Day is part of the event, so that is your start date according to me.
  3. In your example, setting it as 'Sep 13-14, 2019' seems to break with the format of the other dates that start with the weekday. How about keeping the standard format and use the 2nd line?
  4. How about just adding the number of days on the next line (see attached image).

@casiepa
5 years ago

Adding number of days instead of enddate

#2 @iandunn
5 years ago

Related #4319

#3 @dd32
5 years ago

Just to confirm, we do store a end_date field for the wporg_events table and fill it correctly according to the WordCamp data-source, for example for WordCamp Brisbane (A 2 day event) the Database table looks like this: {... "date_utc": "2019-08-24 00:00:00", "date_utc_offset": null, "end_date": "2019-08-25 00:00:00", ...}

Adding the end_date field to the response (as done in 4637.patch), ~or perhaps a dates field instead~ is possible, but you'll then need to raise a core ticket to actually use that data and work out a UI.
(edit: Removed second suggestion, end_date works best IMHO, plus it's set for Meetup events as it provides and endtime, ie. 2019-07-30 9:00:00 -> 2019-07-30 12:00:00)

For others, the API responsible is here:
https://meta.trac.wordpress.org/browser/sites/trunk/api.wordpress.org/public_html/events/1.0/index.php

Last edited 5 years ago by dd32 (previous) (diff)

#4 @imath
5 years ago

@casiepa

Thanks for your feedbacks. About the format, I thought it was best to use the one Central uses.

https://cldup.com/rKqPP7b6xy.png

And actually I wasn't! So I will raise a core ticket with an updated version of wp-community-events.patch. Thanks for your advices @iandunn & @dd32.

#5 @imath
5 years ago

FYI here is the link to the WordPress Core ticket (47798).

This ticket was mentioned in Slack in #meta-wordcamp by imath. View the logs.


5 years ago

#7 @_DorsVenabili
5 years ago

+1 to this request :)

This ticket was mentioned in Slack in #core by pbiron. View the logs.


5 years ago

#9 @desrosj
5 years ago

Came across this while reviewing #WP47798. Is committing this change realistic for the beta 1 deadline for 5.3 in 4 days (23 September)?

Last edited 5 years ago by dd32 (previous) (diff)

#10 @dd32
5 years ago

  • Component changed from API to Events API

#11 @dd32
5 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 9349:

Events API: Add the end_date field to allow clients to display end dates or event durations.

Props imath.
Fixes #4637.

Note: See TracTickets for help on using tickets.