Git Product home page Git Product logo

Comments (9)

craigcoles avatar craigcoles commented on May 8, 2024 12

I would have to agree with @daviddarnes, and say that it should be render each day as empty by default. If you don't pass any items to the component, and you click on a date from the calendar view, you are presented with a loading icon. Going by what has been said previously, we would have to generate all the days as empty arrays just to hide the loading icon.

from react-native-calendars.

daviddarnes avatar daviddarnes commented on May 8, 2024 5

@tautvilas hey, I just tried it now. The example uses a method to randomly generate events, but it also generates every 'day'. So in the example some days are rendered as empty objects. I would've thought you wouldn't need to render every day, and you can just populate the calendar with events?

I hope that makes sense?

from react-native-calendars.

venix avatar venix commented on May 8, 2024 2

I probably have to update readme about this. Set empty dates with empty array. Not sure if setting null will not introduce bugs

Hi there, sorry for the intrusion on this post, but ran into the same issue and I was wondering how are you supposed to fill the dates with empty array. In my case I don't have a set of all days within a year but just the events I want to load, do I have to go through all dates of the year to generate the empty [] for each day??

That seems to be a bit of an overkill, doesn't it?

Also in my case, everything renders correctly with "Empty events" message but when you try to scroll down to move on to the next day, it stops and gets stuck on the last day that had an event.

So you are saying if I fill the dates in the items dictionary will resolve this issue?

from react-native-calendars.

tautvilas avatar tautvilas commented on May 8, 2024

Hi, can you try running example app and see how your implementation differs from the example (because in example emptyDates render OK). Thx

from react-native-calendars.

tautvilas avatar tautvilas commented on May 8, 2024

Hi, yes it makes sense. Current convention is that if day does not have any value it means that it is not loaded. So in order for agenda to work properly implement loadItemsForMonth method and populate empty dates with empty arrays []. However the crash should not happen even if day is not loaded so I will try to fix the red screen.

from react-native-calendars.

daviddarnes avatar daviddarnes commented on May 8, 2024

Thanks for replying. Seems fine as a solution, but I wouldn't have thought I'd have to populate a day with an empty object? If the day is null then it should return with no items to display yes?

from react-native-calendars.

tautvilas avatar tautvilas commented on May 8, 2024

I probably have to update readme about this. Set empty dates with empty array. Not sure if setting null will not introduce bugs

from react-native-calendars.

daviddarnes avatar daviddarnes commented on May 8, 2024

Fair enough 😄 . Documented method of populating days would be appreciated!

from react-native-calendars.

TonyKelly12 avatar TonyKelly12 commented on May 8, 2024

Hi I know this issue is closed but I also ran into this problem but turns out I had two separate problems I needed to address

  • add a empty array to each day with no items as discussed above

  • Make sure my dates that I was storing the items array under, was in this format of: "mm/dd/yyyy"**

If Day or month come back as single digits and year as double like "9/29/19" it will not render must have leading zeros for month and day and full year.

Hope this helps anybody running into the same issue

from react-native-calendars.

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.