Skip to content

Commit ffa2274

Browse files
committed
[flowbite] Fix local date parsing
1 parent 615c5b6 commit ffa2274

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/flowbite-theme/src/lib/widgets/text-widget.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
66
let { value = $bindable(), attributes }: WidgetProps<'text'> = $props();
77
8+
function parseLocalDate(date: string) {
9+
const [year, month, day] = date.split('-').map(Number);
10+
return new Date(year, month - 1, day);
11+
}
12+
813
const date = {
914
get value() {
10-
return value ? new Date(value) : null;
15+
return value ? parseLocalDate(value) : null;
1116
},
1217
set value(v) {
1318
if (attributes.readonly) {

0 commit comments

Comments
 (0)