@nekm/svelte-core 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/date-time.svelte +4 -10
- package/dist/date-time.svelte.d.ts +3 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/date-time.svelte
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {onMount} from "svelte";
|
|
3
2
|
import {localeFormatDate} from "./locale.js";
|
|
4
3
|
|
|
5
|
-
interface
|
|
4
|
+
export interface DateTimeProps {
|
|
6
5
|
readonly date: Date;
|
|
6
|
+
readonly locale?: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const { date }:
|
|
9
|
+
const { date, locale }: DateTimeProps = $props();
|
|
10
10
|
|
|
11
11
|
const isoString = $derived(date.toISOString());
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
onMount(() => {
|
|
15
|
-
// Want to rerun this on mount as we want to use the browser
|
|
16
|
-
// locale.
|
|
17
|
-
formatted = localeFormatDate(date);
|
|
18
|
-
})
|
|
12
|
+
const formatted = $derived(localeFormatDate(date, locale));
|
|
19
13
|
</script>
|
|
20
14
|
|
|
21
15
|
<time datetime={isoString}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
interface
|
|
1
|
+
export interface DateTimeProps {
|
|
2
2
|
readonly date: Date;
|
|
3
|
+
readonly locale?: string;
|
|
3
4
|
}
|
|
4
|
-
declare const DateTime: import("svelte").Component<
|
|
5
|
+
declare const DateTime: import("svelte").Component<DateTimeProps, {}, "">;
|
|
5
6
|
type DateTime = ReturnType<typeof DateTime>;
|
|
6
7
|
export default DateTime;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
export * from "./google-analytics.js";
|
|
1
2
|
export { default as GoogleAnalytics } from "./google-analytics.svelte";
|
|
2
3
|
export * from "./google-analytics.svelte";
|
|
3
|
-
export * from "./google-analytics.js";
|
|
4
4
|
export { default as Seo } from "./seo.svelte";
|
|
5
5
|
export * from "./seo.svelte";
|
|
6
6
|
export { default as DateTime } from "./date-time.svelte";
|
|
7
|
+
export * from "./date-time.svelte";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
export * from "./google-analytics.js";
|
|
1
2
|
export { default as GoogleAnalytics } from "./google-analytics.svelte";
|
|
2
3
|
export * from "./google-analytics.svelte";
|
|
3
|
-
export * from "./google-analytics.js";
|
|
4
4
|
export { default as Seo } from "./seo.svelte";
|
|
5
5
|
export * from "./seo.svelte";
|
|
6
6
|
export { default as DateTime } from "./date-time.svelte";
|
|
7
|
+
export * from "./date-time.svelte";
|
package/package.json
CHANGED