• @pitaj
    I am getting this error

    TypeError: Object #<Object> has no method 'parse'
    at Object.async.parallel.content (/home/ubuntu/nodebb/node_modules/nodebb-plugin-calendar/library.js:630:23)
    at /home/ubuntu/nodebb/node_modules/async/lib/async.js:583:25
    at /home/ubuntu/nodebb/node_modules/async/lib/async.js:125:13
    at Array.forEach (native)
    at _each (/home/ubuntu/nodebb/node_modules/async/lib/async.js:46:24)
    at Object.async.each (/home/ubuntu/nodebb/node_modules/async/lib/async.js:124:9)
    at _parallel (/home/ubuntu/nodebb/node_modules/async/lib/async.js:582:20)
    at Object.async.parallel (/home/ubuntu/nodebb/node_modules/async/lib/async.js:598:9)
    at /home/ubuntu/nodebb/node_modules/nodebb-plugin-calendar/library.js:576:15
    at Object.Plugins.fireHook (/home/ubuntu/nodebb/src/plugins.js:394:11)

    link is: http://www.qpinion.com/category/1/announcements

    I created 1 event which is showing in category. but when I went back to calendar, it was not showing in calendar.
    Then I created some events, but not saved in calendar (non public)

    error: TypeError: Object #<Namespace> has no method 'socket'
    at /home/ubuntu/nodebb/node_modules/nodebb-plugin-calendar/library.js:315:39
    at /home/ubuntu/nodebb/node_modules/nodebb-plugin-calendar/library.js:778:9
    at /home/ubuntu/nodebb/node_modules/nodebb-plugin-calendar/library.js:1016:11
    at /home/ubuntu/nodebb/node_modules/nodebb-plugin-calendar/library.js:94:7
    at try_callback (/home/ubuntu/nodebb/node_modules/redis/index.js:573:9)
    at RedisClient.return_reply (/home/ubuntu/nodebb/node_modules/redis/index.js:661:13)
    at ReplyParser.<anonymous> (/home/ubuntu/nodebb/node_modules/redis/index.js:309:14)
    at ReplyParser.EventEmitter.emit (events.js:95:17)
    at ReplyParser.send_reply (/home/ubuntu/nodebb/node_modules/redis/lib/parser/javascript.js:300:10)
    at ReplyParser.execute (/home/ubuntu/nodebb/node_modules/redis/lib/parser/javascript.js:203:22)
    [cluster] Child Process (19004) has exited (code: 1, signal: null)
    [cluster] Spinning up another process...

    It is rebooting my nodebb every time I add an event.

    for every event (public) it is creating 2 posts in category

  • Global Moderator Plugin & Theme Dev

    @ajay Okay, so it looks like that code alone won't add compatibility with 0.6.x, and I will need time to work on that, as I'm busy in school as well.

    I have a few things that I plan on changing (in this order):

    1. Clean up code
    2. Refactor database
    3. Use post parser
    4. 0.6.x compatibility
    5. Translatability
    6. Categories
    7. Permissions
    8. General front end bug fixes and improvements (Bootstrap-ifying everything, fixing mobile scrolling bug, etc)
    9. External node.js API (so other plugins can add events at will)

    As you can see, my plate is pretty full. Plus, the code was written too fast and was my second plugin ever, so maintenance is difficult.

    The next version of this plugin will only support 0.6.x

    As always, if you have any suggestions for features and/or want to contribute to the development of this plugin, contact me either through this forum or on Github

  • Global Moderator Plugin & Theme Dev

    I've decided to postpone work on my forms plugin until I finish this plugin.

  • GNU/Linux Admin

    Hey @pitaj, can you auto-add events to this plugin based on db data? For example, if you set a birthday in your profile, it'll add it to the calendar? 😄

    Ideally, the calendar would query for birthdays on a per-day basis, but then again, that might not work so well since we don't store birthdays in any sort of set...

  • Global Moderator Plugin & Theme Dev

    @julian I could just listen for a hook when the use modifies his or her information. Is there something like this? action:user.edit or something? It should fire both when a new user is made and when a user modifies his own personal information.

    BTW, what do you use to display localized date strings?

  • Community Rep

    @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

  • Global Moderator Plugin & Theme Dev

    @Mega is the translator used? I thought moment.js was used for it. I could be wrong.

  • Community Rep

  • Community Rep

    @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()

  • Global Moderator Plugin & Theme Dev

    @Mega but I don't want time ago, I want to display something like

    January 1, 2016 11:00am

  • Community Rep

    @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


Suggested Topics

| |