I’m using Strapi to power an API and have a content type with a datetime field named PostedAt.
I’m having trouble figuring out how to get this field to let the user input hours, minutes, AND seconds.
I found one page that mentioned updating this file extensions/content-manager/admin/src/utils/dateFormat.js
So I changed datetime to this format datetime: ‘dddd, MMMM Do YYYY HH:mm:ss’ in it, but unfortunately this had no affect after a rebuild. The API returns a full datetime, including seconds so this should be possible I would think.
Looking at the UI for the content type the time input box is type=text and step=30, and it will let me type in minutes that aren’t a 30, i.e. 14:07 for 2pm ET, but won’t let me enter 14:07:44.
Thanks in advance!
Update: Still having trouble getting it to work with seconds, but tracked it down some more.
The input box is coming from buffetjs, which does support seconds after looking into the TimePicker/index.js file. It’s a bool that gets passed into the props.
So as a test, before I went much further, I located this file node_modules/strapi-plugin-content-manager/admin/src/components/FilterPickerOption/Input.js which seems to be what loads the buffet component. Tried hardcoding seconds=true into the component call and rebuilding, and still nothing. Went a step further and put this file into my extensions… folder and rebuilt again, still didn’t affect anything. I’m kind of stumped.
Original post on github discussions: https://github.com/strapi/strapi/discussions/8302