YACalendar icon indicating copy to clipboard operation
YACalendar copied to clipboard

How to move down daysStackView under Month title

Open asadqazi opened this issue 4 years ago • 15 comments

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

asadqazi avatar Feb 28 '20 05:02 asadqazi

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

Vodolazkyi avatar Feb 28 '20 08:02 Vodolazkyi

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

asadqazi avatar Feb 28 '20 10:02 asadqazi

@asadqazi update pod to 0.0.2 version

Vodolazkyi avatar Feb 28 '20 11:02 Vodolazkyi

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 avatar Feb 28 '20 11:02 asadqazi

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

asadqazi avatar Feb 28 '20 13:02 asadqazi

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

Vodolazkyi avatar Feb 28 '20 15:02 Vodolazkyi

@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?

Vodolazkyi avatar Feb 28 '20 15:02 Vodolazkyi

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

asadqazi avatar Feb 28 '20 19:02 asadqazi

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 avatar Mar 01 '20 08:03 asadqazi

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

asadqazi avatar Mar 01 '20 16:03 asadqazi

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

asadqazi avatar Mar 01 '20 16:03 asadqazi

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

Vodolazkyi avatar Mar 02 '20 09:03 Vodolazkyi

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.

asadqazi avatar Mar 02 '20 10:03 asadqazi

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

Vodolazkyi avatar Mar 02 '20 10:03 Vodolazkyi

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.

asadqazi avatar Mar 02 '20 10:03 asadqazi