Skip to content

Commit

Permalink
fix: linting resolved
Browse files Browse the repository at this point in the history
Signed-off-by: zubairrafi <[email protected]>
  • Loading branch information
walleeva2018 committed Aug 3, 2024
1 parent a07cd94 commit 1c10f0a
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions components/iso-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class="card-body"
>
<h2 class="card-title">
{{ desktopData.name }}
<span
{{ 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"
>
Expand Down Expand Up @@ -126,8 +126,8 @@ const props = defineProps({
desktopId: { type: String, required: true },
desktopData: { type: Object, required: true },
isoData: { type: Object, required: true },
showDetails: { type: Boolean, required: true } },
)
showDetails: { type: Boolean, required: true },
})
const emit = defineEmits(['details-toggled'])
function getDownloadLink() {
Expand Down Expand Up @@ -164,26 +164,27 @@ const getDetailEntry = (entry: string) => {
}
function extractDateFromLink(link: string): string {
const datePattern = /(\d{6})/;
const match = link.match(datePattern);
const datePattern = /(\d{6})/
const match = link.match(datePattern)
if (match) {
const dateStr = match[1];
const year = parseInt(dateStr.slice(0, 2), 10);
const month = parseInt(dateStr.slice(2, 4), 10) - 1;
const day = parseInt(dateStr.slice(4, 6), 10);
const dateStr = match[1]
const year = parseInt(dateStr.slice(0, 2), 10)
const month = parseInt(dateStr.slice(2, 4), 10) - 1
const day = parseInt(dateStr.slice(4, 6), 10)
const dateObj = new Date(2000 + year, month, day);
const dateObj = new Date(2000 + year, month, day)
const options: Intl.DateTimeFormatOptions = {
year: 'numeric',
month: 'long',
day: 'numeric'
};
const options: Intl.DateTimeFormatOptions = {
year: 'numeric',
month: 'long',
day: 'numeric',
}
return dateObj.toLocaleDateString(undefined, options);
} else {
return "Date not found in the link.";
return dateObj.toLocaleDateString(undefined, options)
}
else {
return 'Date not found in the link.'
}
}
</script>

0 comments on commit 1c10f0a

Please sign in to comment.