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

feat(kit): Date, DateTime, DateRange supports strict and non-strict modes #1218

Closed
wants to merge 29 commits into from

Conversation

KrollikRoddzer
Copy link
Contributor

Closes #1217

Copy link
Contributor

github-actions bot commented Apr 26, 2024

Visit the preview URL for this PR (updated for commit 978c3fd):

https://maskito--pr1218-non-strict-mode-date-voc8yetz.web.app

(expires Sun, 12 May 2024 10:44:25 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 61e4dea776cbea516b68c67840913d2edd88bb90

@KrollikRoddzer KrollikRoddzer changed the title [WIP] feat(kit): Date, DateTime, DateRange supports strict and non-strict modes feat(kit): Date, DateTime, DateRange supports strict and non-strict modes May 2, 2024
Comment on lines +42 to +48
validatedValue +=
clampedDate.getTime() === min.getTime() ||
clampedDate.getTime() === max.getTime()
? toDateString(dateToSegments(clampedDate), {
dateMode: dateModeTemplate,
})
: dateString;
Copy link
Member

Choose a reason for hiding this comment

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

Why cannot we use the previous approach ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because if date is invalid it will make it valid. In this proccessor we don't need it

Comment on lines 46 to 50
strictDateTimeModeValidation({
date: segmentsToDate(parsedDate),
strict,
dateSegments: parsedDate,
}),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
strictDateTimeModeValidation({
date: segmentsToDate(parsedDate),
strict,
dateSegments: parsedDate,
}),
strict ? dateToSegments(segmentsToDate(parsedDate)) : parsedDateSegments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Date and DateTime must use the same logic

Copy link
Contributor

⛔ Lint result job has failed!

Copy link
Contributor

⛔ Lint result job has failed!

@nsbarsukov
Copy link
Member

Closing this PR until it becomes more relevant for us.

@nsbarsukov nsbarsukov closed this Jun 13, 2024
@nsbarsukov nsbarsukov deleted the non-strict-mode-date branch June 13, 2024 13:50
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.

🚀 - strict and non-strict modes for Date, DateRange, DateTime
3 participants