Commit d9ee2e50 authored by Nikolai R Kristiansen's avatar Nikolai R Kristiansen

馃悰 Support events without end_time

parent 8d74dfd2
Pipeline #711 failed with stage
in 1 minute and 44 seconds
......@@ -177,9 +177,14 @@ export default class EventDetail extends Component {
return null;
}
formatTimeFull(item) {
const endTime = item.end_time ? ` - ${this._formatTime(item.end_time)}` : '';
const startTime = `${this._formatLocalDay(item.start_time)} kl. ${this._formatTime(item.start_time)}`;
return `${startTime}${endTime}`;
}
render() {
const { item } = this.props;
return (
<ScrollView>
{this.showImage()}
......@@ -205,10 +210,7 @@ export default class EventDetail extends Component {
<Icon name="time" style={styles.icons} />
</View>
<View style={{ flexDirection: 'column' }}>
<Text style={styles.metaText}>
{this._formatLocalDay(item.start_time)} kl. {this._formatTime(item.start_time)} -{' '}
{this._formatTime(item.end_time)}
</Text>
<Text style={styles.metaText}>{this.formatTimeFull(item)}</Text>
<Text style={styles.metaSubtitle}>{this._formatRelative(item.start_time)}</Text>
</View>
</TouchableOpacity>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment