Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(time format): fix order time format #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mcspach
Copy link
Owner

@mcspach mcspach commented Jun 24, 2021

Changes

  1. Added function called formatDigits which always returns a two-digit number
  2. Applied the function to hours, seconds, and minutes in render

Purpose

Order Time should be correctly formatted in hh:mm:ss format.

Approach

The dates will now include six digits at all times

Learning

  1. Researched best practices, didn't find what I was looking for.
  2. Read through MDN to understand more about Date() and Time() get methods
  3. Decided easiest solution was write a short function to format each number

inspiration for the simplest function:
https://electrictoolbox.com/pad-number-two-digits-javascript/

If this closes an issue, reference the issue here. If it doesn't, remove this line
Closes Shift3#30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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