Skip to content

Commit 2283bc9

Browse files
adding date to job offers
1 parent 63b2f0e commit 2283bc9

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/components/jobs/jobCard.astro

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22
import profileCategories from "../../data/profileCategories.json";
33
import jobsCategories from "../../data/jobsCategories.json";
44
import JobCardCategory from "./jobCardCategory.astro";
5+
import dayjs from "dayjs";
56
67
const { job } = Astro.props;
78
const jobUrl = `/empleos/${job.pubDate}/${job.slug}`;
89
910
const locationLabel = job.location ? job.location : "Presencial";
11+
const display_date = dayjs(job.pubDate).format("DD/MM/YY");
1012
---
1113

12-
<div class="inline-flex items-center w-full p-4 pb-1 md:pb-2 text-gray-500 dark:text-gray-100 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg">
14+
<div class="inline-grid items-center w-full p-4 pb-1 md:pb-2 text-gray-500 dark:text-gray-100 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg">
1315
<div class="ml-2 inline-grid">
1416
<a href={jobUrl} class="w-full text-base md:text:lg text-gray-800 dark:text-gray-300 font-semibold line-clamp-2 md:line-clamp-1"
1517
>{job.title}</a
1618
>
1719
<a href={jobUrl} class="w-full my-2 text-sm md:text:base text-gray-600 dark:text-gray-300 line-clamp-3 md:line-clamp-2">{job.description}</a
1820
>
1921
<div
20-
class="flex categories flex-wrap -ml-2 justify-center md:justify-start border-t pt-2 mt-2 md:border-none md:pt-0 md:mt-0"
22+
class="flex categories w-full flex-wrap -ml-2 justify-center md:justify-start border-t pt-2 mt-2 md:border-none md:pt-0 md:mt-0"
2123
>
2224
{
2325
job.salary && (
@@ -96,13 +98,18 @@ const locationLabel = job.location ? job.location : "Presencial";
9698
</>
9799
))
98100
}
99-
</div>
100-
<div class="mt-1 flex flex-wrap"></div>
101-
</div>
101+
<div class="grow"></div>
102+
<div class="opacity-70 flex items-center mr-2 px-2 py-1 rounded">
103+
<img src={`/assets/img/icons/event-date.svg`} class="w-4 h-4 inline dark:invert dark:contrast-200 dark:saturate-0" />
104+
<p class="ml-1 text-xs md:text-sm dark:text-gray-100">{display_date}</p>
105+
</div>
106+
</div>
107+
<div class="mt-1 flex flex-wrap"></div>
108+
</div>
102109
</div>
103110

104111
<style>
105-
.categories div:last-child {
112+
.categories div:nth-last-child(3) {
106113
display: none;
107114
}
108115
</style>

0 commit comments

Comments
 (0)