GithubHelp home page GithubHelp logo

Comments (3)

Aaqibali279 avatar Aaqibali279 commented on June 21, 2024

I am getting same issue in production app, below is stack trace
Screenshot 2024-03-29 at 12 27 05 PM

from fscalendar.

Aaqibali279 avatar Aaqibali279 commented on June 21, 2024

@WenchaoD can you please check this issue

from fscalendar.

SergeyKovalenko avatar SergeyKovalenko commented on June 21, 2024

FSCalendar has a working range of dates minimumDate - maximumDate, by defaults it's 1970-01-01 and 2099-12-31
I noticed strange behavior of minimumDate calculation for some time zones (e.g. America/Mazatlan (GMT-7))

NSDate *newMin = [self.dataSourceProxy minimumDateForCalendar:self]?:[self.formatter dateFromString:@"1970-01-01"];
newMin = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:newMin options:0];

here newMin will be 1970-01-01 01:00:00 however for any other date an hour component will be set to 0 hours
(e.g. 1970-01-02 00:00:00)
Because of this, calculations like - (NSIndexPath *)indexPathForDate:(NSDate *)date scope:(FSCalendarScope)scope are broken and leads to crash on iOS 17

There is a way to change minimumDate by implementing dataSource method to avoid such behavior

/**
 * Asks the dataSource the minimum date to display.
 */
- (NSDate *)minimumDateForCalendar:(FSCalendar *)calendar;

from fscalendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.