@basementuniverse/kanbn 1.0.0 → 1.1.0

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/src/parse-task.js CHANGED
@@ -65,7 +65,13 @@ function validateMetadataFromMarkdown(metadata) {
65
65
  { type: 'date'}
66
66
  ]
67
67
  },
68
- 'postponed': {
68
+ 'plannedStart': {
69
+ oneOf: [
70
+ { type: 'string' },
71
+ { type: 'date'}
72
+ ]
73
+ },
74
+ 'plannedFinish': {
69
75
  oneOf: [
70
76
  { type: 'string' },
71
77
  { type: 'date'}
@@ -98,7 +104,8 @@ function validateMetadataFromJSON(metadata) {
98
104
  'started': { type: 'date'},
99
105
  'completed': { type: 'date'},
100
106
  'due': { type: 'date'},
101
- 'postponed': { type: 'date'},
107
+ 'plannedStart': { type: 'date'},
108
+ 'plannedFinish': { type: 'date'},
102
109
  'progress': { type: 'number' },
103
110
  'tags': {
104
111
  type: 'array',
@@ -373,12 +380,19 @@ module.exports = {
373
380
  }
374
381
  metadata.due = dateValue;
375
382
  }
376
- if ('postponed' in metadata && !(metadata.postponed instanceof Date)) {
377
- const dateValue = chrono.parseDate(metadata.postponed);
383
+ if ('plannedStart' in metadata && !(metadata.plannedStart instanceof Date)) {
384
+ const dateValue = chrono.parseDate(metadata.plannedStart);
385
+ if (dateValue === null) {
386
+ throw new Error('unable to parse plannedStart date');
387
+ }
388
+ metadata.plannedStart = dateValue;
389
+ }
390
+ if ('plannedFinish' in metadata && !(metadata.plannedFinish instanceof Date)) {
391
+ const dateValue = chrono.parseDate(metadata.plannedFinish);
378
392
  if (dateValue === null) {
379
- throw new Error('unable to parse postponed date');
393
+ throw new Error('unable to parse plannedFinish date');
380
394
  }
381
- metadata.postponed = dateValue;
395
+ metadata.plannedFinish = dateValue;
382
396
  }
383
397
 
384
398
  // Check progress value