Inserting Date/Time in "About Me"

When inserting a date/time in the About Me section it gets formatted as datetime, not the expected date and time format.

Inserting Date/Time

Screen Shot 2020-01-01 at 9.42.39 PM

Public Profile

Screen Shot 2020-01-01 at 9.43.51 PM

Discourse Information:

4 Likes

I don’t think this kind of date formatting is supported in About Me.

7 Likes

Yeah I don’t think we run the full post decoration in the about me section (nor should we), that said I think it would not be too much of a stretch to add support for the date picker there especially since we show it in the toolbar.

@joffreyjaffeux thoughts?

9 Likes

So I can make it work quite easily:

But it has a price that I don’t think we are willing to pay:

  • currently in bio we render “bio_excerpt” and not just “bio_cooked”, which could mean the date might be truncated and also that we are removing HTML:
[1] pry(main)> PrettyText.excerpt("<b>Foo</b>", 5)
=> "Foo"
  • Also we are rendering this as text and using {{text-overflow}} component

So to make it work without going crazy and building some kind of postCooked hook this is not possible without changing:

<div class='bio'>{{text-overflow class="overflow" text=user.bio_excerpt}}</div>

to

<div class='bio'>{{{user.bio_cooked}}}</div>

Which I don’t think we want to do for such a specific edge case, it basically means we are rendering HTML from a user input. Your call, let me know if you want to dig this more or explore other solutions.

Might be safer to just remove toolbar button from about composer ?

10 Likes

Yes remove that button please.

8 Likes

Done in:

https://github.com/discourse/discourse/commit/e303b4d1818422863ac8cc17b34dd65186f50989

5 Likes