Skip to content

Commit

Permalink
remove unused function
Browse files Browse the repository at this point in the history
no longer needed with the copy change
  • Loading branch information
thecristen committed Nov 10, 2023
1 parent bf4a357 commit 6898d06
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
18 changes: 1 addition & 17 deletions apps/site/assets/ts/helpers/__tests__/date-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { addMinutes, addSeconds } from "date-fns";
import {
compareStringTimes,
formatRelativeTime,
formatToBostonTime,
todayDateString
formatToBostonTime
} from "../date";

describe("compareStringTimes", () => {
Expand Down Expand Up @@ -45,18 +44,3 @@ describe("formatRelativeTime", () => {
expect(formatRelativeTime(laterDate, baseDate)).toBe("11:10 AM");
});
});

describe("todayDateString", () => {
beforeAll(() => {
jest.useFakeTimers();
jest.setSystemTime(new Date("2012-10-10T09:00:00.000+04:00"));
});

it("returns formatted today date", () => {
expect(todayDateString()).toEqual("Oct 10");
});

afterAll(() => {
jest.useRealTimers();
});
});
7 changes: 0 additions & 7 deletions apps/site/assets/ts/helpers/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,4 @@ export const isSameDayInBoston = (
return date1InBoston === date2InBoston;
};

export const todayDateString = (): string =>
new Date().toLocaleDateString("en-US", {
month: "short",
day: "numeric",
timeZone: BOSTON_TIMEZONE
});

export default formattedDate;
1 change: 0 additions & 1 deletion apps/site/assets/ts/stop/components/DepartureList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import renderSvg from "../../helpers/render-svg";
import { isSuppressiveAlert } from "../../models/alert";
import Alerts from "../../components/Alerts";
import { isACommuterRailRoute } from "../../models/route";
import { todayDateString } from "../../helpers/date";

interface DepartureListProps {
route: Route;
Expand Down

0 comments on commit 6898d06

Please sign in to comment.