Skip to content
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

add solution #2191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Danylo-Kachaniuk
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Thank you for your hard work on this task! 😊 While your implementation of the formatDate function is mostly correct and meets many of the task requirements, there are a couple of critical issues that need to be addressed before we can approve the pull request:

  1. Year Conversion Logic: The current logic for converting two-digit years to four-digit years may not handle all cases correctly. For example, converting '29' to '2029' might not always be the intended behavior. It would be beneficial to add more robust logic to handle different century assumptions or provide a way for users to specify the century.

  2. Delimiter Assumption: The code assumes that the fourth element in the fromFormat and toFormat arrays is the delimiter. This assumption might not hold true if the format arrays do not have exactly four elements. Consider implementing a check or a more flexible method to determine the delimiter.

Once these issues are resolved, your solution will be much stronger and ready for approval. Keep up the great work, and don't hesitate to reach out if you need any help! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

Comment on lines +11 to +12
const [, , , slider] = fromFormat;
const [, , , glue] = toFormat;

Choose a reason for hiding this comment

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

The code assumes that the fourth element in fromFormat and toFormat arrays is the delimiter. This assumption might not always hold true, especially if the format arrays do not have exactly four elements. Consider adding a check or a more flexible way to determine the delimiter.

Comment on lines +61 to +73
if (normalDate[0].length <= 2 && toFormat.includes('YYYY')) {
if (+normalDate[0] >= 30) {
normalDate[0] = +normalDate[0] + 1900;
} else {
normalDate[0] = +normalDate[0] + 2000;
}
} else if (normalDate[0].length > 2 && toFormat.includes('YY')) {
if (+normalDate[0] < 2000) {
normalDate[0] = +normalDate[0] - 1900;
} else {
normalDate[0] = +normalDate[0] - 2000;
}
}

Choose a reason for hiding this comment

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

The logic for converting two-digit years to four-digit years and vice versa may not work correctly for all cases. For example, if the input year is '29', it will be converted to '2029', which might not be the intended behavior. Consider adding more robust logic to handle different century assumptions or provide a way for the user to specify the century.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]

If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]

If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]

If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]

If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.

Copy link

@etojeDenys etojeDenys left a comment

Choose a reason for hiding this comment

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

in general looks good

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.

3 participants