Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendario + day display #43

Open
kusumj opened this issue Aug 24, 2015 · 8 comments
Open

Calendario + day display #43

kusumj opened this issue Aug 24, 2015 · 8 comments

Comments

@kusumj
Copy link

kusumj commented Aug 24, 2015

Hello,

I need to display the day and event as below :
'24-08-2015' : 'Event 1',
'24-08-2015' : 'Event 2',

can someone please help me on the above.

Thanks

@deviprsd
Copy link
Contributor

deviprsd commented Sep 1, 2015

Display where?

@kusj
Copy link

kusj commented Sep 2, 2015

Hello ,

I need to render the code as follows :

var codropsEvents = {
'07-08-2015' : 'Event 1t',
'07-08-2015' : 'Event 2t',
};

The date is dynamic and I am unable to group the event under similar date.
That is why i need to render the code as above. But it is talking only the last one that is event 2.

Thanks for your help.

@deviprsd
Copy link
Contributor

deviprsd commented Sep 2, 2015

Yea you can do that, but it would be good if you first use the v4 of calendario available here, https://github.com/deviprsd21/Calendario. Then, you can see how this one is written, https://github.com/deviprsd21/Calendario/blob/master/js/dataTimeline.js

@kusj
Copy link

kusj commented Sep 3, 2015

Hello ,

As advised I have used v4 of calendario. But my issue is still the same.

I want to be able to render the date and content as below :

'09-03-2015' : [{content : 'Graduation Exams', allDay: true}],
'09-03-2015' : [{content : 'asasas', allDay: true}]

Is it possible with calendario ?

Thanks in advance,

@deviprsd
Copy link
Contributor

deviprsd commented Sep 3, 2015

Yes it is, you just didn't read the code carefully, never mind. Write it like this

'09-03-2015' : [{content : 'Graduation Exams', allDay: true}, {content : 'asasas', allDay: true}]

You see the [ ] are arrays which contain the event objects and { } are objects which have the event details, so to add more just [{ }, { }, { }, so on]. For anymore problems contact in this repo https://github.com/deviprsd21/Calendario.

@shelbyKiraM
Copy link

shelbyKiraM commented May 9, 2016

Why can we not add two day events separately like his first post and have it draw both?
Difficult to build like that in Ruby... 😕

@deviprsd
Copy link
Contributor

@Blacrose Because this is in a JavaScript Object format, if you try to do like the first post, the second line will override the first one. Think of it as an array, and the date is the index key, so the same key will replace it. I hope I'm clear enough?

@deviprsd
Copy link
Contributor

Also why don't you try building hash objects similar to this in ruby, and then converting them to json, it will as it should work. The [ ] are arrays, and { } objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants