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

[Feature]: Use relational operators for date comparison #463

Open
1 of 2 tasks
injoonH opened this issue Apr 11, 2024 · 0 comments
Open
1 of 2 tasks

[Feature]: Use relational operators for date comparison #463

injoonH opened this issue Apr 11, 2024 · 0 comments

Comments

@injoonH
Copy link

injoonH commented Apr 11, 2024

Package Scope

  • Add to an existing package
  • New package

Package name: @toss/date@1.1.8

Overview

As JavaScript Date objects support relational operations, using libraries like date-fns is not necessary.

Describe the solution you'd like

export function isEqualOrBefore(lhs: Date, rhs: Date) {
  return lhs <= rhs;
  // return isEqual(lhs, rhs) || isBefore(lhs, rhs);
}

export function isEqualOrAfter(lhs: Date, rhs: Date) {
  return lhs >= rhs;
  // return isEqual(lhs, rhs) || isAfter(lhs, rhs);
}

Additional context

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

No branches or pull requests

1 participant