Skip to content

Commit

Permalink
dateHelperVCalendar.js: revert dayjs.tz back again to dayjs
Browse files Browse the repository at this point in the history
This was only needed to run the tests in multiple timezones.
Now this is not needed anymore.
(in a later pr we may export dayjs.tz instead of the dayjs object
which does not allow to change the timezone between tests).
  • Loading branch information
BacLuc committed Dec 27, 2023
1 parent 67c07d3 commit 4a16d35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/helpers/dateHelperVCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import dayjs from './dayjs.js'

// converts a timestamp (local timezone) into ISO String format (UTC timezone)
function timestampToUtcString(timestamp) {
return dayjs.utc(dayjs.tz(timestamp).format('YYYY-MM-DD HH:mm')).format()
return dayjs.utc(dayjs(timestamp).format('YYYY-MM-DD HH:mm')).format()
}

// converts ISO String format (UTC timezone) into a timestamp (local timezone)
function utcStringToTimestamp(string) {
return dayjs.tz(dayjs.utc(string).format('YYYY-MM-DD HH:mm')).valueOf()
return dayjs(dayjs.utc(string).format('YYYY-MM-DD HH:mm')).valueOf()
}

export { timestampToUtcString, utcStringToTimestamp }

0 comments on commit 4a16d35

Please sign in to comment.