Replaced the displayed building hours to reflect the status and open/close hours of the fitness centers. This change is applied to the gym cards on the home page as well as the gym detail pages.
Changes Made
Gym
Created fitnessCenterIsOpen to determine whether at least one fitness center is open at the specified gym.
Created determineStatus to retrieve the status of the Gym depending on the hours of its fitness centers. This status reflects the latest close time if at least one fitness center is open and the earliest open time if no fitness centers are open.
Home Gym Cell
Modified status text to reflect whether there is a fitness center open at the gym.
If a fitness center is open, the “closes at” label displays the latest close time of the fitness centers open at the gym.
If all fitness centers are closed, the “opens at” label displayed the earliest open time of the fitness centers at the gym.
Gym Detail View
Commented out code involving the building hours status and hours button.
Changed the displayed gym status to reflect whether at least one fitness center is currently open.
Other Changes
Created dummy data for Teagle under DummyData.swift. Due to missing property isSpecial , fixed previous dummy data that includes OpenHours .
Test Coverage
Created test cases for fitnessCenterIsOpen in Gym.
Created test cases for determineStatus in Gym.
Both of these test cases are to test the logic for varying fitness center hours at Teagle.
Overview
Replaced the displayed building hours to reflect the status and open/close hours of the fitness centers. This change is applied to the gym cards on the home page as well as the gym detail pages.
Changes Made
Gym
fitnessCenterIsOpen
to determine whether at least one fitness center is open at the specified gym.determineStatus
to retrieve the status of theGym
depending on the hours of its fitness centers. This status reflects the latest close time if at least one fitness center is open and the earliest open time if no fitness centers are open.Home Gym Cell
Gym Detail View
Other Changes
DummyData.swift
. Due to missing propertyisSpecial
, fixed previous dummy data that includesOpenHours
.Test Coverage
fitnessCenterIsOpen
inGym
.determineStatus
inGym
.Next Steps
Screenshots (optional)
Building Hours -> Gym/Fitness Center Hours