Hi. This is not so much an issue as a question.
I'm planning to use your excellent calendar in an app, but I have a requirement that the weeknumber (1-52) should be to the left of each week. It's a pretty common concept where I live, lots of people seem to live their life according to weeknumber.
Is this something you think should be included in the calendar, or is it better suited to be done in the same way as headers today, ie completely separate. If it fits inside the calendar, I'm happy to actually implement this, perhaps with some guidance from you regarding the optimal approach.
Best Regards,
脰rjan
Can you show me a screen shot of what you want? It hard to visualize what you want.
You can just drag and drop the image in your chat box on here.
Btw, you can do headers both outside the calendar, or inside the calendar.
Here's an example of what I'm trying to to. Disregard that the month doesn't start with the 1st, it's something I will look at later.
I do realize that I could have the weekdays and month name as a separate header inside or outside the calendar, and I could definitly have the week-number column as a separate view outside the calendar as well.
I guess my question is if this is something that you see as fitting within the calendar-functionality (JTAppleCalendar.showWeekNumbers or something), or if it's best left to outside views.

Hmm.. interesting. I never saw calendars like those before. Putting an 8th column would cause for a major change as pretty much every calculation in the calendarLayout right now works with a 7 column calendar in mind.
Man..... that's a damn lot of math to re-code haha 馃槵 . For now I would say that I think this should be on the outside. Let me see how many people need this feature.
The thing about it what makes me hesitant to put this as a feature is, I do not want to assume that the user wants to put this on the left side only. Or have it like how you designed. I will have to think of a flexible way to satisfy most people's needs.
My plan would have been to use the normal cells, and just add a property to the CellState so you can see if you're supposed to provide a "normal" cell or a "weekno" cell, and let the user of the lib style them there.
But as you say, the math to support both seven and eight columns, making sure the right type is set on each willDisplayCell and so on is pretty daunting.
How about this, though;
Extend the "inside header" functionality with more layout help. For example, a new header-registration method, that if used uses an internal collectionview in the same way as the normal calendar (using the same size/inset/etc values). That registration method would take a view that implements a new protocol, which will call willDisplayHeaderForRow and willDisplayHeaderForColumn that lets the delegate style those cells in the same way as the normal calendar. That could also be used to make the current "weekday" headers many calendears use easier to align with the actual calendar.
Also, the registration could take an optional parameter to indicate which side the header should be placed on (top, bottom, left, right).
Doing that new header is possible. But like i said, the math...
Lets assume this new header is on the left hand side.
So is all this possible? Of course yes :)
But that is not something that I will be able to implement right now. It will take some time.
Well, you wouldn't have to implement it. :)
I'm definitely going to need something similar to the layout I posted, it's a requirement for my project. Time-wise, it's not something that I can wait for another project/person to implement, so whatever solution I use will be implemented by me.
Since you have the best knowledge of the calendar, I was just bouncing some ideas off of you hoping to get more information before I make my decision. Do you have any idea about how much work it would be to do something like what I suggested? Are we talking a day or two, a week or two, or even more? Also, do you think it's a good idea, and would be interested in a pull request if I actually go ahead and do this?
Ok after looking into this some more. I think its possible. I'm currently thinking of a way to best implement it. So i have added the enhancement label on this. However, I am not sure if i;ll finish it in time for your project.
will track this in projects.
+1
i have the similar requirements as ttorjan.
did not see how i could subscribe to a project to get notified and show interest. thats why i add a voice for this feature here =)
keep up the good work! this is a really nice framework
Yea. week numbers is something I was considering after @ttorjan mentioned it. It will require a pretty significant change, at the calculations deals with a 7 column calendar. I do have it in mind to do,
but first I have these working on:
start and end ranging more that 100 years. -- This change is just as huge as the Week numbers.I'll get to the week numbers soon, its just that i recently got tied up on another major project. So i'll be working on the smaller issues/bugs first till im free again.
Hi !
Is there any news about calendar and week numbers ? I'm currently designing one calendar that need such feature and for now I don't really know how to achieve this...
not many people asked for the feature... so i sorta slacked off on it.
I can take a look at it again
Actually even the Apple Calendar App is displaying week numbers in Germany. Week numbers would be awesome.
REALLY NEED THIS FEATURE!
@ttorjan since it's been over a year, I am wondering if you solved it already? If so, how did you do it? Thanks!
Even though week numbers does not come with this library, implementing one is easy.
I am creating an example of how it can be done now.
Example added on patchthecode.com.
Closing this issue.
Most helpful comment
Actually even the Apple Calendar App is displaying week numbers in Germany. Week numbers would be awesome.