Skip to content

Commit d688127

Browse files
committed
Merge branch 'master' of github.com:wix/react-native-calendars into release
2 parents e9d91b2 + 73aea17 commit d688127

36 files changed

+1319
-662
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
import {TimelineEventProps, CalendarUtils} from 'react-native-calendars';
2+
3+
const EVENT_COLOR = '#e6add8';
4+
const today = new Date();
5+
export const getDate = (offset = 0) => CalendarUtils.getCalendarDateString(new Date().setDate(today.getDate() + offset));
6+
7+
export const timelineEvents: TimelineEventProps[] = [
8+
{
9+
start: `${getDate(-1)} 09:20:00`,
10+
end: `${getDate(-1)} 12:00:00`,
11+
title: 'Merge Request to React Native Calendars',
12+
summary: 'Merge Timeline Calendar to React Native Calendars'
13+
},
14+
{
15+
start: `${getDate()} 01:15:00`,
16+
end: `${getDate()} 02:30:00`,
17+
title: 'Meeting A',
18+
summary: 'Summary for meeting A',
19+
color: EVENT_COLOR
20+
},
21+
{
22+
start: `${getDate()} 01:30:00`,
23+
end: `${getDate()} 02:30:00`,
24+
title: 'Meeting B',
25+
summary: 'Summary for meeting B',
26+
color: EVENT_COLOR
27+
},
28+
{
29+
start: `${getDate()} 01:45:00`,
30+
end: `${getDate()} 02:45:00`,
31+
title: 'Meeting C',
32+
summary: 'Summary for meeting C',
33+
color: EVENT_COLOR
34+
},
35+
{
36+
start: `${getDate()} 02:40:00`,
37+
end: `${getDate()} 03:10:00`,
38+
title: 'Meeting D',
39+
summary: 'Summary for meeting D',
40+
color: EVENT_COLOR
41+
},
42+
{
43+
start: `${getDate()} 02:50:00`,
44+
end: `${getDate()} 03:20:00`,
45+
title: 'Meeting E',
46+
summary: 'Summary for meeting E',
47+
color: EVENT_COLOR
48+
},
49+
{
50+
start: `${getDate()} 04:30:00`,
51+
end: `${getDate()} 05:30:00`,
52+
title: 'Meeting F',
53+
summary: 'Summary for meeting F',
54+
color: EVENT_COLOR
55+
},
56+
{
57+
start: `${getDate(1)} 00:30:00`,
58+
end: `${getDate(1)} 01:30:00`,
59+
title: 'Visit Grand Mother',
60+
summary: 'Visit Grand Mother and bring some fruits.',
61+
color: 'lightblue'
62+
},
63+
{
64+
start: `${getDate(1)} 02:30:00`,
65+
end: `${getDate(1)} 03:20:00`,
66+
title: 'Meeting with Prof. Behjet Zuhaira',
67+
summary: 'Meeting with Prof. Behjet at 130 in her office.',
68+
color: EVENT_COLOR
69+
},
70+
{
71+
start: `${getDate(1)} 04:10:00`,
72+
end: `${getDate(1)} 04:40:00`,
73+
title: 'Tea Time with Dr. Hasan',
74+
summary: 'Tea Time with Dr. Hasan, Talk about Project'
75+
},
76+
{
77+
start: `${getDate(1)} 01:05:00`,
78+
end: `${getDate(1)} 01:35:00`,
79+
title: 'Dr. Mariana Joseph',
80+
summary: '3412 Piedmont Rd NE, GA 3032'
81+
},
82+
{
83+
start: `${getDate(1)} 14:30:00`,
84+
end: `${getDate(1)} 16:30:00`,
85+
title: 'Meeting Some Friends in ARMED',
86+
summary: 'Arsalan, Hasnaat, Talha, Waleed, Bilal',
87+
color: 'pink'
88+
},
89+
{
90+
start: `${getDate(2)} 01:40:00`,
91+
end: `${getDate(2)} 02:25:00`,
92+
title: 'Meet Sir Khurram Iqbal',
93+
summary: 'Computer Science Dept. Comsats Islamabad',
94+
color: 'orange'
95+
},
96+
{
97+
start: `${getDate(2)} 04:10:00`,
98+
end: `${getDate(2)} 04:40:00`,
99+
title: 'Tea Time with Colleagues',
100+
summary: 'WeRplay'
101+
},
102+
{
103+
start: `${getDate(2)} 00:45:00`,
104+
end: `${getDate(2)} 01:45:00`,
105+
title: 'Lets Play Apex Legends',
106+
summary: 'with Boys at Work'
107+
},
108+
{
109+
start: `${getDate(2)} 11:30:00`,
110+
end: `${getDate(2)} 12:30:00`,
111+
title: 'Dr. Mariana Joseph',
112+
summary: '3412 Piedmont Rd NE, GA 3032'
113+
},
114+
{
115+
start: `${getDate(4)} 12:10:00`,
116+
end: `${getDate(4)} 13:45:00`,
117+
title: 'Merge Request to React Native Calendars',
118+
summary: 'Merge Timeline Calendar to React Native Calendars'
119+
}
120+
];

example/src/screens/agendaScreen.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export default class AgendaScreen extends Component<State> {
1212
items: undefined
1313
};
1414

15+
// reservationsKeyExtractor = (item, index) => {
16+
// return `${item?.reservation?.day}${index}`;
17+
// };
18+
1519
render() {
1620
return (
1721
<Agenda
@@ -38,6 +42,7 @@ export default class AgendaScreen extends Component<State> {
3842
//renderDay={(day, item) => (<Text>{day ? day.day: 'item'}</Text>)}
3943
// hideExtraDays={false}
4044
// showOnlySelectedDayItems
45+
// reservationsKeyExtractor={this.reservationsKeyExtractor}
4146
/>
4247
);
4348
}

example/src/screens/calendarListScreen.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import testIDs from '../testIDs';
55

66
const RANGE = 24;
77
const initialDate = '2022-07-05';
8+
const nextWeekDate = '2022-07-14';
9+
const nextMonthDate = '2022-08-05';
810

911
interface Props {
1012
horizontalView?: boolean;
@@ -21,8 +23,15 @@ const CalendarListScreen = (props: Props) => {
2123
selectedColor: '#5E60CE',
2224
selectedTextColor: 'white'
2325
},
24-
['2022-08-05']: {
25-
selectedTextColor: 'pink'
26+
[nextWeekDate]: {
27+
selected: selected === nextWeekDate,
28+
selectedTextColor: '#5E60CE',
29+
marked: true
30+
},
31+
[nextMonthDate]: {
32+
selected: selected === nextMonthDate,
33+
selectedTextColor: '#5E60CE',
34+
marked: true
2635
}
2736
};
2837
}, [selected]);
@@ -40,6 +49,7 @@ const CalendarListScreen = (props: Props) => {
4049
onDayPress={onDayPress}
4150
markedDates={marked}
4251
renderHeader={!horizontalView ? renderCustomHeader : undefined}
52+
calendarHeight={!horizontalView ? 390 : undefined}
4353
theme={!horizontalView ? theme : undefined}
4454
horizontal={horizontalView}
4555
pagingEnabled={horizontalView}

0 commit comments

Comments
 (0)