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

Excellent Package #12

Open
lhengl opened this issue Oct 16, 2022 · 1 comment
Open

Excellent Package #12

lhengl opened this issue Oct 16, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@lhengl
Copy link
Contributor

lhengl commented Oct 16, 2022

Hi,

I just want to say that this is an excellent package working with date separately to time. I was looking to build my own wrapper package for the DateTime class to achieve something similar. Luckily I found your package.

The key feature that stood out to me is the ability to use a const constructor as a default value. DateTime used to have this, but no longer. This makes it hard to work with the freezed package when all you want is a default value instead of using a required field.

Some other features I'd like added:

  1. The ability to show the difference in duration between 2 date values or 2 time values (currently can only be done with 1 date value and duration)
  2. The ability to pass a format to Date, DateRange, and TimeRange classes (currently only time is formattable)
  3. Introduce another class for DateAndTime to wrap DateTime so that it can be used as default values. This will just be a direct port from the DateTime class.
  4. More comparison for date ranges, such as:
    1. DateRange isWithin another dateRange
    2. DateRange encapsulates another dateRange (this.start < other.start && this.end > than other.end)
    3. DateRange is equal to, after, before, or overlap another date range
  5. Convenient default values such as:
    1. Date.startOfTime() - 0001-01-01
    2. Date.epoch() - 1970-01-01
    3. Date.endOfTime() - 9999-12-31

I'd be happy to contribute to this repos, if you'd let me.

Cheers!

@AndrewPiterov
Copy link
Owner

Hi @lhengl ,
glad to hear that someone else is using this package. Sure, feel free to contribute to this package and other mine packages. And please provide the desired implementation covered with tests. 🙌

@AndrewPiterov AndrewPiterov added the enhancement New feature or request label Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants