Browse Source

fix(ui): Show timezone with 24hr clock event info on issue details (#32611)

When a user has the 24 hour clock set, the date/time of the event on the issue details page didn't display the timezone. This adds the timezone.

FIXES WOR-739
Kelly Carino 3 years ago
parent
commit
80cf80c706
1 changed files with 7 additions and 1 deletions
  1. 7 1
      static/app/views/organizationGroupDetails/eventToolbar.tsx

+ 7 - 1
static/app/views/organizationGroupDetails/eventToolbar.tsx

@@ -17,6 +17,7 @@ import space from 'sentry/styles/space';
 import {Group, Organization, Project} from 'sentry/types';
 import {Event} from 'sentry/types/event';
 import {trackAnalyticsEvent} from 'sentry/utils/analytics';
+import {use24Hours} from 'sentry/utils/dates';
 import getDynamicText from 'sentry/utils/getDynamicText';
 
 import QuickTrace from './quickTrace';
@@ -97,6 +98,7 @@ class GroupEventToolbar extends Component<Props> {
   }
 
   render() {
+    const is24Hours = use24Hours();
     const evt = this.props.event;
 
     const {group, organization, location, project} = this.props;
@@ -137,7 +139,11 @@ class GroupEventToolbar extends Component<Props> {
         </Heading>
         <Tooltip title={this.getDateTooltip()} disableForVisualTest>
           <StyledDateTime
-            date={getDynamicText({value: evt.dateCreated, fixed: 'Dummy timestamp'})}
+            format={is24Hours ? 'MMM D, YYYY HH:mm:ss zz' : 'll LTS z'}
+            date={getDynamicText({
+              value: evt.dateCreated,
+              fixed: 'Dummy timestamp',
+            })}
           />
           {isOverLatencyThreshold && <StyledIconWarning color="yellow300" />}
         </Tooltip>