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

When Custom cell size for Monthview - Months are displayed incorrectly when scrolling #172

Open
sujubala opened this issue Mar 10, 2021 · 10 comments
Labels
bug Something isn't working investigation

Comments

@sujubala
Copy link

When setting the custom size for monthview using CalendarDelegate method , and scrolling the monthview results in displaying wrong months

To Reproduce

  1. Set in our custom controller
  • func sizeForCell(_ date: Date?, type: CalendarType) -> CGSize? {
    return CGSize(width: 90, height: 100)
    }
  • Current month is set as selected date
  1. Run the app and move to Month segment
  2. Current month March 2021 is displayed.
  3. Now scroll down and next month is displayed as June 2021 and scrolling again the month will be October
  4. Scrolling back/Up it displays January 2022 and again upwards April 2022

Scrolling up/Down it displays incorrect month

@sujubala sujubala added the bug Something isn't working label Mar 10, 2021
@kvyatkovskys
Copy link
Owner

Interesting 🤔
What style do you use for monthView?

@sujubala
Copy link
Author

sujubala commented Mar 10, 2021

These are the Style i set for monthView
style.month.weekDayAlignment = .left
style.month.colorBackgroundCurrentDate = //Custom Color
style.month.colorBackgroundWeekendDate = UIColor.white
style.month.colorSelectDate = UIColor.white
style.month.colorBackgroundSelectDate = //Custom Color
style.month.showDatesForOtherMonths = true
style.month.isAutoSelectDateScrolling = true
style.month.heightTitleDate = 40
style.month.isPagingEnabled = true
style.month.isHiddenDotInTitle = true
style.month.selectionMode = .single

    iPhone model:
    Tried with  iPhone 11 Pro , iPhone 11 Pro Max, iphone 7
    getting different months

@sujubala
Copy link
Author

Interesting 🤔
What style do you use for monthView?

@sujubala sujubala reopened this Mar 10, 2021
@sujubala
Copy link
Author

Sorry for the inconvenience... unknowingly I closed the issue ... so reopened it again

@sujubala
Copy link
Author

@kvyatkovskys
Any update which help to solve this issue ?

@kvyatkovskys
Copy link
Owner

Not yet, I'm busy with my work 😉

@kvyatkovskys
Copy link
Owner

Found problem... the width = 90 is too large for phone, you need to use a smaller width or deviceWidth /= 7 -> 7 days or 1 week

@sujubala
Copy link
Author

sujubala commented May 3, 2021

Can we have custom width (This is mainly to show the event name). In lower devices the event name is hardly seen

@kvyatkovskys
Copy link
Owner

You can try this method func sizeForCell(_ date: Date?, type: CalendarType) -> CGSize? from CalendarDelegate

@maulikshah09
Copy link

maulikshah09 commented Jul 5, 2023

I am using this third party.. my app is live but I am facing problem with date.

First lunch it getting right date.. after that I am getting wrong date. check attached video

I Also checked your latest version it is same problem.

RPReplay_Final1688369229.MP4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigation
Projects
None yet
Development

No branches or pull requests

3 participants