Skip to content

Commit

Permalink
update skills & date formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Hatchibombotar committed Mar 3, 2024
1 parent 8cf5fa9 commit ed3a851
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
33 changes: 17 additions & 16 deletions src/data/skills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
SiTailwindcss,
SiAstro,
SiSass,
SiGo,
} from "solid-icons/si";
const SolidIcon = "/assets/icon/solidIcon.svg";
const MCIcon = "/assets/icon/minecraft.svg";
Expand All @@ -19,35 +20,29 @@ export default [
colour: "#3178c6",
},
{
name: "Tailwind CSS",
level: "Expert",
icon: SiTailwindcss,
colour: "#38bdf8",
name: "JavaScript",
level: "Advanced",
icon: SiJavascript,
colour: "#FBD569",
},
{
name: "Go",
level: "",
icon: SiGo,
colour: "#007d9c",
},
{
name: "Astro",
level: "Expert",
icon: SiAstro,
colour: "#ff5d00",
},
{
name: "SASS",
level: "Expert",
icon: SiSass,
colour: "#c76494",
},
{
name: "Solid JS",
level: "Intermediate",
iconType: "image",
icon: SolidIcon,
},
{
name: "JavaScript",
level: "Advanced",
icon: SiJavascript,
colour: "#FBD569",
},
{
name: "HTML",
level: "Advanced",
Expand All @@ -60,6 +55,12 @@ export default [
icon: SiCss3,
colour: "#51A4EE",
},
{
name: "Tailwind CSS",
level: "Expert",
icon: SiTailwindcss,
colour: "#38bdf8",
},
{
name: "Python",
level: "Intermediate",
Expand Down
4 changes: 3 additions & 1 deletion src/pages/minecraft.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
import SubLayout from "../layouts/SubLayout.astro";
import {formatDate} from "../utils"
type Submissions = {
data: {
title: string
Expand Down Expand Up @@ -84,7 +86,7 @@ const mcpedl_submissions = (await (async () => {
{title}
</h2>
<p class="text-xs text-neutral-700">
{new Date(update_date != "0" ? update_date : publish_date).toDateString()}
{formatDate(new Date(update_date != "0" ? update_date : publish_date).toDateString())}
</p>
</a>
)
Expand Down
19 changes: 19 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const MONTH_TEXT = [
"Jan",
"Feb",
"March",
"April",
"May",
"June",
"July",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
]

export function formatDate(date_input: Date | string) {
const date = new Date(date_input)
return `${date.getDate()} ${MONTH_TEXT[date.getMonth()]}, ${date.getFullYear()}`
}

0 comments on commit ed3a851

Please sign in to comment.