Hello, is it possible to integrate this into NodeBB? Or is there a plugin for something like this?
https://github.com/markdown-it/markdown-it-container
54a0961a-6615-46ef-a6a3-a24b95dff19a-grafik.png
@pitaj said:
Is there something like this?
Yep, action:user.set
https://github.com/NodeBB/NodeBB/wiki/Plugin-Hooks#actionusersetobject
You could
if ('birthday' === data.field) Meow();
BTW, what do you use to display localized date strings?
https://github.com/NodeBB/NodeBB/blob/private-groups/public/src/translator.js#L88
@Mega is the translator used? I thought moment.js was used for it. I could be wrong.
@pitaj said:
@Mega is the translator used?
Yup, a little bit https://github.com/NodeBB/NodeBB/blob/master/public/src/translator.js#L73
@pitaj said:
to display localized date strings
Sorry, I've noticed it just now >.<
Okay, AFAIK, you always, on any page, can do
$('span.timeago').timeago()
And all spans will be translated in appropriate language, BUT
I guess, you actually don't even have to do this! (unless you won't load some content dynamically, not via ajaxify.go()
)
Because behind of every click on a link, there sits ajaxify.go()
that, after each page loading, casts app.processPage()
that already includes $('span.timeago').timeago()
@Mega but I don't want time ago, I want to display something like
January 1, 2016 11:00am
@pitaj said:
I want to display something like
OMG! I finally got it!
Okay, in NodeBB I've never seen that kind of strings
But you could just use moment, you know, it's fairly straightforward in use.
As I know there is only one thing you need take care over and above moment's documentation - transform locales' name format from NodeBB-like to moment-like
Just like @julian made it here https://github.com/NodeBB/NodeBB/blob/master/public/src/translator.js#L42-L71