Skip to content

Units module#2

Open
tshemsedinov wants to merge 2 commits into
masterfrom
units
Open

Units module#2
tshemsedinov wants to merge 2 commits into
masterfrom
units

Conversation

@tshemsedinov

Copy link
Copy Markdown
Member

No description provided.

@tshemsedinov tshemsedinov added the enhancement New feature or request label Oct 22, 2019
@tshemsedinov tshemsedinov self-assigned this Oct 22, 2019
Comment thread JavaScript/3-units.js
Comment on lines +3 to +8
const DURATION_UNITS = {
days: { rx: /(\d+)\s*d/, mul: 86400 },
hours: { rx: /(\d+)\s*h/, mul: 3600 },
minutes: { rx: /(\d+)\s*m/, mul: 60 },
seconds: { rx: /(\d+)\s*s/, mul: 1 }
};

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's start with different data structure for this function

const DURATION_UNITS = {
  d: 86400,
  h: 3600,
  m: 60,
  s: 1,
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant