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

How to move down daysStackView under Month title #2

Open
asadqazi opened this issue Feb 28, 2020 · 15 comments
Open

How to move down daysStackView under Month title #2

asadqazi opened this issue Feb 28, 2020 · 15 comments

Comments

@asadqazi
Copy link

How to move down daysStackView under Month title and there should be 2 button to move to next and previous months

@Vodolazkyi
Copy link
Contributor

Hi @asadqazi !
To implement this you need:

  1. Set calendarView.config.month.showTitle = false
  2. Add your custom view with a label for month title and next/previous buttons.

In order to know the current month, you can by implementing CalendarViewDelegate with func didUpdateDisplayedDate(_ date: Date) method

To scroll next/previous month use func scroll(to date: Date) method

@asadqazi
Copy link
Author

asadqazi commented Feb 28, 2020

I disabled the month and days view but it leaves a blank space at top.
How to remove that blank space? And also please tell me how to increase the size of selection circles?

Screenshot 2020-02-28 at 3 53 22 PM

@Vodolazkyi
Copy link
Contributor

@asadqazi update pod to 0.0.2 version

@asadqazi
Copy link
Author

I downloaded the code yesterday.
I am customizing it according to my requirments. But now just stuck at selection size and extra top space

@asadqazi
Copy link
Author

And func scroll(to date: Date) not working when going to previous month on button click

@Vodolazkyi
Copy link
Contributor

@asadqazi I have fixed extra top size today. What do you mean by selection size? I will check scroll(to date: Date)

@Vodolazkyi
Copy link
Contributor

Vodolazkyi commented Feb 28, 2020

@asadqazi I just checked and scroll works fine

calendarView.currentDate = Calendar.current.date(byAdding: .month, value: -1, to: calendarView.currentDate)!
calendarView.scroll(to: calendarView.currentDate)

Maybe you have another case?

@asadqazi
Copy link
Author

The day selection, range color is static.
I think it can ne configurable. Like for day config

@asadqazi
Copy link
Author

asadqazi commented Mar 1, 2020

I tried to inherit the day view class and it gives me error because of a non open class.
Searched SO and found
https://stackoverflow.com/a/38979479/3366100

Screenshot 2020-03-01 at 1 48 58 PM

@asadqazi
Copy link
Author

asadqazi commented Mar 1, 2020

I locally changed the classes to open but another issue that from stroryboard the CalendarView refrence is nil while running the app

@asadqazi
Copy link
Author

asadqazi commented Mar 1, 2020

Please create a project and use your lib as pod, and see if problem occurs on your side.
Because currently you locally added it as framework

@Vodolazkyi
Copy link
Contributor

@asadqazi I have fixed the issues. Please check version 0.0.3

@asadqazi
Copy link
Author

asadqazi commented Mar 2, 2020

There should also be an option so that user cannot select futures dates from today.
I set the endDay to Date() but it creates an issue.

@Vodolazkyi
Copy link
Contributor

@asadqazi Did you try func disableDays(with dates: [Date]) method?

@asadqazi
Copy link
Author

asadqazi commented Mar 2, 2020

Yes but it take an array of dates and I want to disable all the remaining future days from today.
According to this method I will have to get all the future days Date objects and will use them.

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

2 participants