JTAppleCalendar icon indicating copy to clipboard operation
JTAppleCalendar copied to clipboard

Calling scrollToDate multiple times causes it to stop working indefinitely

Open MohamedElgharbawy opened this issue 6 years ago • 3 comments

(Required) Version Number: 8.0.0

Description:

I have a UIBarButtonItem. When it is tapped, the following code is executed:

    @objc func scrollToToday() {
        let formatter = DateFormatter()
        formatter.dateFormat = "yyyy MM dd"
        let calendar = Calendar.current
        let components = calendar.dateComponents([.year, .month, .day], from: Date())
        let today = formatter.date(from: String(components.year!) + " " + String(components.month!) + " " + String(components.day!))!
        monthView.scrollToDate(today) 
    }

However, if I click the button multiple times in a row, the code no longer executes. Is there a specific reason for this, or is this an iOS issue?

Steps To Reproduce

Press the UIBarButtonItem multiple times in succession.

MohamedElgharbawy avatar Aug 08 '19 22:08 MohamedElgharbawy

You'll have to send me a sample app with the issue. Because i am not able to reproduce this.

patchthecode avatar Aug 08 '19 23:08 patchthecode

Me too.

I created a button to go to this month using scrollToDate. This month should appear when I press this button. It works perfectly for a few clicks but suddenly it doesn't work for some reason. And didScrollToDateSegmentWith also doesn't work when the scrollToDate doesn't work. But didSelectDate works.

Please let me know if I made a mistake. Thanks Check Demo

Haeuncs avatar Nov 09 '19 15:11 Haeuncs

Same problem

bystritskiy avatar Dec 01 '22 17:12 bystritskiy