@@ -1637,11 +1637,14 @@ const packageAnomalies = computed(() => getAnomaliesForPackages(effectivePackage
16371637const hasAnomalies = computed (() => packageAnomalies .value .length > 0 )
16381638
16391639function formatAnomalyDate(dateStr : string ) {
1640- return new Date (dateStr ).toLocaleDateString (locale .value , {
1640+ const [y, m, d] = dateStr .split (' -' ).map (Number )
1641+ if (! y || ! m || ! d ) return dateStr
1642+ return new Intl .DateTimeFormat (locale .value , {
16411643 year: ' numeric' ,
16421644 month: ' short' ,
16431645 day: ' numeric' ,
1644- })
1646+ timeZone: ' UTC' ,
1647+ }).format (new Date (Date .UTC (y , m - 1 , d )))
16451648}
16461649
16471650// Trigger data loading when the metric is switched
@@ -1781,7 +1784,11 @@ watch(selectedMetric, value => {
17811784 >
17821785 {{ $t('package.trends.known_anomalies') }}
17831786 <TooltipApp interactive :to =" inModal ? '#chart-modal' : undefined" >
1784- <span class =" i-lucide:info w-3.5 h-3.5 text-fg-muted cursor-help" tabindex =" 0" />
1787+ <button
1788+ type =" button"
1789+ class =" i-lucide:info w-3.5 h-3.5 text-fg-muted cursor-help"
1790+ :aria-label =" $t('package.trends.known_anomalies')"
1791+ />
17851792 <template #content >
17861793 <div class =" flex flex-col gap-3" >
17871794 <p class =" text-xs text-fg-muted" >
@@ -1794,16 +1801,22 @@ watch(selectedMetric, value => {
17941801 <ul class =" text-xs text-fg-subtle list-disc list-inside" >
17951802 <li v-for =" a in packageAnomalies" :key =" `${a.packageName}-${a.start}`" >
17961803 {{
1797- $t('package.trends.known_anomalies_range', {
1798- start: formatAnomalyDate(a.start),
1799- end: formatAnomalyDate(a.end),
1800- })
1804+ isMultiPackageMode
1805+ ? $t('package.trends.known_anomalies_range_named', {
1806+ packageName: a.packageName,
1807+ start: formatAnomalyDate(a.start),
1808+ end: formatAnomalyDate(a.end),
1809+ })
1810+ : $t('package.trends.known_anomalies_range', {
1811+ start: formatAnomalyDate(a.start),
1812+ end: formatAnomalyDate(a.end),
1813+ })
18011814 }}
18021815 </li >
18031816 </ul >
18041817 </div >
18051818 <p v-else class =" text-xs text-fg-muted" >
1806- {{ $t('package.trends.known_anomalies_none') }}
1819+ {{ $t('package.trends.known_anomalies_none', effectivePackageNames.length ) }}
18071820 </p >
18081821 <div class =" flex justify-end" >
18091822 <LinkBase
0 commit comments