CustomField datetime limited on dates (cannot set a year before 2014)
Closed this issue · 1 comments
Describe the bug
In the ADMIN UI, users are unable to modify a birth date to any year before 2014 on custofields datetime. Attempting to set a date earlier than 2014is not possible
To Reproduce
Create this custom field:
{
"name": "lastLoginDate",
"nullable": true,
"type": "datetime",
"label": [
{"languageCode": "LanguageCode.it", "value": "Data ultimo login"},
{"languageCode": "LanguageCode.en", "value": "Last login date"}
]
}
Expected behavior
It is expected that administrators should be able to update the birth date to any valid date, including years prior to 2014.
Environment (please complete the following information):
@vendure/core version: 2.2.4
Nodejs version: 20
Database (mysql/postgres etc): postgres
Hi,
This is possible to configure by setting the min
property on the custom field definition. For instance:
{
"name": "lastLoginDate",
"nullable": true,
"type": "datetime",
"label": [
{"languageCode": "LanguageCode.it", "value": "Data ultimo login"},
{"languageCode": "LanguageCode.en", "value": "Last login date"}
],
"min": "1990-01-01T00:00:00.000Z",
}
will allow you to go back to 1990:
You can find the docs on this here: https://docs.vendure.io/guides/developer-guide/custom-fields/#properties-for-datetime-fields