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 #1940

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

Conversation

danil-maksimenko
Copy link

No description provided.

Copy link

@GUSILLUS GUSILLUS left a comment

Choose a reason for hiding this comment

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

GJ! But:

Comment on lines 18 to 24
if (component === 'YYYY') {
year = value;
}

if (component === 'YY') {
year = value;
}

Choose a reason for hiding this comment

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

Consider combining this in one if using || operator

Comment on lines 52 to 58
if (component === 'YYYY') {
newDate.push(year);
}

if (component === 'YY') {
newDate.push(year);
}

Choose a reason for hiding this comment

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

Same

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.

lgtm

Comment on lines +48 to +58
if (component === 'YYYY' || component === 'YY') {
newDate.push(year);
}

if (component === 'MM') {
newDate.push(month);
}

if (component === 'DD') {
newDate.push(day);
}

Choose a reason for hiding this comment

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

better to simplify it using the switch/case

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