-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add name
prop
#44
Comments
It's been brought up a few times. I think the way it would have to be implemented is to create a fake input element with the |
Can't it just use the time format already chosen? Personally I always use yyyy-MM-dd as it's also the format och default html date inputs :) My current solution look like this, works fine but feels a bit meh :P <script lang="ts">
import { DateInput } from 'date-picker-svelte'
let date = new Date()
export let name: string
$: newDate = date?.toLocaleString('sv', { timeZone: 'Europe/Stockholm' }).slice(0, 10)
</script>
<input type="text" id="dateFrom" {name} bind:value={newDate} style="display:none" />
<DateInput bind:value={date} format="yyyy-MM-dd" closeOnSelection={true} placeholder={''} /> |
I'd want to support it for the Some people might want to include the hours/minutes/seconds/milliseconds too. I'm leaning towards using unix timestamps, and having people create custom input elements if they need a different format |
I've had a read through the linked issues. It looks like some standard HTML attributes can be passed in, but still not yet the This would be an awesome feature to implement, as I'd like to be able to use it with Svelte form actions (which needs the |
I´m using your datepicker and it's really awesome. However, one thing I dont understand is how to put the datepicker in a form and set a name for it so it will be passed together with a form submit? Right now i created a normal input field that i hide with css and just bind that value together with the datepickers value but it would for sure be cool to just be able to add a name attribute to the Datepicker itself? Is it possible to do already or?
The text was updated successfully, but these errors were encountered: