-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace transformDateToUTC with custom logic
- Loading branch information
1 parent
bd9f9de
commit 22a90cb
Showing
3 changed files
with
28 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Transforms a given date (or now) into UTC data. | ||
* @param {Date} date The date. Uses a new date if not given. | ||
* @returns {Date} The given date transformed to UTC. | ||
*/ | ||
export const getDateInUtc = (date = new Date()): Date => { | ||
return new Date(date.getTime() + date.getTimezoneOffset() * 60000); | ||
}; |
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