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

solution #2189

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

solution #2189

wants to merge 1 commit into from

Conversation

pasha30061
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.

Great job on implementing the formatDate function! 🎉 Your code meets the task requirements and handles the conversion of date formats effectively. While there was a minor issue with the logic for converting 'YY' to 'YYYY', it doesn't critically impact the functionality. For future improvements, consider using parseInt(dateObject['YY'], 10) for a more accurate comparison when determining the century. Keep up the excellent work and continue refining your skills! 😊

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

Comment on lines +24 to +27
dateObject['YYYY'] =
+dateObject['YY'] < 30
? `20${dateObject['YY']}`
: `19${dateObject['YY']}`;

Choose a reason for hiding this comment

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

The logic for converting 'YY' to 'YYYY' is incorrect. The expression +dateObject['YY'] < 30 will always evaluate to a boolean, which is not intended here. You should compare the numeric value of 'YY' to determine the century correctly. Consider using parseInt(dateObject['YY'], 10) for comparison.

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