change some event datetime formatting
This commit is contained in:
@ -1,7 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { formatDate, isTodayOrFuture } from "@/lib/date";
|
||||
import {
|
||||
formatDate,
|
||||
formatExtendedDateTime,
|
||||
isTodayOrFuture,
|
||||
} from "@/lib/date";
|
||||
import { EventFragment, EventOccurrence, compareDates } from "@/lib/event";
|
||||
import styles from "./dateList.module.scss";
|
||||
import Link from "next/link";
|
||||
@ -14,7 +18,7 @@ const DateListItem = ({ occurrence }: { occurrence: EventOccurrence }) => {
|
||||
<li className={styles.date}>
|
||||
<div className={styles.time}>
|
||||
<span className={styles.day}>
|
||||
{formatDate(occurrence.start, dateFormat)}
|
||||
{formatExtendedDateTime(occurrence.start, true)}
|
||||
</span>
|
||||
<span className={styles.hour}>
|
||||
{formatDate(occurrence.start, timeFormat)}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { EventCategory, EventFragment } from "@/lib/event";
|
||||
import { EventFragment } from "@/lib/event";
|
||||
import styles from "./eventHeader.module.scss";
|
||||
import Image from "@/components/general/Image";
|
||||
import { Pig } from "../general/Pig";
|
||||
import Link from "next/link";
|
||||
import { OrganizerList } from "./OrganizerList";
|
||||
|
||||
|
@ -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" &&
|
||||
|
@ -1,7 +1,7 @@
|
||||
import styles from "./newsItem.module.scss";
|
||||
import Image from "../general/Image";
|
||||
import { NewsFragment } from "@/lib/news";
|
||||
import { formatDate, commonDateFormat } from "@/lib/date";
|
||||
import { formatDate, compactDateFormat } from "@/lib/date";
|
||||
import Link from "next/link";
|
||||
|
||||
export const NewsItem = ({ news }: { news: NewsFragment }) => {
|
||||
@ -22,7 +22,7 @@ export const NewsItem = ({ news }: { news: NewsFragment }) => {
|
||||
</div>
|
||||
<div className={styles.text}>
|
||||
<p className={styles.date}>
|
||||
{formatDate(news.firstPublishedAt, commonDateFormat)}
|
||||
{formatDate(news.firstPublishedAt, compactDateFormat)}
|
||||
</p>
|
||||
<h2 className={styles.title}>{news.title}</h2>
|
||||
<p className={styles.lead}>{news.excerpt}</p>
|
||||
|
Reference in New Issue
Block a user