-
Notifications
You must be signed in to change notification settings - Fork 0
Date #16
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
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,41 @@ | |||
const dateAdd = (today, diff) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't have to be today
it('should add days, hours', () => { | ||
const today = Date.parse('2019-10-22T00:10:50.616Z'); | ||
|
||
const result = dateAdd(today, '1.d 1.h'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you made it harder for yourself! Just follow the spec :)
const arrMultiply = [1, 60, 60, 24, 7, 4, 12]; | ||
const badArray = []; | ||
arr.forEach(string => { | ||
const split = string.split('.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the spec didn't include a .
const dateAdd = (today, diff) => { | ||
const arr = diff.split(' '); | ||
const modObj = { | ||
s: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldnt the values here be the values in the arrMultiply array?
return newTotalTime; | ||
}; | ||
|
||
const timesMotif = (arr, index, acc) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting.
No description provided.