Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 40 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"mobile-detect": "^1.4.2",
"moment": "^2.14.1",
"moment-range": "^4.0.1",
"moment-timezone": "^0.5.27",
"prop-types": "^15.6.0",
"query-string": "^4.3.4",
"rc-slider": "8.6.4",
Expand Down
18 changes: 7 additions & 11 deletions src/components/TeamManagement/MemberItem.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import moment from 'moment'
import {timezones} from 'appirio-tech-react-components/constants/timezones'
require('moment-timezone')
import UserTooltip from '../User/UserTooltip'
import SunIcon from '../../assets/icons/daylight.svg'
import MoonIcon from '../../assets/icons/moon.svg'
Expand All @@ -19,16 +19,12 @@ const MemberItem = (props) => {
const email = _.get(usr, 'email')
let localTime
let localTimeOffsetFormat
let timeZoneInfo
let utcOff
if(timeZone) {
timeZoneInfo = _.find(timezones, (t) => {return t.zoneName === timeZone})
// as a quick fix for https://github.com/appirio-tech/connect-app/issues/3457
// set offset for the "Daylight Saving Time"
if (timeZoneInfo.zoneName === 'America/New_York') {
timeZoneInfo.gmtOffset = -18000
}
localTime = moment().utcOffset(timeZoneInfo.gmtOffset/3600).format('h:mm a')
localTimeOffsetFormat = 'UTC' + moment().utcOffset(timeZoneInfo.gmtOffset/3600).format('Z')
const tz = moment().tz(timeZone)
localTime = tz.format('h:mm a')
utcOff = tz.utcOffset()/60
localTimeOffsetFormat = 'UTC' + moment().utcOffset(utcOff).format('Z')
}
let localTimeInfoEl = null

Expand All @@ -45,7 +41,7 @@ const MemberItem = (props) => {
localWhEnd = moment({hour: workingHourEnd.split(':')[0]}).format('h a')

if(localTime) {
let localHour = +moment().utcOffset(timeZoneInfo.gmtOffset/3600).format('H')
let localHour = +moment().utcOffset(utcOff).format('H')
const localStartHour = +moment({hour: workingHourStart.split(':')[0] }).format('H')
let localEndHour = +moment({hour: workingHourEnd.split(':')[0] }).format('H')
if(localEndHour <= localStartHour) {
Expand Down