Table Builder - TextInput Column - Date Picker as content
Hello there,
I would like to know if it would be possible to have a datepicker input created inside the text input column, checked the docs but couldn't find information related to that.
Thanks 😄
13 Replies
So you want two fields, a DatePicker and a TextInput, and when you select a date you want it entered into the TextInput?
Thank you for the reply!
Nope, I want only 1 field, the column is supposed to be have rows where the user can select a date, it's only a date picker but I am facing issues to use it inside the table builder
it'll be a native date time picker, don't think you'd be able to use the custom filament one in the table.
Thank you for the reply!
Just tested that, it solves the issue but using that I need to format the input, I will try to find more info about that 😅
Can you explain what you mean by "format the input"?
The default format is "mm/dd/yyyy" and I would need the format to always be "dd/mm/yyyy"
So you need to modify the state after the user selects a date, before it gets written to the database?
I managed to set the update and data is being properly modified, the issue now is only what is being displayed to the user
Yeah, afaik the datetime-local is always going to use the user's locale setting, so whatever format theior browser / OS uses.
Yep, thanks, that's why I would like to use the custom date picker from filament, tried a lot of stuff here without any success... not even close 😅
It'll be tough. The real solution would be to add a DatePickerColumn to Filament, either as a PR on core or as a plugin, which operates on actual date(time) columns.
I do see a need for that, and usually I'm up for implementing things like that just for fun. But I hate coding date related stuff with a burning passion. Spent waaaaaay to much of my life fighting with date code.
Date code is always painfull... I am totally lost here, I have more experience with front-end stuff and making progress really slowly
Datetime-local should be fine since it compensates the user’s preference. Meaning the format would be what’s appropriate for them.
It gets tough though when trying to do everything the form fields can do in a table column. That’s why you can’t just drop a TextInput in there.
A PR could be good though if you can get it to work. I’m betting there’s a reason it doesn’t exist already though, but Dan would have to answer that.