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

Start day of week #20

Closed
djxmax opened this issue May 18, 2016 · 6 comments
Closed

Start day of week #20

djxmax opened this issue May 18, 2016 · 6 comments

Comments

@djxmax
Copy link

djxmax commented May 18, 2016

Hi, first, thanks for you library. It saves me lot of hours.

For my app, I try to put monday as the first day of week. I use :
self.calendarView.firstDayOfWeek = DaysOfWeek.Monday

But nothing append. Sunday stay the first day of week, even after a reloadData()
But it work with the demo app...
I use the last version of calendar (2.1.2)

But maybe there is a thing that I misunderstand ?

Thanks !

@patchthecode
Copy link
Owner

Using
self.calendarView.firstDayOfWeek = .Monday should work.

Can you tell me this:

  1. is it Vertical or horizontal scrolling?
  2. Is paging enabled?
  3. Is number of rows per week = 6? or something else

You need to give me enough information so that i can re-create your scenario

@djxmax
Copy link
Author

djxmax commented May 18, 2016

I finally found a solution:
I add calendarView.numberOfRowsPerMonth = 6 and now it works.
So maybe there is a problem with the default value.

Thanks for your help ;)

@patchthecode
Copy link
Owner

patchthecode commented May 18, 2016

Thank you. I will look into this.
The default date should work out of the box. Testing this now.
Or can you paste your calendar setup code that you have in your viewDidLoad() function?

@patchthecode
Copy link
Owner

Never mind. I have recreated the issue. Thanks for letting me know of this. Will fix the default value.

@patchthecode
Copy link
Owner

When you change the first day of week, you are supposed to do a calendarView.reloadData()
But this was failing because I left out one line of code that marked the calendarView as layoutNeedsUpdating = true

Its a one line code fix. Will push this fix to the next version coming this weekend. In the mean time, continue using your method.

@djxmax
Copy link
Author

djxmax commented May 18, 2016

OK, thanks for your help !

@patchthecode patchthecode self-assigned this May 18, 2016
@patchthecode patchthecode added this to the Bugs 2.0 milestone May 18, 2016
patchthecode added a commit that referenced this issue May 18, 2016
#20

When a user changes the start of day for the month, reloading the calendar should update the calendar. This failed to happen because

layoutNeedsUpdating = true

code was ommitted. Fixed issue here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants