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
6 changes: 4 additions & 2 deletions app/components/Package/TrendsChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type {
WeeklyDataPoint,
YearlyDataPoint,
} from '~/types/chart'
import { DATE_INPUT_MAX } from '~/utils/input'

const props = withDefaults(
defineProps<{
Expand Down Expand Up @@ -1452,6 +1453,7 @@ watch(selectedMetric, value => {
v-if="showFacetSelector"
id="trends-metric-select"
v-model="selectedMetric"
:disabled="activeMetricState.pending"
:items="METRICS.map(m => ({ label: m.label, value: m.id }))"
:label="$t('package.trends.facet')"
/>
Expand Down Expand Up @@ -1485,8 +1487,8 @@ watch(selectedMetric, value => {
<InputBase
id="startDate"
v-model="startDate"
:disabled="activeMetricState.pending"
type="date"
:max="DATE_INPUT_MAX"
class="w-full min-w-0 bg-transparent ps-7"
size="medium"
/>
Expand All @@ -1505,8 +1507,8 @@ watch(selectedMetric, value => {
<InputBase
id="endDate"
v-model="endDate"
:disabled="activeMetricState.pending"
type="date"
:max="DATE_INPUT_MAX"
class="w-full min-w-0 bg-transparent ps-7"
size="medium"
/>
Expand Down
2 changes: 2 additions & 0 deletions app/utils/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ export function isKeyWithoutModifiers(event: KeyboardEvent, key: string): boolea
!event.shiftKey
)
}

export const DATE_INPUT_MAX = '9999-12-31'
Loading