Skip to content

Commit 027f5f3

Browse files
committed
fix: add dates in filenames #223
1 parent 81104cf commit 027f5f3

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

app/components/PackageDownloadAnalytics.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,17 +458,26 @@ const config = computed(() => ({
458458
},
459459
callbacks: {
460460
img: ({ imageUri }: { imageUri: string }) => {
461-
loadFile(imageUri, `${packageName}-${selectedGranularity.value}.png`)
461+
loadFile(
462+
imageUri,
463+
`${packageName}-${selectedGranularity.value}_${startDate.value}_${endDate.value}.png`,
464+
)
462465
},
463466
csv: (csvStr: string) => {
464467
const blob = new Blob([csvStr.replace('data:text/csv;charset=utf-8,', '')])
465468
const url = URL.createObjectURL(blob)
466-
loadFile(url, `${packageName}-${selectedGranularity.value}.csv`)
469+
loadFile(
470+
url,
471+
`${packageName}-${selectedGranularity.value}_${startDate.value}_${endDate.value}.csv`,
472+
)
467473
URL.revokeObjectURL(url)
468474
},
469475
svg: ({ blob }: { blob: Blob }) => {
470476
const url = URL.createObjectURL(blob)
471-
loadFile(url, `${packageName}-${selectedGranularity.value}.svg`)
477+
loadFile(
478+
url,
479+
`${packageName}-${selectedGranularity.value}_${startDate.value}_${endDate.value}.svg`,
480+
)
472481
URL.revokeObjectURL(url)
473482
},
474483
},

0 commit comments

Comments
 (0)