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

能不能把单位换算的功能也加进去 #35

Closed
lengjing opened this issue Jul 26, 2018 · 3 comments · Fixed by #66
Closed

能不能把单位换算的功能也加进去 #35

lengjing opened this issue Jul 26, 2018 · 3 comments · Fixed by #66

Comments

@lengjing
Copy link

比如时间换算,可以把100000ms 换算成几天几时几分几秒。
还有大小单位等等其他的换算

@fengmk2
Copy link
Member

fengmk2 commented Jan 13, 2024

pr is welcome

@abu-sufyan1
Copy link
Contributor

I'd like to work on this issue. Could you please assign it to me?

@fengmk2
Copy link
Member

fengmk2 commented Dec 25, 2024

I'd like to work on this issue. Could you please assign it to me?

sure, you just fork and send a pull request

abu-sufyan1 added a commit to abu-sufyan1/utility that referenced this issue Jan 4, 2025
…s to multiple different date formats and fixed other two test cases assertions
fengmk2 added a commit that referenced this issue Jan 14, 2025
close #35
#36

A function is added that takes milliseconds as an argument and returns
Date object, if second optional parameters is provided, it will return
the date in the specified format.

Also, the pull request contains a fix other two test cases which were
failing earlier.

We put the TIMEZONE object inside the resetTimezone() function, and now
we are getting the timezone based on the date that needs to be
transformed.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added a utility function to convert milliseconds to formatted date
strings.
- Introduced new date formatting options with support for multiple time
representations.
	- Enhanced timezone offset calculation for more precise date handling.
	- Added a function to convert `Date` objects to Unix timestamps.

- **Documentation**
	- Updated README with examples of the new date conversion function.

- **Tests**
	- Added comprehensive test cases for new date utility functions.
	- Improved test assertions for date-related methods.
- Introduced a new test suite for validating date conversions and
formats.

- **Chores**
	- Added a new dependency for improved caching functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: fengmk2 <[email protected]>
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 a pull request may close this issue.

3 participants