Skip to content

Conversation

@jcalvarezj
Copy link

Completed the makeFilter function

Copy link

@hyfi06 hyfi06 left a comment

Choose a reason for hiding this comment

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

Some changes are suggested

src/filter.js Outdated
Comment on lines 15 to 34
{
label: 'Últimos 7 días',
startAt: format(sub(today, { days: 7 }), dateFormat),
endAt: format(today, dateFormat)
},
{
label: 'Últimos 28 días',
startAt: format(sub(today, { days: 28 }), dateFormat),
endAt: format(today, dateFormat)
},
{
label: 'Últimos 90 días',
startAt: format(sub(today, { days: 90 }), dateFormat),
endAt: format(today, dateFormat)
},
{
label: 'Últimos 365 días',
startAt: format(sub(today, { days: 365 }), dateFormat),
endAt: format(today, dateFormat)
}
Copy link

Choose a reason for hiding this comment

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

Cuando tienes código similar repetido varias veces es señal de que debes implementar una función o una clase

Copy link
Author

Choose a reason for hiding this comment

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

Resuelto en el siguiente commit. ¡Gracias!

src/filter.js Outdated
const startOfYear = require('date-fns/startOfYear')
const endOfYear = require('date-fns/endOfYear')

const makeFilter = (date) => {
Copy link

Choose a reason for hiding this comment

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

No usas el parámetro date

Copy link
Author

Choose a reason for hiding this comment

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

Resuelto en el siguiente commit. ¡Gracias!

src/filter.js Outdated
const makeFilter = (date) => {
let filters = [];

const today = new Date(2020,0,1);
Copy link

Choose a reason for hiding this comment

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

No tienes que quemar el valor de la fecha, lo recibes como parámetro.

Copy link
Author

Choose a reason for hiding this comment

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

Resuelto en el siguiente commit. ¡Gracias!

Copy link

@hyfi06 hyfi06 left a comment

Choose a reason for hiding this comment

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

Some comments

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