-
Notifications
You must be signed in to change notification settings - Fork 40
feat: added default date as the start of the current week #239
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: develop
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for emingi ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
CREDO23
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.
@ShadowFax1731, please add the requested changes before we merge your PR.
| }); | ||
|
|
||
| function getStartDayOftheWeek(date) { | ||
| const diff = date.getDate() - date.getDay() + (date.getDay() === 0 ? -6 : 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.
@ShadowFax1731 can you explain the logic here ?
I can see that you are trying to handle it manually, try with the momentjs package that already handles the first weekday for different locales:
const firstDayOfWeek = moment().startOf('week').format('YYYY-MM-DD');|
|
||
| useEffect(() => { | ||
| const getLocation = async (lat, lon) => { | ||
| try { |
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.
@ShadowFax1731, as mentioned in the issue #230, we need this feature on the 'Top Africa page` (for now) !
So please, use it only on the 'Top Africa' page
|
Hi @ShadowFax1731, are still working on changes requested ? |
Pull Request
Description
Set the default date in the form to be the start of the current week.
Changements Effectués
Implemented a function that takes in the current date and returns out the start of the current week.
Liste de Vérification
Merci !