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 millis-based version of formatDateOrTime() and isThisYear(), deprecated sec-based version #43

Merged
merged 2 commits into from
May 1, 2024

Conversation

tom93
Copy link
Contributor

@tom93 tom93 commented Mar 25, 2024

The seconds-based version uses Int so it will break due to the Year 2038 problem. Add a version that uses milliseconds (as Long).

This matches the existing formatDate() extension, which already had both a seconds-based (Int) version and a milliseconds-based (Long) version.

What is it?

  • Bugfix
  • Feature
  • Codebase improvement

Description of the changes in your PR

  • Add milliseconds-based version of formatDateOrTime() and isThisYear()
  • Mark seconds-based version as deprecated
  • Deprecate Int.formatDate(), should instead use Long.formatDate() instead

Fixes the following issue(s)

Not tracked.

Acknowledgement

…, deprecated seconds-based version

The seconds-based version uses Int so it will break due to the Year
2038 problem. Add a version that uses milliseconds (as Long).

This matches the existing formatDate() extension, which already had
both a seconds-based (Int) version and a milliseconds-based (Long)
version.

Also deprecate Int.formatDate(), and make it a simple wrapper for
Long.formatDate() to reduce code repetition.
@tom93 tom93 force-pushed the pr/format-date-long branch from ca22da3 to 8d86e4a Compare March 25, 2024 16:56
@naveensingh
Copy link
Member

Should be good, thanks!

@naveensingh naveensingh merged commit cc8b9c2 into FossifyOrg:master May 1, 2024
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.

2 participants