Skip to content

Conversation

adoxic
Copy link
Collaborator

@adoxic adoxic commented Oct 22, 2019

No description provided.

@@ -0,0 +1,41 @@
const dateAdd = (today, diff) => {

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');

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('.');

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,

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) => {

Choose a reason for hiding this comment

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

interesting.

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.

2 participants