scheduler-node-models 1.0.6 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scheduler-node-models",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "files": [
@@ -192,7 +192,7 @@ class ScheduleReport extends general_1.Report {
192
192
  // set all the column widths for the month with the first column width of 17.0
193
193
  // and days of the month at 4.0
194
194
  sheet.getColumn(1).width = 17.0;
195
- const endofMonth = (new Date(endDate.getTime() - 3600000)).getDate();
195
+ const endofMonth = (new Date(endDate.getTime() - (24 * 3600000))).getDate();
196
196
  console.log(endofMonth);
197
197
  for (let i = 0; i < endofMonth; i++) {
198
198
  sheet.getColumn(2 + i).width = 4.0;
@@ -201,7 +201,7 @@ class ScheduleReport extends general_1.Report {
201
201
  let style = this.styles.get('month');
202
202
  sheet.getRow(1).height = 20;
203
203
  sheet.getRow(2).height = 20;
204
- this.setCell(sheet, this.getCellID(1, 1), this.getCellID(1, 1), style, months[startDate.getMonth()]);
204
+ this.setCell(sheet, this.getCellID(0, 1), this.getCellID(0, 1), style, months[startDate.getMonth()]);
205
205
  const formatter = new Intl.DateTimeFormat('en-US', {
206
206
  month: '2-digit',
207
207
  day: '2-digit',
@@ -215,11 +215,12 @@ class ScheduleReport extends general_1.Report {
215
215
  styleID = 'evenend';
216
216
  }
217
217
  style = this.styles.get(styleID);
218
- let cellID = this.getCellID(current.getDate() + 1, 1);
218
+ let cellID = this.getCellID(current.getDate(), 1);
219
219
  this.setCell(sheet, cellID, cellID, style, weekdays[current.getDay()]);
220
- cellID = this.getCellID(current.getDate() + 1, 2);
220
+ cellID = this.getCellID(current.getDate(), 2);
221
221
  this.setCell(sheet, cellID, cellID, style, current.getDate());
222
222
  current = new Date(current.getTime() + (24 * 3600000));
223
+ console.log(current);
223
224
  }
224
225
  // now add row for workcenter header, then the employees under that workcenter
225
226
  let row = 2;
@@ -227,7 +228,7 @@ class ScheduleReport extends general_1.Report {
227
228
  row++;
228
229
  style = this.styles.get('wkctr');
229
230
  sheet.getRow(row).height = 20.0;
230
- this.setCell(sheet, this.getCellID(0, row), this.getCellID(endofMonth + 2, row), style, wkctr.name);
231
+ this.setCell(sheet, this.getCellID(0, row), this.getCellID(endofMonth, row), style, wkctr.name);
231
232
  // sort positions, then add a row for each employee for the positions.
232
233
  if (wkctr.positions && wkctr.positions.length > 0) {
233
234
  wkctr.positions.sort((a, b) => a.compareTo(b));
@@ -263,7 +264,7 @@ class ScheduleReport extends general_1.Report {
263
264
  let style = this.styles.get(styleID);
264
265
  sheet.getRow(row).height = 20;
265
266
  const name = `${emp.name.lastname}, ${emp.name.firstname.substring(0, 1)}`;
266
- this.setCell(sheet, this.getCellID(1, row), this.getCellID(1, row), style, name);
267
+ this.setCell(sheet, this.getCellID(0, row), this.getCellID(0, row), style, name);
267
268
  let current = new Date(start);
268
269
  while (current.getTime() < end.getTime()) {
269
270
  let stID = styleID;
@@ -281,7 +282,7 @@ class ScheduleReport extends general_1.Report {
281
282
  }
282
283
  }
283
284
  style = this.styles.get(stID);
284
- const cellID = this.getCellID(current.getDate() + 1, row);
285
+ const cellID = this.getCellID(current.getDate(), row);
285
286
  this.setCell(sheet, cellID, cellID, style, code);
286
287
  current = new Date(current.getTime() + (24 * 3600000));
287
288
  }