I have a bureaucracy form with a date picker that I use with Pagemod to add records to a table.
action pagemod _self custom_check
date "Date of check" "=@YEAR@-@MONTH@-@DAY@" !
In most cases the form will be completed on the day of the event being recorded so it would save a few clicks if the date field was populated with todays date. Previously I'd used this code
<pagemod _self_before>| @@auto_inc@@| @@meta.date@@ | @@meta.user.name@@ |@@Check Description@@ | @@Check Result@@ |@@Check notes@@ |
But this doesn't allow the user to put in a check for a different date so I now use this in conjunction with the form with the fields shown in code block one above.
<pagemod _self_before>| @@auto_inc@@| @@Date of check@@ | @@meta.user.name@@ |@@Check Description@@ | @@Check Result@@ |@@Check notes@@ |
When using a date field in bureaucracy and providing a default value as in the first code block above I get the right value in the field when the page loads but the field is highlighted in red and there is an error at the top of the page saying
"Date of check" needs to be a valid date in the format yyyy-mm-dd.
the date in the box is in the right format both in the form before submission and in the table after submission.
I'd previously had a similar issue back in 2016 but there were no responses to that.
I'm hoping someone can help this time...