Skip to content

Commit

Permalink
DBC22-1972
Browse files Browse the repository at this point in the history
  • Loading branch information
fatbird committed May 17, 2024
1 parent 2f5d9e8 commit eddb455
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
14 changes: 6 additions & 8 deletions src/frontend/src/Components/data/restStops.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,24 @@ export function getRestStops(routePoints) {
}

export function isRestStopClosed(restStopProperties) {
if(restStopProperties === undefined){
if (restStopProperties === undefined) {
return false;
}
const isOpenYearRound = restStopProperties.OPEN_YEAR_ROUND === "Yes"? true: false;
if(isOpenYearRound){
const isOpenYearRound = restStopProperties.OPEN_YEAR_ROUND === "Yes";
if (isOpenYearRound) {
return false;
}
else{
} else {
const today = new Date();
const year = today.getFullYear();
const openDate = restStopProperties.OPEN_DATE;
const closeDate = restStopProperties.CLOSE_DATE;
if(openDate && closeDate){
if (openDate && closeDate) {
const openDateY = new Date(year.toString() + "-" + openDate.toString());
const closeDateY = new Date(year.toString() + "-" + closeDate.toString());
const isInSeason = (today.getTime() > openDateY.getTime()) && (today.getTime() < closeDateY.getTime());
const isClosed = isInSeason? false: true;
return isClosed;
}
else{
} else {
return true;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/src/Components/map/panels/mapPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export function getRegionalPopup(weatherFeature) {
</div>
<p className="label">Visibility</p>
<p className="data">
{Math.round(conditions.visibility_value)}
{Math.round(conditions.visibility_value)}&nbsp;
{conditions.visibility_units}
</p>
</div>
Expand All @@ -348,10 +348,10 @@ export function getRegionalPopup(weatherFeature) {
{ conditions.wind_speed_value === "calm" ?
<span>calm</span> :
<span>
{ Math.round(conditions.wind_speed_value) }
{ Math.round(conditions.wind_speed_value) }&nbsp;
{ conditions.wind_speed_units }
{ conditions.wind_gust_value && (
<span>&nbsp;gusts
<span><br />&nbsp;gusts&nbsp;
{Math.round(conditions.wind_gust_value)}
&nbsp;{conditions.wind_gust_units}
</span>
Expand Down
5 changes: 3 additions & 2 deletions src/frontend/src/Components/map/panels/mapPopup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@
.friendly-time {
margin: 0 auto 1rem;
&-text {
text-align: center;
color: $Type-Secondary;
font-size: 0.875rem;
}
Expand Down Expand Up @@ -598,7 +599,7 @@

&:not(.group) {
.data-icon {
align-self: center;
align-self: top;
}
}

Expand Down Expand Up @@ -646,7 +647,7 @@
.name {
color: #584215;
}
}
}

.popup__content {
ul.advisories-list {
Expand Down

0 comments on commit eddb455

Please sign in to comment.