The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
#18 Updates timestamps to improve consistency between PostgREST and realtime
Paul Copplestone035b2d43040b
diff --git a/libraries/supabase-js/package.json b/libraries/supabase-js/package.jsonindex 03ae925bce8..931442a52d0 100644--- a/libraries/supabase-js/package.json+++ b/libraries/supabase-js/package.json@@ -1,6 +1,6 @@{"name": "@supabase/supabase-js",- "version": "0.1.16",+ "version": "0.1.17","description": "Supabase Realtime API","main": "./lib/index.js","scripts": {diff --git a/libraries/supabase-js/src/utils/ChangeMapper.js b/libraries/supabase-js/src/utils/ChangeMapper.jsindex f49253abead..3dc8bce1195 100644--- a/libraries/supabase-js/src/utils/ChangeMapper.js+++ b/libraries/supabase-js/src/utils/ChangeMapper.js@@ -106,7 +106,7 @@ export const convertChangeData = (columns, records, options = {}) => {case 'time':return noop(stringValue) // To allow users to cast it based on Timezonecase 'timestamp':- return noop(stringValue) // To allow users to cast it based on Timezone+ return toTimestampString(stringValue) // Format to be consistent with PostgRESTcase 'timestamptz':return noop(stringValue) // To allow users to cast it based on Timezonecase 'timetz':@@ -160,4 +160,18 @@ export const convertChangeData = (columns, records, options = {}) => {}const toJson = stringValue => {return JSON.parse(stringValue)+ }++ /**+ * Fixes timestamp to be ISO-8601. Swaps the space between the date and time for a 'T'+ * See https://github.com/supabase/supabase/issues/18+ * @returns {string}+ *+ * @example+ * toTimestampString('2019-09-10 00:00:00')+ * //=>+ * '2019-09-10T00:00:00'+ */+ const toTimestampString = stringValue => {+ return stringValue.replace(' ', 'T')}\ No newline at end of file