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

Create utils for time manipulation on JS Date objects #77

Open
bjuppa opened this issue Aug 10, 2023 · 0 comments
Open

Create utils for time manipulation on JS Date objects #77

bjuppa opened this issue Aug 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@bjuppa
Copy link
Owner

bjuppa commented Aug 10, 2023

It could be useful to provide utils for directly truncating minutes relative full hours directly on JS Date objects, and it's easy to forget that it requires a timezone to do correctly... ;)

ComPlainDate could help developers by directly providing:

  • startOfHour(timezone: string)(instant: Date): Date
  • startOfDay(timezone: string)(instant: Date): Date

...and perhaps also:

  • truncateToHalfHour
  • truncateToThirdOfHour
  • truncateToQuarterOfHour
  • truncateToSixthOfHour
  • truncateToTwelfthOfHour
@bjuppa bjuppa added the enhancement New feature or request label Aug 10, 2023
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

1 participant