Skip to content

Commit cce4d42

Browse files
committed
Add a DATETIME example to fluent-react's hello-world
1 parent a29432e commit cce4d42

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

fluent-react/examples/hello-world/src/App.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ export default function App() {
77
<Localized id="title">
88
<h1>Hello, world!</h1>
99
</Localized>
10+
<Localized id='today-is' $date={new Date()}>
11+
<p>
12+
{'Today is { DATETIME($date, month: "long", day: "numeric") }.'}
13+
</p>
14+
</Localized>
1015
</div>
1116
);
1217
}

fluent-react/examples/hello-world/src/l10n.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import { negotiateLanguages } from 'fluent-langneg';
55
const MESSAGES_ALL = {
66
'pl': `
77
title = Witaj świecie!
8+
today-is = Dziś jest { DATETIME($date, month: "long", day: "numeric") }.
89
`,
910
'en-US': `
1011
title = Hello, world!
12+
today-is = Today is { DATETIME($date, month: "long", day: "numeric") }.
1113
`,
1214
};
1315

0 commit comments

Comments
 (0)