Passed
Push — renovate/eslint-7.x ( eb7113 )
by
unknown
05:36
created

Event.render   A

Complexity

Conditions 1

Size

Total Lines 11
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
dl 0
loc 11
rs 9.85
c 0
b 0
f 0
1
import React, { Component } from "react"
2
3
import moment from "moment-timezone"
4
import "moment/locale/nl-be"
5
6
import { CardImage } from "../components/cards"
7
8
class Event extends Component {
9
  render() {
10
    const { title, localFile, uri, datetime_start, datetime_end } = this.props
11
12
    moment.locale("nl-BE")
13
    const momentStart = moment(datetime_start).tz("Europe/Brussels")
14
    const momentEnd = moment(datetime_end).tz("Europe/Brussels")
15
    const body = `Van ${momentStart.format(
16
      "dddd DD MMMM YYYY - H:mm"
17
    )} tot ${momentEnd.format("dddd DD MMMM - H:mm")}`
18
    return (
19
      <CardImage title={title} localFile={localFile} link={uri} body={body} />
20
    )
21
  }
22
}
23
24
export default Event
25