Verified Commit 305d5e62 authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Fix date formatting issue

parent 8dcb86e4
......@@ -6,6 +6,8 @@ import { Toolbar, Button, TextField } from '@material-ui/core'
import { useIntl, FormattedMessage } from 'gatsby-plugin-intl'
import Alert from '@material-ui/lab/Alert'
import { dateFormatter } from 'config'
import TranslatedMessage from '../general/translatedMessage'
import CopyButton from '../general/copyButton'
import Spinner from '../general/spinner'
......@@ -156,12 +158,15 @@ const EventDetails = ({ eventId, ...props }) => {
notification = {
severity: 'info',
label: (
<React.Fragment>
<span>
<FormattedMessage id="events.registration.startsAt" />
&nbsp;
<span className={classes.notificationColored}>
{data.time_register_start}
{dateFormatter[intl.locale].weekdayTimezone.format(
new Date(data.time_register_start)
)}
</span>
</React.Fragment>
</span>
),
}
} else if (auth.isLoggedIn && signup && signup.data && !notification) {
......
......@@ -19,8 +19,12 @@ const EventTime = ({ time_start, time_end, ...props }) => {
) {
let dates = {}
if (
date_start.getDate() === date_end.getDate() ||
(date_start.getDate() === date_end.getDate() &&
date_start.getMonth() === date_end.getMonth() &&
date_start.getFullYear() === date_end.getFullYear()) ||
(date_start.getDate() === date_end.getDate() - 1 &&
date_start.getMonth() === date_end.getMonth() &&
date_start.getFullYear() === date_end.getFullYear() &&
date_start.getHours() > date_end.getHours())
) {
dates = {
......
Supports Markdown
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