JTAppleCalendar icon indicating copy to clipboard operation
JTAppleCalendar copied to clipboard

Scrolling to today for vertical not page mode calendar

Open stonezhl opened this issue 5 years ago • 4 comments

(Required) Version Number: 8.0.3

Description

Thank you for this great job.

Recently I am building a vertical scrolling calendar, not page mode. I want to scroll the calendar to today but failed in the end. I tried a lot of ways, including all the functions which name has "scrollTo" prefix.

I must miss something since this is a common feature, but I just can't find it.

Steps To Reproduce

Same as the description:

  1. Vertical calendar
  2. Scroll to today

Expected Behavior

There is a way to scroll to today. Even a tricky way is acceptable.

Additional Context

stonezhl avatar Mar 02 '20 15:03 stonezhl

Did you put this in your viewDidLoad function?

calendarView.scrollToDate(Date())

patchthecode avatar Mar 02 '20 16:03 patchthecode

3r7fog I tried, but it had a weird contentOffset.

stonezhl avatar Mar 03 '20 01:03 stonezhl

Because Of recent events, I am now getting back to this.

So it looks like it correctly scrolls to March 3rd. But, it also looks like since March is the final month in the calendar, it has a visual bug which pulls the 3rd to the top of the screen.


Can i confirm something? Can you make the last month not be March?

For example, if you want you range to be January to March, then make your date boundary to be January to April. I want to test to see if it correctly scrolls to the right offset if there is an extra month behind the final month.

patchthecode avatar Apr 22 '20 12:04 patchthecode

Thank you for your reply. And sorry for my late reply. I tried if the boundary is not March, then everything is okay. Btw my app has already released. I used scrollToHeader or section something, instead of scrollToDate

stonezhl avatar May 25 '20 04:05 stonezhl