forked from fdesjardins/chart-supplements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.js
53 lines (46 loc) · 1.68 KB
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const chartSupplements = require('./')
// Should log current cycle effective object
chartSupplements.fetchCycle().then(c => {
console.log('current cycle effective object, no param')
console.dir(c)
})
// Should log current cycle effective object
chartSupplements.fetchCycle('Current').then(c => {
console.log('current cycle effective object, with param')
console.dir(c)
})
// Should log next cycle effective object
chartSupplements.fetchCycle('Next').then(c => {
console.log('next cycle effective object, with param')
console.dir(c)
})
// Should log current cycle code
chartSupplements.fetchCurrentCycleCode().then(c => {
console.log('current cycle code')
console.log(c)
})
// Should log the current cycle effective dates
chartSupplements.getCycleEffectiveDates().then(c => {
console.log('the current cycle effective dates, no param')
console.log(c)
})
// Should log the current cycle effective dates
chartSupplements.getCycleEffectiveDates('Current').then(c => {
console.log('the current cycle effective dates, with param')
console.log(c)
})
// Should log the next cycle effective dates
chartSupplements.getCycleEffectiveDates('Next').then(c => {
console.log('the next cycle effective dates')
console.log(c)
})
// Should log the current cycle effective dates
chartSupplements.currentCycleEffectiveDates().then(c => {
console.log('the current cycle effective dates')
console.log(c)
})
// The `getNextCycle` option will get the next cycle if it is available when set to true
// If it is omitted or set to false, the current cycle will be queried
chartSupplements.list(['PANC', 'PADK'], { getNextCycle: false, }).then(results => {
console.log(JSON.stringify(results, null, 2))
})