WordPress.org

Making WordPress.org

Opened 3 years ago

Closed 23 months ago

#2065 closed enhancement (fixed)

Add year to dates on http://central.wordcamp.org/schedule/

Reported by: andreamiddleton Owned by: iandunn
Milestone: Priority: low
Component: WordCamp Site & Plugins Keywords: good-first-bug has-patch
Cc:

Description

As events on the WordCamp schedule get added with more and more advance time, it might get confusing whether an event is scheduled for this or next year. It would be good to add a year to the dates displayed on http://central.wordcamp.org/schedule/, like we have on https://central.wordcamp.org/schedule/past-wordcamps/.

Attachments (2)

2065.patch (920 bytes) - added by frq 3 years ago.
2065.2.patch (3.6 KB) - added by frq 3 years ago.

Download all attachments as: .zip

Change History (8)

#1 @iandunn
3 years ago

  • Keywords needs-patch good-first-bug added
  • Owner set to iandunn
  • Priority changed from normal to low
  • Status changed from new to accepted

@frq
3 years ago

#2 @frq
3 years ago

  • Keywords has-patch added; needs-patch removed

This is the first time submitting a patch, so forgive if I am doing something wrong.

Although I doubt there will be a WordCamp with different start and end years, I left the possibility, just like there is one for months.

#3 @iandunn
3 years ago

The patch looks great, thanks @frq!

I'd make two suggestions to improve it:

1) the_wordcamp_date() is called by multiple templates, so adding the year unconditionally will create side-effects for them. One way to avoid that would be by adding a $year parameter that defaults to 'excluded'. If 'included' is passed, then the year is shown.

2) Add a header for each year, similar to the Past WordCamps template. You can use group_wordcamps_by_year() to make that easier.

@frq
3 years ago

#4 @frq
3 years ago

Hey @iandunn, thanks for the support.

I tried to do as you pointed me, hope I undestood it correctly.

1) Added a show_year that defaults to false in the_wordcamp_date. If true, the year is shown as in the first patch.

2) Modified template_schedule.php to show the list of WordCamps grouped by year, as in template-past-wordcamps.php. Thought about adding a conditional here to show or not the headings with the year, but was not sure about it.

#5 @iandunn
3 years ago

Those look great, thanks :) I'll add this to my list of patches to commit.

There's a few places where it doesn't match the coding standards, but I can quickly fix those before I commit it. For future reference, though, keep these in mind:

#6 @coreymckrill
23 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 5530:

WordCamp Central: Add year to camp dates on the schedule

Changes the Schedule page template to emulate the organization on the
Past Camps page template, by grouping camps under a year header and
including the year in each camp's date.

This also adds a param to WordCamp_Central_Theme::the_wordcamp_date to
include the year in the camp date output. The default is to not include
it, for backcompat.

Props frq
Fixes #2065

Note: See TracTickets for help on using tickets.