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

Enhance time formatting with new hide options #72

Merged
merged 10 commits into from
Nov 15, 2024

Conversation

gerbermichi
Copy link
Contributor

@gerbermichi gerbermichi commented Oct 16, 2024

Added options hideYears, hideYearsAndDays, and hideSeconds to allow for more customizable time formatting.

Fixes #70

Added options `hideYears`, `hideYearsAndDays`, and `hideSeconds` to allow for more customizable time formatting.
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
test.js Show resolved Hide resolved
@sindresorhus
Copy link
Owner

Thanks for contributing.

@sindresorhus
Copy link
Owner

The readme needs to be updated too.

Updated options "hideYears" to "hideYear" and "hideYearsAndDays" to "hideYearAndDays" for consistency. Also updated relevant code and tests to use the new option names.
Changed the hours calculation to use BigInt to handle large integers accurately. This ensures that the computation remains precise even when dealing with large numbers, enhancing the robustness of the code.
Included various configurations to test detailed time formatting including decimal seconds, sub-millisecond precision, and verbose modes. This ensures comprehensive coverage across different time display preferences.
Removed extra spaces in the comment blocks and aligned the `@default` lines correctly. This change improves code readability and consistency in the index.d.ts file.
@sindresorhus sindresorhus merged commit 25509bc into sindresorhus:main Nov 15, 2024
2 checks passed
@sindresorhus
Copy link
Owner

Thanks :)

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.

add option to hide seconds: usefull for showing time in months, day, hour, minutes
2 participants