Skip to content

Commit 54bd1a4

Browse files
committed
Make code more readable
1 parent 1ba20d8 commit 54bd1a4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

example/src/screens/timelineCalendar.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,12 @@ export default class TimelineCalendarScreen extends Component {
104104

105105
createNewEvent: TimelineProps['onBackgroundLongPress'] = (timeString, timeObject) => {
106106
const {currentDate} = this.state;
107-
const endTimeString = `${currentDate} ${(timeObject.hour + 1).toString().padStart(2, '0')}:${timeObject.minutes
108-
.toString()
109-
.padStart(2, '0')}:00`;
107+
const hourString = `${(timeObject.hour + 1).toString().padStart(2, '0')}`;
108+
const minutesString = `${timeObject.minutes.toString().padStart(2, '0')}`;
110109

111110
const newEvent = {
112111
start: `${currentDate} ${timeString}`,
113-
end: endTimeString,
112+
end: `${currentDate} ${hourString}:${minutesString}:00`,
114113
title: 'New Event',
115114
color: '#ffffff'
116115
};

0 commit comments

Comments
 (0)