Date formats and controls
GG-CE database stores dates as Date
in the database and then uses the xxxDateCode
field to specify how the value is rendered. The set of DATE_FORMAT
codes is fixed.
The most common date format is the code for exact date MM/dd/yyyy
. Please note that the code itself is not used as for formatting the date value: we use the title
!
The UI uses moment
to format the date value to a string using YYYY-MM-DD
. This formatting is required for date pickers in browsers.
The UI must use valid DATE_FORMAT
codes when interacting with the API -- and a valid format code is usually selected by the user with <CVField
.
In a few places in UI code, the date code is specified incorrectly:
// workspaces/ui-express/src/inventorygroup/ui/AcquisitionPage.tsx
accessionSource.sourceDateCode = 'yyyy-MM-dd';
Please check the code and use a constant DATE_FORMAT_DATE = 'MM/dd/yyyy'
Also please delete data-default="yyyy-MM-dd"
. It should be provided by the user.
Note: support#45 (closed) is a result of using an invalid date format code.