Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One day behind/ahead #62

Open
shadowempire123 opened this issue Sep 21, 2022 · 2 comments
Open

One day behind/ahead #62

shadowempire123 opened this issue Sep 21, 2022 · 2 comments

Comments

@shadowempire123
Copy link

shadowempire123 commented Sep 21, 2022

image


</script>
        import DatePicker from '@beyonk/svelte-datepicker/src/components/DatePicker.svelte'
	let selected
	let selected2
</script>

<main>
	<DatePicker range={true} time={true} on:range-selected={(e) => (selected = e.detail)} />
	<DatePicker range={false} bind:selected={selected2} on:range-selected={(e) => (selected = e.detail)} />
        <br />
	{JSON.stringify(selected)} <br />
	{JSON.stringify(selected2)}
</main>

fixed it with:
$: selected2 = dayjs(selected2).add(1, 'day').toString() // fix 1 day offset

@shadowempire123
Copy link
Author

and time is offset 2 hours...

@voneiden
Copy link

Z means UTC time.

I'm assuming you were locally UTC+2 when you made this issue? In that case the behaviour is correct - 2022-08-31T22:00:00.000Z is equivalent to 2022-09-01T00:00:000+02:00.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants