Bug report #16657
date edit widget only shows current date whatever the real data is underneath
|Affected QGIS version:||2.18.9||Regression?:||Yes|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||24557|
it seems a regression since 2.18.3, date edit widget will only show the current date in a form, even without any default value set or being readonly.
This makes it pretty unusable.
I had hard time spotting it since another issue with qlr export #16655 let me think that only my project was corrupted.
#2 Updated by Regis Haubourg about 4 years ago
- File date_default_issue.gpkg added
That's a datetime field - I think the issue is that you've set the format to "date" along. Does it work correctly if you change that to "date/time"?
Nope, I tested many widget configuration changes before. Only setting it back to textEdit allowed me to see the actual data.
What data provider is this?
Original issue was detected in postgres with a view with edit triggers pointing to a table with a "timestamp with time zone" field.
can you share the data?
Oh, I joined the wrong file. Here is a gpkg file going with the date_default_widget_value_issue.qgs file
#5 Updated by Denis Rouzaud almost 4 years ago
using yyyy-MM-dd HH:mm:ss+02 in the format solves the diplay issue.
The field format must be set accordingly to what is in the data, so it's not really a bug here.
Although I tried yyyy-MM-dd HH:mm:ss+t (time zone) without success. So there might be an issue here.
#12 Updated by Luigi Pirelli almost 4 years ago
error is probably only located in setting the correct format string here:
btw Qt:ISODate formate parse correctly the proposed date.