vis-chronicle 1.2.4 → 1.2.5
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 +1 -1
- package/src/fetch.js +11 -5
- package/src/relativeDates.js +2 -2
package/package.json
CHANGED
package/src/fetch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// Uses an input specification file to produce an output file for vis.js Timeline.
|
|
4
4
|
|
|
@@ -368,8 +368,11 @@ entryPoint()
|
|
|
368
368
|
if (startTime)
|
|
369
369
|
{
|
|
370
370
|
const range = wikidataToRange(startTime)
|
|
371
|
-
|
|
372
|
-
|
|
371
|
+
if (range)
|
|
372
|
+
{
|
|
373
|
+
item.start_min = range.min
|
|
374
|
+
item.start_max = range.max
|
|
375
|
+
}
|
|
373
376
|
}
|
|
374
377
|
else
|
|
375
378
|
console.error(`Date for '${item.startPath}' wasn't cached.`)
|
|
@@ -380,8 +383,11 @@ entryPoint()
|
|
|
380
383
|
if (endTime)
|
|
381
384
|
{
|
|
382
385
|
const range = wikidataToRange(endTime)
|
|
383
|
-
|
|
384
|
-
|
|
386
|
+
if (range)
|
|
387
|
+
{
|
|
388
|
+
item.end_min = range.min
|
|
389
|
+
item.end_max = range.max
|
|
390
|
+
}
|
|
385
391
|
}
|
|
386
392
|
else
|
|
387
393
|
console.error(`Date for '${item.endPath}' wasn't cached.`)
|
package/src/relativeDates.js
CHANGED
|
@@ -54,7 +54,7 @@ module.exports = function flattenRelativeDate(wikidataCache, dateString)
|
|
|
54
54
|
else
|
|
55
55
|
{
|
|
56
56
|
const cacheEntry = wikidataCache[relSplit[0]]
|
|
57
|
-
if (relSplit.length > 1)
|
|
57
|
+
if (cacheEntry.value && relSplit.length > 1)
|
|
58
58
|
{
|
|
59
59
|
// break up operators
|
|
60
60
|
const dateOperators = []
|
|
@@ -136,7 +136,7 @@ module.exports = function flattenRelativeDate(wikidataCache, dateString)
|
|
|
136
136
|
}
|
|
137
137
|
else
|
|
138
138
|
{
|
|
139
|
-
console.error(`Cannot advance/'>' to '${
|
|
139
|
+
console.error(`Cannot advance/'>' to '${component.substring(1)}'.`)
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
else
|