change some event datetime formatting
This commit is contained in:
@ -8,7 +8,7 @@ import {
|
||||
EventFragment,
|
||||
getClosestOccurrence,
|
||||
} from "@/lib/event";
|
||||
import { toLocalTime, formatDate, commonDateTimeFormat } from "@/lib/date";
|
||||
import { formatDate, formatExtendedDateTime } from "@/lib/date";
|
||||
|
||||
export const EventItem = ({
|
||||
event,
|
||||
@ -43,14 +43,12 @@ export const EventItem = ({
|
||||
<div className={styles.time}>
|
||||
{mode === "list" && nextOccurrence && (
|
||||
<div className={styles.dates}>
|
||||
{numOccurrences === 1 &&
|
||||
nextOccurrence?.start &&
|
||||
formatDate(nextOccurrence.start, commonDateTimeFormat)}
|
||||
{numOccurrences === 1 && nextOccurrence?.start && (
|
||||
<span>{formatExtendedDateTime(nextOccurrence.start)}</span>
|
||||
)}
|
||||
{numOccurrences > 1 && nextOccurrence?.start && (
|
||||
<>
|
||||
<span>
|
||||
{formatDate(nextOccurrence.start, commonDateTimeFormat)}
|
||||
</span>
|
||||
<span>{formatExtendedDateTime(nextOccurrence.start)}</span>
|
||||
<p className={styles.moreDates}>
|
||||
Flere datoer ({numOccurrences})
|
||||
</p>
|
||||
@ -62,7 +60,7 @@ export const EventItem = ({
|
||||
"occurrence" in event &&
|
||||
event.occurrence?.start && (
|
||||
<p className={styles.dates}>
|
||||
{formatDate(event.occurrence?.start, commonDateTimeFormat)}
|
||||
{formatExtendedDateTime(nextOccurrence.start)}
|
||||
</p>
|
||||
)}
|
||||
{mode === "calendar" &&
|
||||
|
Reference in New Issue
Block a user