-
Notifications
You must be signed in to change notification settings - Fork 18
Solved Challenge #2
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
hyfi06
left a comment
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.
Some changes are suggested
src/filter.js
Outdated
| { | ||
| 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) | ||
| } |
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.
Cuando tienes código similar repetido varias veces es señal de que debes implementar una función o una clase
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.
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) => { |
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.
No usas el parámetro date
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.
Resuelto en el siguiente commit. ¡Gracias!
src/filter.js
Outdated
| const makeFilter = (date) => { | ||
| let filters = []; | ||
|
|
||
| const today = new Date(2020,0,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.
No tienes que quemar el valor de la fecha, lo recibes como parámetro.
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.
Resuelto en el siguiente commit. ¡Gracias!
hyfi06
left a comment
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.
Some comments
Completed the makeFilter function