Calendar
-
@pitaj said:
Is there something like this?
Yep,
action:user.set
https://github.com/NodeBB/NodeBB/wiki/Plugin-Hooks#actionusersetobject
You couldif ('birthday' === data.field) Meow();
BTW, what do you use to display localized date strings?
File not found 路 NodeBB/NodeBB
Node.js based forum software built for the modern web - File not found 路 NodeBB/NodeBB
GitHub (github.com)
-
@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 viaajaxify.go()
)Because behind of every click on a link, there sits
ajaxify.go()
that, after each page loading, castsapp.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