feat: timezone conversion

This commit is contained in:
Sérgio Salgado 2021-04-29 19:48:14 +01:00 committed by Josh Harvey
parent 72dbeccb4b
commit b2b4fedf42
10 changed files with 101 additions and 36 deletions

View file

@ -1,3 +1,4 @@
import moment from 'moment'
import * as R from 'ramda'
const getPossibleUTCDSTPairs = timezones =>
@ -73,4 +74,10 @@ const getTzLabels = timezones =>
getFinalTimezones(timezones)
)
export { getTzLabels }
const formatDate = (date, offset, format) =>
moment
.utc(date)
.utcOffset(offset)
.format(format)
export { getTzLabels, formatDate }