Skip to content
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

Is the Date parsing fix in the current pg release? #138

Closed
jcamato opened this issue Jun 16, 2022 · 1 comment
Closed

Is the Date parsing fix in the current pg release? #138

jcamato opened this issue Jun 16, 2022 · 1 comment

Comments

@jcamato
Copy link

jcamato commented Jun 16, 2022

I found #50 because I noticed my Postgres DATE columns were returning as 'yyyy-MM-ddThh:mm:ss.mssZ' instead of 'yyyy-MM-dd'. It looks like the fix #121 by @ianwalter was merged almost two years ago, but I am still encountering this date parsing issue on pg 8.7.3 and node 14.18.3.

Currently I am using the workaround mentioned in the first issue

// Prevent node-postgres from converting Postgres DATE type
pg.types.setTypeParser(1082, function (value) {
  return value;
});
@bendrucker
Copy link
Collaborator

pg no but this package yes. If you'd like to discuss upgrading the types in a pg release you can open an issue there or a PR.

Leitsi added a commit to HSLdevcom/jore4-hasura that referenced this issue Feb 27, 2023
…ne for luxon

Merely adding the luxon default timezone was not quite enough:
broke on CI, which uses utc -> pg returned JS dates in UTC
(DB itself returns them as YYYY-MM-DD strings)
which did not match luxon dates they were compared with.

Now all luxon objects are in Finland timezone,
and tests still work no matter what timezone the runner is.

Some related links:
knex/knex#3071
https://node-postgres.com/features/types#date--timestamp--timestamptz
brianc/node-pg-types#138
Leitsi added a commit to HSLdevcom/jore4-hasura that referenced this issue Feb 28, 2023
…ne for luxon

Merely adding the luxon default timezone was not quite enough:
broke on CI, which uses utc -> pg returned JS dates in UTC
(DB itself returns them as YYYY-MM-DD strings)
which did not match luxon dates they were compared with.

Now all luxon objects are in Finland timezone,
and tests still work no matter what timezone the runner is.

Some related links:
knex/knex#3071
https://node-postgres.com/features/types#date--timestamp--timestamptz
brianc/node-pg-types#138
Leitsi added a commit to HSLdevcom/jore4-hasura that referenced this issue Mar 1, 2023
…ne for luxon

Merely adding the luxon default timezone was not quite enough:
broke on CI, which uses utc -> pg returned JS dates in UTC
(DB itself returns them as YYYY-MM-DD strings)
which did not match luxon dates they were compared with.

Now all luxon objects are in Finland timezone,
and tests still work no matter what timezone the runner is.

Some related links:
knex/knex#3071
https://node-postgres.com/features/types#date--timestamp--timestamptz
brianc/node-pg-types#138
Leitsi added a commit to HSLdevcom/jore4-hasura that referenced this issue Mar 1, 2023
…ne for luxon

Merely adding the luxon default timezone was not quite enough:
broke on CI, which uses utc -> pg returned JS dates in UTC
(DB itself returns them as YYYY-MM-DD strings)
which did not match luxon dates they were compared with.

Now all luxon objects are in Finland timezone,
and tests still work no matter what timezone the runner is.

Some related links:
knex/knex#3071
https://node-postgres.com/features/types#date--timestamp--timestamptz
brianc/node-pg-types#138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants