Skip to content

Commit

Permalink
Date formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jcraigk committed Oct 11, 2024
1 parent 86f35e1 commit 07b228e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/javascript/components/Show.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Show = ({ trackSlug }) => {
{formatDurationShow(show.duration)}
</div>

<hr />
<hr className="sidebar-hr" />

<div className="sidebar-control-container">
<div className="hidden-phone">
Expand All @@ -105,7 +105,7 @@ const Show = ({ trackSlug }) => {

<div className="hidden-mobile">
<TagBadges tags={show.tags} parentId={show.date} />
<hr />
<hr className="sidebar-hr" />
<Link to={`/${show.previous_show_date}`}>
<FontAwesomeIcon icon={faCircleChevronLeft} className="mr-1" />
Previous show
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/components/Shows.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { useOutletContext, useNavigate } from "react-router-dom";
import { formatDurationShow, formatDate } from "./helpers/utils";
import { formatDurationShow, formatDateMed } from "./helpers/utils";
import TagBadges from "./controls/TagBadges";
import LikeButton from "./controls/LikeButton";
import ShowContextMenu from "./controls/ShowContextMenu";
Expand Down Expand Up @@ -47,7 +47,7 @@ const Shows = ({ shows, numbering = false, tourHeaders = false }) => {
{numbering && <span className="leftside-numbering">#{index + 1}</span>}
<span className="leftside-primary">
<CoverArt coverArtUrls={show.cover_art_urls} />
{formatDate(show.date)}
{formatDateMed(show.date)}
</span>
<span className="leftside-secondary">{show.venue.name}</span>
<span className="leftside-tertiary">
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/components/Tracks.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { useOutletContext, Link } from "react-router-dom";
import { formatDurationTrack, formatDurationShow, formatDate, truncate } from "./helpers/utils";
import { formatDurationTrack, formatDurationShow, formatDateMed, truncate } from "./helpers/utils";
import TagBadges from "./controls/TagBadges";
import HighlightedText from "./controls/HighlightedText";
import LikeButton from "./controls/LikeButton";
Expand Down Expand Up @@ -99,7 +99,7 @@ const Tracks = ({ tracks, viewStyle, numbering = false, omitSecondary = false, h
to={`/${track.show_date}/${track.slug}`}
onClick={(e) => e.stopPropagation()}
>
{formatDate(track.show_date)}
{formatDateMed(track.show_date)}
</Link>
</span>{" "}
</>
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/components/controls/ShowContextMenu.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useRef, useState, useEffect } from "react";
import { Link, useOutletContext } from "react-router-dom";
import { formatDate } from "../helpers/utils";
import { formatDateMed } from "../helpers/utils";
import { useFeedback } from "./FeedbackContext";
import LikeButton from "./LikeButton";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
Expand Down Expand Up @@ -36,7 +36,7 @@ const ShowContextMenu = ({ show, adjacentLinks = true }) => {
const modalContent = (
<>
<h2 className="title">Taper Notes</h2>
<h3 className="subtitle">{formatDate(show.date)} &bull; {formatDate(show.venue_name)}</h3>
<h3 className="subtitle">{formatDateMed(show.date)} &bull; {show.venue_name}</h3>
<p dangerouslySetInnerHTML={{ __html: (show.taper_notes || "").replace(/\n/g, "<br />") }}></p>
</>
);
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/stylesheets/content.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
position: relative;
top: -3px;
margin-right: 0.1rem;
display: inline-block;
width: 3.8rem;

&:hover {
text-decoration: underline;
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/stylesheets/layout.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ main {
flex: 0;
}

hr {
.sidebar-hr {
display: none;
}

Expand Down

0 comments on commit 07b228e

Please sign in to comment.