Calendar
-
-
@ajay Ummmm ... I'm stuck on this one issue, but I'll push out the compatibility and a couple other bug fixes in the next 24 hours.
-
@ajay Actually, I'm not going to make that date, but you can add the following code to
library.js
to add 0.6.x compatibility:module.init = function (app, middleware, controllers, callback) { // after this line (103) // add this code if(app.router){ callback = middleware; middleware = app.middleware; app = app.router; } // end added code app.get('/calendar', middleware.buildHeader, renderPage); // and before this line (105)
That should bring it up to compatibility for now.
-
@ajay The top and bottom lines in the example code are already in the code, don't copy them. Just copy the lines between
// add this code
and// end added code
between 103 and 105. -
@pitaj
I am getting this errorTypeError: 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
-
@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):
- Clean up code
- Refactor database
- Use post parser
- 0.6.x compatibility
- Translatability
- Categories
- Permissions
- General front end bug fixes and improvements (Bootstrap-ifying everything, fixing mobile scrolling bug, etc)
- 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
-
I've decided to postpone work on my forms plugin until I finish this plugin.
-
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...
-
@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?
-
@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?
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 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()