Open
Description
interface AgendaItem {
title: string;
data: {
hour: string;
duration: string;
name: string;
color?: string;
}[];
}
const agendaItems: AgendaItem[] = [
{
title: '2025-03-20',
data: [
{ hour: '09:00', duration: '1h', name: 'Team Meeting' },
{ hour: '14:30', duration: '45m', name: 'Dentist Appointment' },
],
},
{
title: '2025-03-21',
data: [
{ hour: '10:00', duration: '2h', name: 'Project Review' },
{ hour: '15:00', duration: '1h', name: 'Coffee with Client' },
],
},
{
title: '2025-03-22',
data: [{ hour: '11:00', duration: '1h', name: 'Gym Session' }],
},
{
title: '2025-03-25',
data: [
{ hour: '09:30', duration: '1h 30m', name: 'Strategy Planning' },
{ hour: '13:00', duration: '1h', name: 'Lunch with Team' },
{ hour: '16:00', duration: '2h', name: 'Code Review' },
],
},
{
title: '2025-04-25',
data: [
{ hour: '09:30', duration: '1h 30m', name: 'Strategy Planning' },
{ hour: '13:00', duration: '1h', name: 'Lunch with Team' },
{ hour: '16:00', duration: '2h', name: 'Code Review' },
],
},
];
...
<AgendaList
sections={agendaItems}
renderItem={renderItem}
renderSectionHeader={(test) => {
console.log(test); //test is a string here and has 2025-04-25 as content
const localized = new Date(test as string).toLocaleDateString('en-US', {
month: 'long',
day: 'numeric',
year: 'numeric',
});
return (
<View style={{ backgroundColor: 'red', height: 50 }}>
<Text style={{ color: 'white' }}>{localized}</Text>
</View>
);
}}
scrollToNextEvent
dayFormat="yyyy-MM-d"
/>
Metadata
Metadata
Assignees
Labels
No labels