Comments (9)
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.
@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.
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.
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.
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.
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.
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.
Fair enough 😄 . Documented method of populating days would be appreciated!
from react-native-calendars.
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)
- Make AgendaList scroll to today by default HOT 3
- There is a way to handle with week change in <weekCalendar /> HOT 1
- Types are wrong with AgendaSchedule hardcoded
- Webpack loader errors in solito nextjs app HOT 1
- React Native Calendars height is fixed by default
- React Native Calendars height is fixed by default cannot be changed why?Is there any way to decrease the height of calendar? HOT 1
- Add StandWithPalentine banner
- How will manually pick a date to start from ? HOT 1
- setNativeProps is not a function when pressing the knob of Agenda (tested with chrome)
- Asking a question regarding day header styling HOT 1
- ExpandableCalendar
- Performance : limit rerender of calendar
- March 31 missing in Calendar
- Expandable calendar height issue: Last week of month is not shown with customized design HOT 4
- Invariant Violation: requireNativeComponent: "RNSVGSvgView" was not found in the UIManager got this issue every time when trying to install react-native-calender
- Create Event similar to IOS calendars with Timeline compoenent, on LongPress where backgorundColor changes and reflects selectedTime of 1h?
- Facing date selection change issue on Expandable calendar week change
- im facing issue while long pressing on timeline im getting a day befores date,as an event
- Expandable calendar always shows the first day auto selected HOT 8
- How to get Data inside AgendaList
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-calendars.