From 45ce6b5ff31d773d10e0d004fe4d2e9b66109882 Mon Sep 17 00:00:00 2001 From: Andrew Hrdy Date: Thu, 24 May 2018 20:01:11 -0400 Subject: [PATCH] Facilities that open at 12pm now properly show 12pm. --- .gitignore | 2 ++ CHANGELOG.md | 9 ++++++++- src/utils/facilityUtils.js | 10 +++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index bb3d3ef..4d2ff0d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,7 @@ yarn-error.log* #local dotfiles /.storybook +/.vscode +/.idea /src/stories /src/styles/build diff --git a/CHANGELOG.md b/CHANGELOG.md index 54b4d86..a697ff1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [2.1.3] - 2018-05-24 + +### Fixed + +- Fixed bug causing facility times that started at 12:00pm to show as 12:00am. + ## [2.1.2] - 2018-03-06 ### Changed @@ -50,4 +56,5 @@ [2.0.1]: https://git.gmu.edu/srct/whats-open-web/compare/v2.0...v2.0.1 [2.1.0]: https://git.gmu.edu/srct/whats-open-web/compare/v2.0.1...v2.1-Midnight-Cherry [2.1.1]: https://git.gmu.edu/srct/whats-open-web/compare/v2.1-Midnight-Cherry...v2.1.1 -[2.1.2]: https://git.gmu.edu/srct/whats-open-web/compare/v2.1.1...v2.1.2 \ No newline at end of file +[2.1.2]: https://git.gmu.edu/srct/whats-open-web/compare/v2.1.1...v2.1.2 +[2.1.3]: https://git.gmu.edu/srct/whats-open-web/compare/v2.1.2...v2.1.3 \ No newline at end of file diff --git a/src/utils/facilityUtils.js b/src/utils/facilityUtils.js index 827a06e..42b7b12 100644 --- a/src/utils/facilityUtils.js +++ b/src/utils/facilityUtils.js @@ -298,11 +298,11 @@ const convertToMeridianTime = (time) => { let amPM = 'am'; if (timeArr[0] === 0 || timeArr[0] === 24) { timeArr[0] = 12; - } else { - if (timeArr[0] > 12) { - timeArr[0] -= 12; - amPM = 'pm'; - } + } else if (timeArr[0] === 12) { + amPM = 'pm'; + } else if (timeArr[0] > 12) { + timeArr[0] -= 12; + amPM = 'pm'; } if (timeArr[1] === 0) { -- 2.22.0