@onehat/data 1.8.12 → 1.8.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.8.12",
3
+ "version": "1.8.15",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/Entity.js CHANGED
@@ -1297,6 +1297,10 @@ class Entity extends EventEmitter {
1297
1297
  if (this.isFrozen) {
1298
1298
  return;
1299
1299
  }
1300
+
1301
+ // Save destroyed properties
1302
+ this.destroyedProperties = this.displayValues;
1303
+
1300
1304
  this._id = this.id; // save id, so we can query it later--even on a destroyed entity
1301
1305
 
1302
1306
  // parent objects
@@ -716,10 +716,12 @@ export default class Repository extends EventEmitter {
716
716
  isChanged = true;
717
717
  this.filters = filters;
718
718
  this.resetPagination();
719
- this.emit('changeFilters');
719
+ let ret;
720
720
  if (this._onChangeFilters) {
721
- return this._onChangeFilters();
721
+ ret = this._onChangeFilters();
722
722
  }
723
+ this.emit('changeFilters');
724
+ return ret;
723
725
  }
724
726
  return isChanged;
725
727
  }
@@ -1,7 +1,7 @@
1
1
  import moment from 'moment';
2
2
  import momentAlt from 'relative-time-parser'; // Notice this version of moment is imported from 'relative-time-parser', and may be out of sync with our general 'moment' package
3
3
  import accounting from 'accounting-js';
4
- import * as chrono from 'chrono-node';
4
+ // import * as chrono from 'chrono-node';
5
5
  import _ from 'lodash';
6
6
 
7
7
  class Parsers {
@@ -90,16 +90,16 @@ class Parsers {
90
90
  result = moment(value, format);
91
91
  } catch(err) {}
92
92
 
93
- if (!result || !result.isValid()) {
94
- // try using chrono
95
- const parsed = chrono.parse(value);
96
- if (parsed && parsed[0] && parsed[0].date) {
97
- const dateString = parsed[0].date();
98
- try {
99
- result = moment(dateString);
100
- } catch(err) {}
101
- }
102
- }
93
+ // if ((!result || !result.isValid() && chrono)) {
94
+ // // try using chrono
95
+ // const parsed = chrono.parse(value);
96
+ // if (parsed && parsed[0] && parsed[0].date) {
97
+ // const dateString = parsed[0].date();
98
+ // try {
99
+ // result = moment(dateString);
100
+ // } catch(err) {}
101
+ // }
102
+ // }
103
103
  return result;
104
104
  }
105
105