chore: made sure timezone is an optional argument#14
Merged
Conversation
nachiketa-vadera-at-quicko
approved these changes
Apr 15, 2026
parth-choksi-at-quicko
approved these changes
Apr 15, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors and improves the
DateUtilclass insrc/utils/date/DateUtil.ts, focusing on standardizing timezone handling, simplifying internal logic, and making the API more consistent and user-friendly. Most methods now default to using UTC if no timezone is specified, and several helper methods have been introduced to reduce code duplication. The version inpackage.jsonis also incremented.Key improvements include:
Timezone Handling & Consistency:
DEFAULT_TIMEZONEconstant (set to'UTC') and theresolveTimeZone/toTZDatehelper methods, ensuring all date operations consistently use UTC by default unless a timezone is provided. This change also updates method signatures and documentation to reflect the new default behavior. [1] [2] [3]API Simplification & Refactoring:
printDate,getStartOfDay,getEndOfDay,daysInBetween,monthsInBetween,yearsInBetween, andaddDurationto use the new helpers, reducing code duplication and improving readability. [1] [2] [3] [4] [5]normalizeDatehelper in favor of the new approach.API Improvements:
timeZoneparameter optional (defaulting to UTC) and improved JSDoc comments for clarity. [1] [2] [3]Minor Fixes:
isLeapYearmethod to use the new timezone handling.Version Bump:
2.0.7inpackage.json.