Feature idea: auto-bump a topic if its title contains today's date

On my forum, people post local events weeks or months in advance of the date.

Unfortunately, on the day of the event, the associated post is often long-buried.

It would be handy if Discourse could:

  • Identify dates automatically in post titles (as Apple apps do).
  • Automatically bump posts on their identified date
  • Show dates neatly and consistently on the topic list:
23 Likes

Oh, that’s a neat idea! A nifty form of very lightweight scheduling. I wonder if it could be abused though?

8 Likes

I like this idea - we also have a category on our forum for events, and this kind of interface would be ideal!

I think if it was enabled per-category, and there was only one date (or date range) associated with a topic, then the potential for abuse is fairly minimal?

4 Likes

I think the title would have to include the year? Or maybe just bump if the day and month are in the future, for the current year the topic was created in only?

7 Likes

for a 12 months range from created date, to make it work into the following year.

4 Likes

I think this is a nice case for

3 Likes

The challenge I see here is around parsing,

“11th Feb” vs
“11/2” vs
“2/11” (cause USA) vs
“11-02” vs
“Feb 11” vs
“Feb 11, 2017” vs
“Feb 2 - Come to the maker fair”
“Come to the maker fair - Feb 2”

It is a solvable problem but there is a lot of magic that would need to be added.

I think the first step here would be to build a plugin for it.

I am not that concerned about abuse cause you could simply ban abusers from posting in the category that allows for this magic behavior if you wanted to.

8 Likes

I think a library like this might be a good starting point:

https://github.com/iainbeeston/nickel/blob/master/README.md

I’d rather see this done with a date picker than use any magic at all.

I think that would also be much more discoverable.

11 Likes

And less prone to breakage with international issues. (Is today 5/8 or 8/5 in your mind?)

That’s the only format I would suggest supporting. Unique enough to not be accidental. The year could be optional, we assume current year unless 4-digit year is provided, e.g.

Feb 11, 2018
Feb 11 2018
Jan 30
Mar 3

So the regex would be

((Jan|Feb|Mar|Apr|May|June?|July?|Aug|Sep|Oct|Nov|Dec)\s\d{1,2})(,?\s\d{4})?

And that matches like so

In the UK, and possibly other English speaking countries, these formats are fairly obscure. I would never naturally write a date like that. The day would always go first, like 11th Feb 2018.
I would imagine that across the many languages Discourse is used in, these discrepancies get far harder to cope with.

I agree with @mcwumbly that a date picker would be a good option. I would imagine it is also waaaaaay easier to implement.

If it’s a magic feature, then it needs to support a multitude of formats to allow users to discover it naturally. A date picker is nice and clear, with no confusion (albeit at the expense of some screen real-estate).

11 Likes

Just one data point: I did a quick count of the formats used by our members in recent event listings

  • Xth Month – 16 times
  • X Month – 7 times
  • Month Xth – 6 times
  • Day Xth – 1 time

Alternative UX suggestion - provide a date picker button when we detect that the user is entering a date.

4 Likes

Fair point then I suggest a 2 pass check. We can also add an “allow two optional word chars after the number” rule to cover 3rd and 11th etc.

Pass one (US English)

((Jan|Feb|Mar|Apr|May|June?|July?|Aug|Sep|Oct|Nov|Dec)\s\d{1,2}(\w{2})?)(,?\s\d{4})?

Pass two (other English)

(\d{1,2}(\w{2})?\s(Jan|Feb|Mar|Apr|May|June?|July?|Aug|Sep|Oct|Nov|Dec))(,?\s\d{4})?

Works fine:

It is generally a super mega bad idea to try to “merge” two different regexes like this. Always go with multiple passes, it is far clearer.

3 Likes

I think this is a fantastic idea and would make a great feature / plugin component. I would be in favour of making it use a date picker.

Would be great in future and should be capable of building this into a graphical calendar like the broken calendar plugin that’s out there does.

3 Likes

That’s an excellent idea - I wonder if a Discourse instance could be linked to Google Calendar, and then we can benefit from their UI, and the ability for members to subscribe to this calendar.

1 Like

As we’re talking about Google Calendar now, I figured I would try all of Sam’s ideas above using Google Calendar’s quick add feature. Any change Google has open sourced this?

Worked (added an event on February 11, 2018):
“11th Feb”
“2/11”
“Feb 11”
“Feb 11, 2017”
“Feb 2 - Come to the maker fair”
“Come to the maker fair - Feb 2”

International issue (added an event on Novermber 2, 2017):
“11/2”

Failed (opened event editor):
“11-02”

5 Likes

What about other languages? The “most used format” might be different.

For instance, nobody ever writes a 3-letter month notation in Russian / Ukrainian. We usually write “6 апреля” (6th of April), or 06.04 (date comes always first).

2 Likes

:exclamation: What? That definitely should not schedule for the following year, especially seeing as this test was done on May 08 2017 - topics talking about recent past events are common.


In general though, this does seem like a good idea, and there’s now support in place with Topic Timers.

2 Likes

That was very likely a typo in my part.

1 Like