IQSS / dataverse-client-javascript

A Dataverse client for JavaScript and TypeScript
MIT License
15 stars 8 forks source link

Fix date format validation in create/edit dataset use cases #157

Closed GPortas closed 2 months ago

GPortas commented 3 months ago

Overview of the feature request

Not all metadata fields of all metadata blocks expect a date in the YYYY-MM-DD format. There are metadata fields that expect other date formats, defined by the watermark.

For example, the journalPubDate field also accepts YYYY or YYYY-MM, and currently if these formats are added, js-dataverse returns the following error:

There was an error when validating the field journalPubDate from metadata block journal with parent field journalVolumeIssue in position 0. Reason was: The field requires a valid date format (YYYY-MM-DD).

Fix this to support the formats provided by the watermark field.

What inspired the request?

Edit dataset use case integration

What existing behavior do you want changed?

Edit and create dataset validations

Any brand new behavior do you want to add to js-dataverse?

None

Any open or closed issues related to this feature request?

None