Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

test(order-list): verify time format #19

Closed
wants to merge 2 commits into from

Conversation

robbobfrh84
Copy link

Changes

  1. Adds , and `` methods to orderList.js component
  2. Updates React's HTML to include format24Hour for each order's hour, minute and second as arguments.

Purpose

Javascript's Date object returns single digit hour, minute and second without a 0 padding.

  • This could be confusing to a user as the time 09:01:09 would render as 21:1:9; a very confusing time format.

Approach

This common front-end problem could be solved in three common ways....

  • 1: Adding a time conversation library like moment.js to handle these use-cases.
  • 2: Build stand-alone re-usable react component to formate dates. Like, dates.js
  • 3: ⭐️ Build a singleIn-component solution to handle only this specific case.

I elected for the 3rd, and simplest solution for this use-case. Perhaps creating another issue to look deeper into this is needed. Or, could be added as a discussion point for a future meeting / topic.

Pre-Testing TODOs

  • Run local environments
    • Docker backend: docker compose up
    • Browser client: npm start
  • Visit localhost:3000 in your browser and login (NOTE: any email & password will be accepted)
  • Select "Order Form" button in the navbar.
  • Make a couple menu selection where a minute, second or hour is represented with a singe digit.

Testing Steps

  • Select "View Order" and see your newly selected Item displayed.
  • Confirm that the dates are formatted correctly.

Learning

Closes #2

@robbobfrh84 robbobfrh84 requested a review from Fleury14 as a code owner April 20, 2022 16:41
@robbobfrh84 robbobfrh84 changed the title Issue 3 2 test(order-list): verify time format Apr 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Order Time does not format time correctly
1 participant