[Backbone.js] Structuring a calendar application


I’m trying to make a calendar application using backbone.js. I have some difficulties in rendering the calendar. I can’t decide whether to have one month model which will keep all the data or to have a day model and a collection of day models. Which is the best way to structure my code? Can you give me some advice?


Welcome to Sitepoint :slight_smile:
Start with only things you want to persist, maybe you don’t need months or days, only the events that you put on a calendar.
Javascript Date objects have all they need to create a calendar / year / month / days / etc… Have a look at one of the good datepicker javascript widgets for example.

I find it easier starting with the views. My only advice would be to try to keep as few models/views/routers as possible.