Skip to content

Commit

Permalink
Release. Bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan authored and Bryan committed Dec 2, 2019
1 parent 2bed96c commit 62b5e07
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 17 deletions.
32 changes: 22 additions & 10 deletions example/browser/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -3529,16 +3529,16 @@ module.exports = (() => {

this.offsetExchange = null;
const tzDdf = Timezones.parse(timezoneDdf);
const txExchange = Timezones.parse(timezoneExchange);
const tzExchange = Timezones.parse(timezoneExchange);

if (tzDdf !== null) {
this.timezoneDdf = tzDdf.code;
this.offsetDdf = tzDdf.getUtcOffset(null, true);
}

if (txExchange !== null) {
this.timezoneExchange = txExchange.code;
this.offsetExchange = txExchange.getUtcOffset(null, true);
if (tzExchange !== null) {
this.timezoneExchange = tzExchange.code;
this.offsetExchange = tzExchange.getUtcOffset(null, true);
}
}

Expand Down Expand Up @@ -4548,7 +4548,7 @@ module.exports = (() => {
'use strict';

return {
version: '4.0.17'
version: '4.0.18'
};
})();

Expand Down Expand Up @@ -5061,25 +5061,33 @@ module.exports = (() => {
let t;
let utc;

if (is.string(timezone) && quote.timeUtc !== null) {
if (quote.timeUtc !== null && (is.string(timezone) || quote.profile && quote.profile.exchangeRef && quote.profile.exchangeRef && quote.profile.exchangeRef.timezoneExchange)) {
utc = true;
let tz;

if (is.string(timezone)) {
tz = timezone;
} else {
tz = quote.profile.exchangeRef.timezoneExchange;
}

let epoch = quote.timeUtc.getTime();

if (!offsets.hasOwnProperty(timezone)) {
if (!offsets.hasOwnProperty(tz)) {
const offset = {};
offset.latest = epoch;
offset.timezone = Timezone.parse(timezone);
offset.timezone = Timezone.parse(tz);

if (offset.timezone !== null) {
offset.milliseconds = offset.timezone.getUtcOffset(null, true);
} else {
offset.milliseconds = null;
}

offsets[timezone] = offset;
offsets[tz] = offset;
}

const o = offsets[timezone];
const o = offsets[tz];

if (o.milliseconds !== null) {
t = new Date(epoch + o.milliseconds);
Expand Down Expand Up @@ -7700,6 +7708,7 @@ module.exports = (() => {
* Gets a list of names in the tz database (see https://en.wikipedia.org/wiki/Tz_database
* and https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
*
* @public
* @static
* @returns {Array<String>}
*/
Expand All @@ -7710,6 +7719,7 @@ module.exports = (() => {
/**
* Indicates if a timezone name exists.
*
* @public
* @static
* @param {String} name - The timezone name to find.
* @returns {Boolean}
Expand All @@ -7724,6 +7734,8 @@ module.exports = (() => {
/**
* Attempts to guess the lock timezone.
*
* @public
* @static
* @returns {String|null}
*/
guessTimezone() {
Expand Down
2 changes: 1 addition & 1 deletion lib/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module.exports = (() => {
'use strict';

return {
version: '4.0.17'
version: '4.0.18'
};
})();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@barchart/marketdata-api-js",
"version": "4.0.17",
"version": "4.0.18",
"description": "Barchart client library for streaming market data from JERQ servers using JavaScript",
"author": {
"name": "Eero Pikat",
Expand Down
22 changes: 17 additions & 5 deletions test/dist/barchart-marketdata-api-tests-4.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -1394,25 +1394,33 @@ module.exports = (() => {
let t;
let utc;

if (is.string(timezone) && quote.timeUtc !== null) {
if (quote.timeUtc !== null && (is.string(timezone) || quote.profile && quote.profile.exchangeRef && quote.profile.exchangeRef && quote.profile.exchangeRef.timezoneExchange)) {
utc = true;
let tz;

if (is.string(timezone)) {
tz = timezone;
} else {
tz = quote.profile.exchangeRef.timezoneExchange;
}

let epoch = quote.timeUtc.getTime();

if (!offsets.hasOwnProperty(timezone)) {
if (!offsets.hasOwnProperty(tz)) {
const offset = {};
offset.latest = epoch;
offset.timezone = Timezone.parse(timezone);
offset.timezone = Timezone.parse(tz);

if (offset.timezone !== null) {
offset.milliseconds = offset.timezone.getUtcOffset(null, true);
} else {
offset.milliseconds = null;
}

offsets[timezone] = offset;
offsets[tz] = offset;
}

const o = offsets[timezone];
const o = offsets[tz];

if (o.milliseconds !== null) {
t = new Date(epoch + o.milliseconds);
Expand Down Expand Up @@ -4056,6 +4064,7 @@ module.exports = (() => {
* Gets a list of names in the tz database (see https://en.wikipedia.org/wiki/Tz_database
* and https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
*
* @public
* @static
* @returns {Array<String>}
*/
Expand All @@ -4066,6 +4075,7 @@ module.exports = (() => {
/**
* Indicates if a timezone name exists.
*
* @public
* @static
* @param {String} name - The timezone name to find.
* @returns {Boolean}
Expand All @@ -4080,6 +4090,8 @@ module.exports = (() => {
/**
* Attempts to guess the lock timezone.
*
* @public
* @static
* @returns {String|null}
*/
guessTimezone() {
Expand Down

0 comments on commit 62b5e07

Please sign in to comment.