Skip to content

Commit 62b5e07

Browse files
BryanBryan
authored andcommitted
Release. Bump version number
1 parent 2bed96c commit 62b5e07

File tree

4 files changed

+41
-17
lines changed

4 files changed

+41
-17
lines changed

example/browser/example.js

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,16 +3529,16 @@ module.exports = (() => {
35293529

35303530
this.offsetExchange = null;
35313531
const tzDdf = Timezones.parse(timezoneDdf);
3532-
const txExchange = Timezones.parse(timezoneExchange);
3532+
const tzExchange = Timezones.parse(timezoneExchange);
35333533

35343534
if (tzDdf !== null) {
35353535
this.timezoneDdf = tzDdf.code;
35363536
this.offsetDdf = tzDdf.getUtcOffset(null, true);
35373537
}
35383538

3539-
if (txExchange !== null) {
3540-
this.timezoneExchange = txExchange.code;
3541-
this.offsetExchange = txExchange.getUtcOffset(null, true);
3539+
if (tzExchange !== null) {
3540+
this.timezoneExchange = tzExchange.code;
3541+
this.offsetExchange = tzExchange.getUtcOffset(null, true);
35423542
}
35433543
}
35443544

@@ -4548,7 +4548,7 @@ module.exports = (() => {
45484548
'use strict';
45494549

45504550
return {
4551-
version: '4.0.17'
4551+
version: '4.0.18'
45524552
};
45534553
})();
45544554

@@ -5061,25 +5061,33 @@ module.exports = (() => {
50615061
let t;
50625062
let utc;
50635063

5064-
if (is.string(timezone) && quote.timeUtc !== null) {
5064+
if (quote.timeUtc !== null && (is.string(timezone) || quote.profile && quote.profile.exchangeRef && quote.profile.exchangeRef && quote.profile.exchangeRef.timezoneExchange)) {
50655065
utc = true;
5066+
let tz;
5067+
5068+
if (is.string(timezone)) {
5069+
tz = timezone;
5070+
} else {
5071+
tz = quote.profile.exchangeRef.timezoneExchange;
5072+
}
5073+
50665074
let epoch = quote.timeUtc.getTime();
50675075

5068-
if (!offsets.hasOwnProperty(timezone)) {
5076+
if (!offsets.hasOwnProperty(tz)) {
50695077
const offset = {};
50705078
offset.latest = epoch;
5071-
offset.timezone = Timezone.parse(timezone);
5079+
offset.timezone = Timezone.parse(tz);
50725080

50735081
if (offset.timezone !== null) {
50745082
offset.milliseconds = offset.timezone.getUtcOffset(null, true);
50755083
} else {
50765084
offset.milliseconds = null;
50775085
}
50785086

5079-
offsets[timezone] = offset;
5087+
offsets[tz] = offset;
50805088
}
50815089

5082-
const o = offsets[timezone];
5090+
const o = offsets[tz];
50835091

50845092
if (o.milliseconds !== null) {
50855093
t = new Date(epoch + o.milliseconds);
@@ -7700,6 +7708,7 @@ module.exports = (() => {
77007708
* Gets a list of names in the tz database (see https://en.wikipedia.org/wiki/Tz_database
77017709
* and https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
77027710
*
7711+
* @public
77037712
* @static
77047713
* @returns {Array<String>}
77057714
*/
@@ -7710,6 +7719,7 @@ module.exports = (() => {
77107719
/**
77117720
* Indicates if a timezone name exists.
77127721
*
7722+
* @public
77137723
* @static
77147724
* @param {String} name - The timezone name to find.
77157725
* @returns {Boolean}
@@ -7724,6 +7734,8 @@ module.exports = (() => {
77247734
/**
77257735
* Attempts to guess the lock timezone.
77267736
*
7737+
* @public
7738+
* @static
77277739
* @returns {String|null}
77287740
*/
77297741
guessTimezone() {

lib/meta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module.exports = (() => {
22
'use strict';
33

44
return {
5-
version: '4.0.17'
5+
version: '4.0.18'
66
};
77
})();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@barchart/marketdata-api-js",
3-
"version": "4.0.17",
3+
"version": "4.0.18",
44
"description": "Barchart client library for streaming market data from JERQ servers using JavaScript",
55
"author": {
66
"name": "Eero Pikat",

test/dist/barchart-marketdata-api-tests-4.0.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,25 +1394,33 @@ module.exports = (() => {
13941394
let t;
13951395
let utc;
13961396

1397-
if (is.string(timezone) && quote.timeUtc !== null) {
1397+
if (quote.timeUtc !== null && (is.string(timezone) || quote.profile && quote.profile.exchangeRef && quote.profile.exchangeRef && quote.profile.exchangeRef.timezoneExchange)) {
13981398
utc = true;
1399+
let tz;
1400+
1401+
if (is.string(timezone)) {
1402+
tz = timezone;
1403+
} else {
1404+
tz = quote.profile.exchangeRef.timezoneExchange;
1405+
}
1406+
13991407
let epoch = quote.timeUtc.getTime();
14001408

1401-
if (!offsets.hasOwnProperty(timezone)) {
1409+
if (!offsets.hasOwnProperty(tz)) {
14021410
const offset = {};
14031411
offset.latest = epoch;
1404-
offset.timezone = Timezone.parse(timezone);
1412+
offset.timezone = Timezone.parse(tz);
14051413

14061414
if (offset.timezone !== null) {
14071415
offset.milliseconds = offset.timezone.getUtcOffset(null, true);
14081416
} else {
14091417
offset.milliseconds = null;
14101418
}
14111419

1412-
offsets[timezone] = offset;
1420+
offsets[tz] = offset;
14131421
}
14141422

1415-
const o = offsets[timezone];
1423+
const o = offsets[tz];
14161424

14171425
if (o.milliseconds !== null) {
14181426
t = new Date(epoch + o.milliseconds);
@@ -4056,6 +4064,7 @@ module.exports = (() => {
40564064
* Gets a list of names in the tz database (see https://en.wikipedia.org/wiki/Tz_database
40574065
* and https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
40584066
*
4067+
* @public
40594068
* @static
40604069
* @returns {Array<String>}
40614070
*/
@@ -4066,6 +4075,7 @@ module.exports = (() => {
40664075
/**
40674076
* Indicates if a timezone name exists.
40684077
*
4078+
* @public
40694079
* @static
40704080
* @param {String} name - The timezone name to find.
40714081
* @returns {Boolean}
@@ -4080,6 +4090,8 @@ module.exports = (() => {
40804090
/**
40814091
* Attempts to guess the lock timezone.
40824092
*
4093+
* @public
4094+
* @static
40834095
* @returns {String|null}
40844096
*/
40854097
guessTimezone() {

0 commit comments

Comments
 (0)