THCLab / oca-ecosystem

European Union Public License 1.2
3 stars 0 forks source link

Date Display Format #13

Closed cvarjao closed 1 year ago

cvarjao commented 1 year ago

The current format overlay doesn't defined the supported format for displaying date, it currently defines as

The inputted format value for this core data type MAY be a date and time representation as defined by ISO 8601, a standard for the worldwide exchange and communication of date and time-related data.

What are the accepted output/display format tokens? YYYY, MM, MMM, MMMM, DD, etc. Should it also support any localized output format such as the one defined in Javascript/ES6: "full", "long", "medium", "short"

mitfik commented 1 year ago

ISO 8601 defines exactly what formats ("format tokens") are allowed, please check the examples here: https://en.wikipedia.org/wiki/ISO_8601 or official standard document.

If this does not answer your concern feel free to reopen that issue.

cvarjao commented 1 year ago

@mitfik , I don't think think I've got an answer to my question. Perhaps I will give a bit more background. In AnonCreds, date are provided as YYYYMMDD (also ISO8601 compliant) as opposed to the most common ISO8601 format YYYY-MM-DD.

The spec says

A Format Overlay defines an input and display format for data fields.

I think there are 2 distinctive concerns:

The spec provides the following for the Unix epoch:

Data type: DateTime
Character encoding: UTF-8 (default)
Standard: ISO 8601
Format: YYYY-MM-DDThh:mm:ssZ

If we want to represent AnonCreds DateInt Format, is that correct?

Data type: DateTime
Character encoding: UTF-8 (default)
Standard: ISO 8601
Format: YYYYMMDD
mitfik commented 1 year ago

Thanks for follow up.

Not sure if that was your intention but you raised interesting problem what if capture format is different from display format?

Format Overlay was not meant to be used for "display" purposes specifically (display I mean what human would see), yes the spec says that it is for capture and display but in a sense that how you capture it you always display it the same way is not localize for the user.

If I understood correctly your problem, you can define your format overlay as you like means you can operate under YYYMMDD using as well ISO8601 as a standard or just ditch standard and go with own format, there is no problem with that. Is up to the user which format he wants use.

I would later on follow up on the topic of the localization of the format overlay. Need to think it through. You can join as well our community chat on matrix to follow up on that discussion if needed. If above won't answer you main question feel free to provide some more examples and elaborate a bit on the problem. I understood it in a way that you are asking what format tokens you can use, the answer is ALL is up to the create of the schema to decide.

pknowl commented 1 year ago

In answer to the AnonCreds DateTime format, the following is correct:

Data type: DateTime Character encoding: UTF-8 Standard: ISO 8601 Format: YYYYMMDD