mirror of
https://github.com/CompeyDev/blog.devcomp.xyz.git
synced 2024-12-12 04:40:41 +00:00
Update DateTime formatting in metadata
This commit is contained in:
parent
b211c70f47
commit
16fec99b5b
4 changed files with 9 additions and 5 deletions
|
@ -24,8 +24,8 @@ const links: NavBarLink[] = navBarConfig.links.map(
|
|||
"card-base sticky top-0 overflow-visible max-w-[var(--page-width)] h-[4.5rem] rounded-t-none mx-auto flex items-center justify-between px-4"]}>
|
||||
<a href={url('/')} class="btn-plain scale-animation rounded-lg h-[3.25rem] px-5 font-bold active:scale-95">
|
||||
<div class="flex flex-row text-[var(--primary)] items-center text-md">
|
||||
<Icon name="material-symbols:home-outline-rounded" size={"1.75rem"} class="mb-1 mr-2" />
|
||||
{siteConfig.title}
|
||||
<Icon name="material-symbols:favorite-outline-rounded" size={"1.75rem"} class="mb-1 mr-2" />
|
||||
<!-- {siteConfig.title} -->
|
||||
</div>
|
||||
</a>
|
||||
<div class="hidden md:flex">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { Icon } from "astro-icon/components";
|
||||
import I18nKey from "../i18n/i18nKey";
|
||||
import { i18n } from "../i18n/translation";
|
||||
import { formatDateToYYYYMMDD } from "../utils/date-utils";
|
||||
import { formatDateToWords } from "../utils/date-utils";
|
||||
import { url } from "../utils/url-utils";
|
||||
|
||||
interface Props {
|
||||
|
@ -23,7 +23,7 @@ const className = Astro.props.class;
|
|||
>
|
||||
<Icon name="material-symbols:calendar-today-outline-rounded" class="text-xl"></Icon>
|
||||
</div>
|
||||
<span class="text-50 text-sm font-medium">{formatDateToYYYYMMDD(published)}</span>
|
||||
<span title={published.toTimeString()} class="text-50 text-sm font-medium">{formatDateToWords(published)}</span>
|
||||
</div>
|
||||
|
||||
<!-- categories -->
|
||||
|
|
|
@ -86,7 +86,7 @@ The Luau community has developed many libraries to make JavaScript developers fe
|
|||
4. ::github{repo="seaofvoices/luau-path"}
|
||||
5. ::github{repo="nicell/lynx"}
|
||||
|
||||
…And many more which I haven't listed here!
|
||||
…and many more which I haven't listed here!
|
||||
|
||||
:::note
|
||||
It isn't currently possible for create websites using react-lua, it is currently only used for
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
export function formatDateToYYYYMMDD(date: Date): string {
|
||||
return date.toISOString().substring(0, 10);
|
||||
}
|
||||
|
||||
export function formatDateToWords(date: Date): string {
|
||||
return date.toUTCString().substring(0, 16);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue