Hi people!!
What I’m trying to do:
I have a customer table with a DateBirth (FechaNacimiento) column of type date. I used the Date Picker component. I entered “%d/%m/%Y” in the format property, but the data isn’t saved in that column. Also, when retrieving the data, the field isn’t populated. I need the date format to be dd/mm/yyyy. Can someone explain how to do this?
Clone link:
share a copy of your app
Welcome to the forum!
On the date picker component, you’ve used data binding on the pick_time property. That’s a True/False property, not something that can be set to a date. You need to use data binding on the date property instead.
1 Like
Thanks for your response. The component property is called “date.” I created the data binding, and it fetched the date from the table when I requested a data update. However, when I saved it in Python, it tells me the column is a date type:
“anvil.tables.TableError: Column ‘FechaNacimiento’ is a date - cannot set it to a datetime”
Could you please explain this in more detail?
It’s as the error says. That column is a date type so it can’t old a datetime. Either make the column a datetime data type (if you care about the time) or uncheck the pick time property of the date picker so it gives you a date instead.
Well, I’ve already solved the error in the date, the solution was to configure the component properties, Date Picker, the pick_time property is false, the link to the table is in the “date” property, and the format in “format” is ‘%d/%m/%a’,