Skip to content

feat: added default date as the start of the current week#239

Open
ShadowFax1731 wants to merge 1 commit into
kaliacad:developfrom
ShadowFax1731:no-default-data-230
Open

feat: added default date as the start of the current week#239
ShadowFax1731 wants to merge 1 commit into
kaliacad:developfrom
ShadowFax1731:no-default-data-230

Conversation

@ShadowFax1731

Copy link
Copy Markdown

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

  • [x ] Tester les changements localement.
  • [ x] Le code respecte les normes du projet.

Merci !

@netlify

netlify Bot commented Aug 2, 2024

Copy link
Copy Markdown

Deploy Preview for emingi ready!

Name Link
🔨 Latest commit fd73dde
🔍 Latest deploy log https://app.netlify.com/sites/emingi/deploys/66acf74e37083f0008258238
😎 Deploy Preview https://deploy-preview-239--emingi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@CREDO23 CREDO23 left a comment

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Collaborator

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 {

Copy link
Copy Markdown
Collaborator

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

@CREDO23

CREDO23 commented Aug 29, 2024

Copy link
Copy Markdown
Collaborator

Hi @ShadowFax1731, are still working on changes requested ?

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