Skip to content

Commit

Permalink
feat(blog): Add Intl support for publish date
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkoOleksiyenko authored and quentinderoubaix committed Feb 26, 2024
1 parent 2d93aa3 commit 8f70950
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions demo/src/lib/layout/Published.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
export let date;
date = Intl.DateTimeFormat('en-US', {dateStyle: 'full'}).format(new Date(date));
</script>

<strong class="d-flex mb-2">Published on {date}</strong>
2 changes: 1 addition & 1 deletion demo/src/routes/blog/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const load = async () => {
menu: [
{
title: 'News 2024',
submenu: [{label: '02-01-2024 State management with Tansu', path: 'blog/2024-02-01', subpath: ''}],
submenu: [{label: 'State management with Tansu', path: 'blog/2024-02-01', subpath: ''}],
},
],
};
Expand Down
4 changes: 4 additions & 0 deletions demo/src/routes/blog/2024-02-01/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<script lang="ts">
import Header from '$lib/layout/Header.svelte';
import Published from '$lib/layout/Published.svelte';
import Markdown from '$lib/markdown/Markdown.svelte';
import source from './tansu-reactivity.md?raw';
</script>

<Header title="State management with Tansu" />
<Published date="02/01/2024" />
<Markdown {source} />
4 changes: 0 additions & 4 deletions demo/src/routes/blog/2024-02-01/tansu-reactivity.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# State management with Tansu

**Published on 02/01/2024.**

In [AgnosUI](https://amadeusitgroup.github.io/AgnosUI/latest/), we employ [Tansu](https://github.com/AmadeusITGroup/tansu) to handle our widget states.

This article explores the effective ways to use Tansu for broader state management, drawing upon our practical experience in developing AgnosUI. To follow along, we assume that you have a basic understanding of Tansu's API, as explained in the [README](https://github.com/AmadeusITGroup/tansu/blob/master/README.md) (no need to know them in detail). Feel free to refer to it for reference if needed.
Expand Down

0 comments on commit 8f70950

Please sign in to comment.