JS Date to timestamptz casting
db > db.instances.find({'sys_period @>': new Date()})
error: malformed range literal: "2018-04-08T15:31:11.233-04:00"
at Connection.parseE (/Users/adamtistler/WebstormProjects/priapus/api/node_modules/pg/lib/connection.js:545:11)
at Connection.parseMessage (/Users/adamtistler/WebstormProjects/priapus/api/node_modules/pg/lib/connection.js:370:19)
db > db.instances.where('sys_period @> $1', [new Date()])
error: malformed range literal: "2018-04-08T15:31:24.853-04:00"
at Connection.parseE (/Users/adamtistler/WebstormProjects/priapus/api/node_modules/pg/lib/connection.js:545:11)
at Connection.parseMessage (/Users/adamtistler/WebstormProjects/priapus/api/node_modules/pg/lib/connection.js:370:19)
db > db.instances.where('sys_period @> $1::timestamptz', [new Date()])
I thought that Date(s) were automatically cast as timestamptz? Is this behavior expected? I can cast the value myself, however i thought that the library was supposed to handle this.