From 8643f17fc0c76b7777f990e6c6ee4b1581e45522 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 23 Sep 2020 17:21:28 -0300 Subject: [PATCH] [FIX] WatermelonDB caching Date as String (#2484) Co-authored-by: Diego Mello --- patches/@nozbe+watermelondb+0.19.0.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 patches/@nozbe+watermelondb+0.19.0.patch diff --git a/patches/@nozbe+watermelondb+0.19.0.patch b/patches/@nozbe+watermelondb+0.19.0.patch new file mode 100644 index 00000000..b30d2730 --- /dev/null +++ b/patches/@nozbe+watermelondb+0.19.0.patch @@ -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);