[FIX] WatermelonDB caching Date as String (#2484)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-09-23 17:21:28 -03:00 committed by GitHub
parent 8ae489074e
commit 8643f17fc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff --git a/node_modules/@nozbe/watermelondb/decorators/date/index.js b/node_modules/@nozbe/watermelondb/decorators/date/index.js
index 65690af..ce71aa0 100644
--- a/node_modules/@nozbe/watermelondb/decorators/date/index.js
+++ b/node_modules/@nozbe/watermelondb/decorators/date/index.js
@@ -44,7 +44,7 @@ var dateDecorator = (0, _makeDecorator.default)(function (columnName) {
var rawValue = date ? +new Date(date) : null;
if (rawValue && date) {
- cache.set(rawValue, date);
+ cache.set(rawValue, new Date(date));
}
this.asModel._setRaw(columnName, rawValue);