From 2e628acaadc9ff969c840169b5729fff2c535d05 Mon Sep 17 00:00:00 2001 From: Nathan Rogan Date: Mon, 18 Mar 2024 16:44:02 +0000 Subject: [PATCH] add local to train times (#744) --- .env.development | 6 +++--- package-lock.json | 20 +++++++++++++++++++ package.json | 1 + public/index.html | 2 +- .../shared/DisruptionInfo/DisruptionInfo.js | 7 ++++--- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.env.development b/.env.development index 79d34eac..7da8d9b2 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ EXTEND_ESLINT=true # Set linting to true on dev -# developemnt API and keys -REACT_APP_API_HOST='https://wmca-api-portal-staging.azure-api.net' -REACT_APP_API_KEY='222b17e018f94b5ea1c08913db98f298' +# developemnt API and keys https://wmca-api-portal-staging.azure-api.net 222b17e018f94b5ea1c08913db98f298 +REACT_APP_API_HOST='https://api.wmnetwork.co.uk' +REACT_APP_API_KEY='514b8bafa009424289cb2d7a12c54f6e' # feedback link id REACT_APP_FEEDBACK_LINK_URL='https://forms.office.com/Pages/ResponsePage.aspx' REACT_APP_FEEDBACK_LINK_ID='RetZCK7xCk6e-ubWa7tnL1voVKMeFXVKvUhU3Uh8aqFUNUNVNFlKOVpLMThNV0g0T1VZWDYyT1FLNCQlQCN0PWcu' diff --git a/package-lock.json b/package-lock.json index 4dd47052..071f4517 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "fecha": "^4.2.3", "haversine-distance": "^1.2.1", "moment": "^2.29.4", + "moment-timezone": "^0.5.45", "prop-types": "^15.8.1", "react": "^18.2.0", "react-app-polyfill": "^3.0.0", @@ -12427,6 +12428,17 @@ "node": "*" } }, + "node_modules/moment-timezone": { + "version": "0.5.45", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.45.tgz", + "integrity": "sha512-HIWmqA86KcmCAhnMAN0wuDOARV/525R2+lOLotuGFzn4HO+FH+/645z2wx0Dt3iDv6/p61SIvKnDstISainhLQ==", + "dependencies": { + "moment": "^2.29.4" + }, + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -26854,6 +26866,14 @@ "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" }, + "moment-timezone": { + "version": "0.5.45", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.45.tgz", + "integrity": "sha512-HIWmqA86KcmCAhnMAN0wuDOARV/525R2+lOLotuGFzn4HO+FH+/645z2wx0Dt3iDv6/p61SIvKnDstISainhLQ==", + "requires": { + "moment": "^2.29.4" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index 38aa7949..f3f28351 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "fecha": "^4.2.3", "haversine-distance": "^1.2.1", "moment": "^2.29.4", + "moment-timezone": "^0.5.45", "prop-types": "^15.8.1", "react": "^18.2.0", "react-app-polyfill": "^3.0.0", diff --git a/public/index.html b/public/index.html index 89eef952..77e70db6 100644 --- a/public/index.html +++ b/public/index.html @@ -1,5 +1,5 @@ - + diff --git a/src/components/shared/DisruptionInfo/DisruptionInfo.js b/src/components/shared/DisruptionInfo/DisruptionInfo.js index a2d4193e..bccc4c39 100644 --- a/src/components/shared/DisruptionInfo/DisruptionInfo.js +++ b/src/components/shared/DisruptionInfo/DisruptionInfo.js @@ -3,6 +3,8 @@ import PropTypes from 'prop-types'; import dompurify from 'dompurify'; // Import Moment import Moment from 'react-moment'; +import 'moment-timezone'; + // Import contexts import { AutoCompleteContext, FetchDisruptionsContext, ModeContext } from 'globalState'; // Import Helper functions @@ -109,13 +111,12 @@ function DisruptionInfo({ disruption }) {

When?
- {/* Temporary fix for textual errors of rail disruption timings during British Summer Time: */} - + {disruption.disruptionTimeWindow.start} {' to '} - + {disruption.disruptionTimeWindow.end}