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

Add constants for max and min dates #609

Closed
graingert opened this issue Nov 14, 2017 · 3 comments
Closed

Add constants for max and min dates #609

graingert opened this issue Nov 14, 2017 · 3 comments

Comments

@graingert
Copy link

const maxMillis = (10 ** 8) * 24 * 60 * 60 * 1000;
export const maxDate = new Date(maxMillis);
export const epochDate = new Date(0);
export const minDate =  new Date(-maxMillis);
@kossnocorp kossnocorp changed the title add constant for max and min dates Add constants for max and min dates Jun 7, 2018
@kossnocorp kossnocorp added this to the Any release milestone Jun 7, 2018
@ThePaulMcBride
Copy link

I'd be happy to do this if you could explain a little more about what the issue is.

@graingert
Copy link
Author

It's just for convenience

@kossnocorp
Copy link
Member

I've reworked the constants:

  • minTime & maxTime instead of minDate & maxDate as having them as numbers makes more sense.
  • Removed epochDate as it could be represented by simple 0

kossnocorp pushed a commit that referenced this issue Jun 7, 2019
* Add constants: `minTime`, `maxTime`.
* Integrate constants into build system & docs.
elmomalmo pushed a commit to elmomalmo/date-fns that referenced this issue Jul 12, 2019
* Add constants: `minTime`, `maxTime`.
* Integrate constants into build system & docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants