@onehat/data 1.20.7 → 1.20.8

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.
@@ -18,9 +18,10 @@ describe('TimeProperty', function() {
18
18
  describe('parse', function() {
19
19
 
20
20
  it('parse HH:mm:ss', function() {
21
- const parsed = this.property.parse('12:34:56');
21
+ const time = '02:23:23';
22
+ const parsed = this.property.parse(time);
22
23
  expect(parsed.isValid()).to.be.true;
23
- expect(parsed.format('HH:mm:ss')).to.be.eq('12:34:56');
24
+ expect(parsed.format('HH:mm:ss')).to.be.eq(time);
24
25
  });
25
26
 
26
27
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.20.7",
3
+ "version": "1.20.8",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -106,9 +106,9 @@ class Formatters {
106
106
  return moment(value).format(format);
107
107
  }
108
108
  if (!_.isNil(value)) {
109
- const date = moment(value, 'HH:mm:ss');
110
- if (!_.isNil(date)) {
111
- return moment(date).format(format);
109
+ const m = moment(value, format);
110
+ if (!_.isNil(m)) {
111
+ return m.format(format);
112
112
  }
113
113
  }
114
114
  return null;
@@ -110,7 +110,7 @@ class Parsers {
110
110
  return Parsers.ParseDate(value, format);
111
111
  }
112
112
 
113
- static ParseTime = (value, format = null) => {
113
+ static ParseTime = (value, format = 'HH:mm:ss') => {
114
114
  return Parsers.ParseDate(value, format);
115
115
  }
116
116