GithubHelp home page GithubHelp logo

Comments (10)

franleplant avatar franleplant commented on August 23, 2024 1

Thank you very much for your help and support!

from react-native-calendar-events.

wmcmahan avatar wmcmahan commented on August 23, 2024

Hey @franleplant, I believe that this is expected for Android when reading from the CalendarContract.Event table. I think that reading from the CalendarContract.Instances would successfully find all instances from the query. The current response should return a recurrent rule that could be used to infer future dates without a pulling every instance though.

from react-native-calendar-events.

franleplant avatar franleplant commented on August 23, 2024

So right now I am not receiving those events from fetchAll, what is your suggestion to fix this then?

from react-native-calendar-events.

wmcmahan avatar wmcmahan commented on August 23, 2024

Just to clarify, the results are all non recurring events, i.e. nothing assigned to the recurrence key such as 'daily', 'weekly', etc?

from react-native-calendar-events.

franleplant avatar franleplant commented on August 23, 2024

Exactly, the recurrence key is always the empty string and the events are all non-recurrent. Other way of putting it is that fetchAll is not returning instances of recurrent events.

from react-native-calendar-events.

wmcmahan avatar wmcmahan commented on August 23, 2024

Hey @franleplant, I'm not able to reproduce this. Can you show how you are creating a recurring event and how you are fetching these events? Edit: Actually, I think I was able to reproduce by manually adding a recurring event to the calendar.

from react-native-calendar-events.

franleplant avatar franleplant commented on August 23, 2024

Hi! This is all the data I could gather:

This is a recurring event that happens every Wednesday (I've omitted some details for privacy reasons)

screenshot_20170213-130525 1

screenshot_20170213-130952

This is the code that fetches all the events for today,
tomorrow and the day past tomorrow and store them
in an array.

  const events = await Promise.all([0, 1, 2]
  // Calc the start and end of (today, tomorrow or the day after tomorrow) in the user's timezone
    .map((i) => [moment().startOf('day').add(i, "day"), moment().endOf('day').add(i, "day")])
    // Get events
    .map(([start, end]) => RNCalendarEvents.fetchAllEvents(start.toISOString(), end.toISOString())))

This is what I get from that call
screen shot 2017-02-13 at 1 59 09 pm

The event that you see on Wednesday is other, non recurring event, that in fact comes from another calendar that I'm subscribed too, so that's working fine. The only problem is for recurring events.

I hope this helps.

A simple way of reproducing this error is by:

  • create a non recurring event A today
  • create a recurring event B today (potentially start it yesterday so you get a future recurring event)
  • run fetchAll for today
  • Only A will be present in the events Array.

Expected: A and B are returned
Actual: A is returned

from react-native-calendar-events.

wmcmahan avatar wmcmahan commented on August 23, 2024

Thanks @franleplant, I believe I see what the problem is. Recurring events (without an end date) cannot be found by the queries start and end date bounds. I should have a solution out for this later today. Thanks for reporting it!

from react-native-calendar-events.

wmcmahan avatar wmcmahan commented on August 23, 2024

Ok, i've pushed out a patch (1.3.5) for this. Hopefully this should now pull recurring events properly. Let me know if you run into any bugs. Cheers!

from react-native-calendar-events.

wmcmahan avatar wmcmahan commented on August 23, 2024

Glad I could help. 👍

from react-native-calendar-events.

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.