-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dates with a year from 1 to 100 are returned as 19xx #1570
Comments
@sla100 Thank you for reporting this. We will need to look into this behavior and ascertain if this default (buggy?) behavior of Date constructor has been used by other users. |
Hi. IMHO |
Thanks for explaining, @sla100. |
@sla100 We are doing some extensive testing on this issue. When we tested, a lot of additional test scenarios/questions are popping up.
Would love to hear your thoughts! Thanks! |
My opinion may be unpopular :). For me, the DATE type in Oracle is a collection of six numbers. This is how it is saved in the records and transmitted through the network to the client. The interpretation of these values may be highly context dependent and may not even be "point in time" directly. For example let's considet that designer specifies that the field is called "RETURN DATE" and the rules say that the goods can be returned by the end of working hours of a given store. So I would like the converter to be able to get this tuple of numbers instead of the oracledb.fetchTypeHandler = ({dbType}) => {
if (dbType === oracledb.DB_TYPE_DATE) {
return {
parseType: oracledb.RAW,
converter: ({year, mont, day}) => `${year}-${month}-${day}`, // ISO string, Temporal constructor etc.
};
}
}; |
Thanks @sla100 for the explanation of the date requirements. |
6.0.0
error
Dates with a year from 1 to 100 are returned as 19xx
The reason is related to the behavior of the Date constructor.
Patch for
_makeDate
method inlib/settings.js
:The text was updated successfully, but these errors were encountered: