@things-factory/dataset 6.0.81 → 6.0.82

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": "@things-factory/dataset",
3
- "version": "6.0.81",
3
+ "version": "6.0.82",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -36,19 +36,19 @@
36
36
  "@operato/shell": "^1.0.1",
37
37
  "@operato/styles": "^1.0.0",
38
38
  "@operato/utils": "^1.0.1",
39
- "@things-factory/auth-base": "^6.0.78",
40
- "@things-factory/aws-base": "^6.0.78",
41
- "@things-factory/board-service": "^6.0.78",
39
+ "@things-factory/auth-base": "^6.0.82",
40
+ "@things-factory/aws-base": "^6.0.82",
41
+ "@things-factory/board-service": "^6.0.82",
42
42
  "@things-factory/env": "^6.0.78",
43
- "@things-factory/organization": "^6.0.78",
44
- "@things-factory/scheduler-client": "^6.0.81",
45
- "@things-factory/shell": "^6.0.78",
46
- "@things-factory/work-shift": "^6.0.78",
47
- "@things-factory/worklist": "^6.0.81",
43
+ "@things-factory/organization": "^6.0.82",
44
+ "@things-factory/scheduler-client": "^6.0.82",
45
+ "@things-factory/shell": "^6.0.82",
46
+ "@things-factory/work-shift": "^6.0.82",
47
+ "@things-factory/worklist": "^6.0.82",
48
48
  "cron-parser": "^4.3.0",
49
49
  "moment-timezone": "^0.5.40",
50
50
  "simple-statistics": "^7.8.3",
51
51
  "statistics": "^3.3.0"
52
52
  },
53
- "gitHead": "184612c4610f1ab154bd26ff4a862ec3a6d852fb"
53
+ "gitHead": "6cd2a84db2c9ad8d9e75ecbdfcc53df1b20cf79f"
54
54
  }
@@ -110,13 +110,14 @@ async function getLatestTimesForPeriod(
110
110
  const now = moment()
111
111
 
112
112
  if (periodType == DataSetSummaryPeriodType.Hour) {
113
- const begin = now.clone().subtract(1, 'day').startOf('hour').toDate()
114
- const end = now.clone().startOf('hour').toDate()
113
+ const begin = now.clone().subtract(1, 'hour').startOf('hour')
114
+ const end = now.clone().startOf('hour')
115
+ const date = begin.clone().tz(domain.timezone)
115
116
 
116
117
  return {
117
- date: moment(begin).tz(domain.timezone).format('YYYY-MM-DD'),
118
- period: String(begin.getHours()),
119
- range: [begin, end]
118
+ date: date.format('YYYY-MM-DD'),
119
+ period: date.format('HH'),
120
+ range: [begin.toDate(), end.toDate()]
120
121
  }
121
122
  } else if (periodType == DataSetSummaryPeriodType.WorkShift) {
122
123
  const { workDate, workShift, shiftRange } = await getLatestWorkDateAndShift(domain, new Date())
@@ -127,12 +128,13 @@ async function getLatestTimesForPeriod(
127
128
 
128
129
  return { date: workDate, range: dateRange }
129
130
  } else if (periodType == DataSetSummaryPeriodType.Day) {
130
- const begin = now.clone().subtract(1, 'day').startOf('day').toDate()
131
- const end = now.clone().startOf('day').toDate()
131
+ const begin = now.clone().subtract(1, 'day').startOf('day')
132
+ const end = now.clone().startOf('day')
133
+ const date = begin.clone().tz(domain.timezone)
132
134
 
133
135
  return {
134
- date: moment(begin).tz(domain.timezone).format('YYYY-MM-DD'),
135
- range: [begin, end]
136
+ date: date.format('YYYY-MM-DD'),
137
+ range: [begin.toDate(), end.toDate()]
136
138
  }
137
139
  }
138
140
  }