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

Develop #1915

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

Develop #1915

wants to merge 3 commits into from

Conversation

denyssheremeta
Copy link

No description provided.

Copy link

@DanilWeda DanilWeda left a comment

Choose a reason for hiding this comment

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

Good job.
Check small comments)
Thanks

Comment on lines 20 to 26
if (fromFormat[yearIndex] === 'YY') {
if (parseInt(year) <= currentYear) {
year = '20' + year.padStart(2, '0');
} else {
year = '19' + year.padStart(2, '0');
}
}

Choose a reason for hiding this comment

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

Move all formats (YYYY,YY) to constant.
Also move all number values (20, 19) to constant

@denyssheremeta denyssheremeta requested a review from DanilWeda April 9, 2024 07:54
Copy link

@alexander-ignatow alexander-ignatow left a comment

Choose a reason for hiding this comment

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

Good for now 👍

However, please, avoid using string literals and magic numbers directly as a part of the logic. Such values should be constants (pls see my comment)

Comment on lines +18 to +19
const dayIndex = fromFormat.indexOf('DD');
const monthIndex = fromFormat.indexOf('MM');

Choose a reason for hiding this comment

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

DD and MM also should be constants

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