-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support convert milliseconds and fix timezone (#66)
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]>
- Loading branch information
1 parent
d610387
commit 4bc6691
Showing
4 changed files
with
111 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters