Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useState } from 'react'
import { IconArrowRight, IconCalendar } from '@posthog/icons'
import { LemonButton, Tooltip, lemonToast } from '@posthog/lemon-ui'

import { TZLabel } from 'lib/components/TZLabel'
import { dayjs } from 'lib/dayjs'
import { LemonCalendarSelect } from 'lib/lemon-ui/LemonCalendar/LemonCalendarSelect'
import { Popover } from 'lib/lemon-ui/Popover'
Expand All @@ -20,9 +21,6 @@ function DateTrigger({ date, boundary, onChange }: DateTriggerProps): JSX.Elemen
const [isOpen, setIsOpen] = useState(false)

const label = date ? dayjs(date).format('MMM D, YYYY') : boundary === 'end' ? 'Present' : 'No date'
const tooltip = date
? `${boundary === 'start' ? 'Started' : 'Ended'} ${dayjs(date).format('MMM D, YYYY [at] h:mm A')}. Click to change.`
: undefined
const disabledReason = !date
? boundary === 'start'
? 'No start date'
Expand Down Expand Up @@ -59,11 +57,21 @@ function DateTrigger({ date, boundary, onChange }: DateTriggerProps): JSX.Elemen
size="xsmall"
sideIcon={null}
onClick={() => setIsOpen(true)}
tooltip={tooltip}
disabledReason={disabledReason}
data-attr={`experiment-${boundary}-date`}
>
{label}
{date ? (
// Hidden while the calendar is open so the two popovers do not stack.
<TZLabel
time={date}
title={boundary === 'start' ? 'Start date' : 'End date'}
visible={isOpen ? false : undefined}
>
<span>{label}</span>
</TZLabel>
) : (
label
)}
</LemonButton>
</Popover>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function RefreshButton({
icon={isRefreshing ? <Spinner textColored /> : <IconRefresh />}
onClick={onRefresh}
disabledReason={isRefreshing ? (queuedHint ?? loadingText) : undefined}
tooltip={isRefreshing ? undefined : 'Refresh results'}
aria-label={isRefreshing ? undefined : 'Refresh results'}
data-attr="refresh-experiment"
Comment thread
rodrigoi marked this conversation as resolved.
>
{isRefreshing ? (
Expand Down
Loading