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

Test #2174

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

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

Your implementation of the formatDate function is on the right track and meets the core requirements of the task. 🎉 While there are some minor issues like variable naming and typos in comments, these don't impact the functionality. However, consider reviewing the logic for determining the century, as it might not be universally applicable. Keep up the good work and continue refining your code for clarity and maintainability! 😊

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


const joinSeparator = toFormat[toFormat.length - 1];

// variables of index date fromFormate

Choose a reason for hiding this comment

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

The comment here has a typo: 'fromFormate' should be 'fromFormat'.

const fromMM = fromFormat.indexOf('MM');
const fromDD = fromFormat.indexOf('DD');

// variables of index date toFormate

Choose a reason for hiding this comment

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

The comment here has a typo: 'toFormate' should be 'toFormat'.

const toDD = toFormat.indexOf('DD');

if (fromFormat[fromYYYY].length > toFormat[toYYYY].length) {
splitDate[fromYYYY] = splitDate[fromYYYY].slice(2);

Choose a reason for hiding this comment

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

This line slices the year to two digits if the 'fromFormat' year is longer than the 'toFormat' year. Ensure that this logic aligns with the expected behavior, especially if the formats might not always be 'YY' or 'YYYY'.

Comment on lines +35 to +38
if (+splitDate[fromYYYY] < 30) {
splitDate[fromYYYY] = '20' + splitDate[fromYYYY];
} else {
splitDate[fromYYYY] = '19' + splitDate[fromYYYY];

Choose a reason for hiding this comment

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

The logic for determining the century ('20' or '19') based on the year being less than 30 might not be universally applicable. Consider whether this assumption holds true for all expected input dates.

Copy link

@YevhS YevhS left a comment

Choose a reason for hiding this comment

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

change something

Copy link

@YevhS YevhS left a comment

Choose a reason for hiding this comment

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

change something

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