From 7f9164538ff11567fc6f218d6ab31a301d37fffe Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Thu, 14 Nov 2024 12:12:18 +0700 Subject: [PATCH] Some time SEO goodness --- assets/js/components/time.tsx | 23 +++++++++++-------- .../templates/circles/_event_card.html | 4 +++- .../templates/circles/_event_detail_card.html | 8 ++++++- totem/circles/templates/circles/detail.html | 1 + 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/assets/js/components/time.tsx b/assets/js/components/time.tsx index 249776fd..801c86b7 100644 --- a/assets/js/components/time.tsx +++ b/assets/js/components/time.tsx @@ -1,20 +1,27 @@ -import { JSXElement, Match, Switch } from "solid-js" +import { type JSXElement, Match, Switch, mergeProps } from "solid-js" type TimeFormat = "short" | "at" +const defaults = { + time: "", + format: "short", + className: "", +} + function Time(props: { time?: string format?: TimeFormat className?: string children?: JSXElement }) { + const _props = mergeProps(defaults, props) const time = () => { - return new Date(props.time!) + return new Date(_props.time) } return ( -