28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8
I need this for a calendar component I'm making I need to get to the bottom line every 7 days.
28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8
I need this for a calendar component I'm making I need to get to the bottom line every 7 days.
Hi there why are you creating a view for calendar? Why not install a package like DateTimePickerModal? Already got all the Date functionality/Calendar included
Check out here: https://www.npmjs.com/package/react-native-modal-datetime-picker
I implemented this in React Native, idea is the same.
const days = [ 28,29,30,31,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,1,2,3,4,5,6,7,8];
return (
<View
style={{ flexDirection: "row", flexWrap: "wrap", marginVertical: 10 }}
>
{days.map((day) => (
<View
key={day}
style={{
width: `${100 / 7}%`,
height: 20,
justifyContent: "center",
alignItems: "center"
}}
>
<Text >{day}</Text>
</View>
))}
</View>
)