Skip to content

Commit

Permalink
fix: releaseDate relocated
Browse files Browse the repository at this point in the history
Signed-off-by: zubairrafi <[email protected]>
  • Loading branch information
walleeva2018 committed Aug 4, 2024
1 parent e285d1a commit 669b2ca
Show file tree
Hide file tree
Showing 2 changed files with 17,128 additions and 12 deletions.
23 changes: 11 additions & 12 deletions components/iso-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
class="relative object-cover h-[180px]"
/>
</figure>
<div
v-if="dateFromLink!=='' && showDetails"
class="absolute right-2 bg-primary text-primary-content text-xs font-semibold px-2 py-1 rounded-full shadow-md"
>
{{ dateFromLink || '-' }}
</div>
<div
v-if="!showDetails"
class="card-body"
>
<h2 class="card-title">
{{ desktopData.name }}
<span
v-if="isoData.image && extractDateFromLink(isoData.image) !== 'Date not found in the link.'"
class="ml-2 px-2 py-1 text-xs font-semibold rounded-full bg-primary text-primary-content"
>
{{ extractDateFromLink(isoData.image) }}
</span>
</h2>
<p>{{ desktopData.description }}</p>
<div class="flex flex-row mt-4 card-actions">
Expand All @@ -47,6 +47,7 @@
<h2 class="card-title">
{{ desktopData.name }}
</h2>

<p class="flex justify-center pb-2">
<span class="grid grid-cols-1 self-center gap-8 pt-2">
<div
Expand Down Expand Up @@ -139,6 +140,7 @@ function getDownloadLink() {
const showDetailsRef = ref(props.showDetails)
const fullImage = ref(true)
const dateFromLink = ref('')
const enableDetails = () => {
showDetailsRef.value = true
Expand All @@ -163,9 +165,9 @@ const getDetailEntry = (entry: string) => {
return props.isoData[entry]
}
function extractDateFromLink(link: string): string {
if (props.isoData?.image) {
const datePattern = /(\d{6})/
const match = link.match(datePattern)
const match = props.isoData.image.match(datePattern)
if (match) {
const dateStr = match[1]
Expand All @@ -181,10 +183,7 @@ function extractDateFromLink(link: string): string {
day: 'numeric',
}
return dateObj.toLocaleDateString(undefined, options)
}
else {
return 'Date not found in the link.'
dateFromLink.value = dateObj.toLocaleDateString(undefined, options)
}
}
</script>
Loading

0 comments on commit 669b2ca

Please sign in to comment.