awing-library 2.1.74-beta → 2.1.75-beta
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/lib/Utils/Helpers.js +8 -8
- package/package.json +1 -1
package/lib/Utils/Helpers.js
CHANGED
|
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.formatChartNumber = exports.updateObjectFields = exports.validateNumber = exports.getToday = exports.convertDataSetPattern = exports.convertAnalyticModelToChartDataAdvance = exports.getStartOfDay = exports.timestampToStringDDMMYYYY = exports.dateToStringDDMMYYYY = exports.convertTimelineToDateTime = exports.dateTimeToString = exports.convertTimestampToDateTime = exports.convertDateTimeToTimestamp = exports.checkValidUrl = exports.validateAnalyticTypes = exports.stringToListAccessPoint = exports.checkValidMacAddress = exports.checkValidStringListAP = exports.convertTimeLine = exports.WMAPEcalculator = exports.roundDecimalNumber = exports.convertArrayToObject = exports.offlinePaginate = exports.changeToAlias = exports.calculatorDirectoryIdRoot = exports.getRoutePath = exports.timestampToStringDDMMYYYYHHmm = exports.dateToStringddddDDMMYYYYHHmm = exports.downloadZipFile = exports.downloadFilePattern = exports.generateUUID = exports.displayLongString = exports.getQueryVariable = exports.formatNumber = exports.dateToString = exports.getCookie = exports.TIMELINE_TYPE = void 0;
|
|
27
27
|
var moment_1 = __importDefault(require("moment"));
|
|
28
|
-
var
|
|
28
|
+
var i18n_1 = __importDefault(require("../i18n"));
|
|
29
29
|
var helper_1 = require("../AWING/helper");
|
|
30
30
|
var TIMELINE_TYPE;
|
|
31
31
|
(function (TIMELINE_TYPE) {
|
|
@@ -55,7 +55,7 @@ function dateToString(date) {
|
|
|
55
55
|
exports.dateToString = dateToString;
|
|
56
56
|
function formatNumber(num) {
|
|
57
57
|
if (num || num === 0) {
|
|
58
|
-
return new Intl.NumberFormat(
|
|
58
|
+
return new Intl.NumberFormat(i18n_1.default.language === 'vi' ? 'vi-VN' : 'en-US').format(num);
|
|
59
59
|
}
|
|
60
60
|
else
|
|
61
61
|
return '';
|
|
@@ -137,7 +137,7 @@ function dateToStringddddDDMMYYYYHHmm(date) {
|
|
|
137
137
|
if (!date)
|
|
138
138
|
return null;
|
|
139
139
|
var _date = new Date(date);
|
|
140
|
-
var _language =
|
|
140
|
+
var _language = i18n_1.default.language || 'vi';
|
|
141
141
|
var options = {
|
|
142
142
|
weekday: 'long',
|
|
143
143
|
year: 'numeric',
|
|
@@ -423,7 +423,7 @@ function convertAnalyticModelToChartDataAdvance(analyticModel) {
|
|
|
423
423
|
var totalCTR = totalView > 0 ? ((totalClick * 100) / totalView).toFixed(2) : 0;
|
|
424
424
|
return [
|
|
425
425
|
{
|
|
426
|
-
label: "".concat(
|
|
426
|
+
label: "".concat(i18n_1.default.t('Common.Impression'), " ").concat(roundDecimalNumber(totalView)),
|
|
427
427
|
type: 'line',
|
|
428
428
|
data: ViewData,
|
|
429
429
|
fill: false,
|
|
@@ -432,7 +432,7 @@ function convertAnalyticModelToChartDataAdvance(analyticModel) {
|
|
|
432
432
|
variant: 'primary',
|
|
433
433
|
},
|
|
434
434
|
{
|
|
435
|
-
label: "".concat(
|
|
435
|
+
label: "".concat(i18n_1.default.t('Common.FinalClick'), " ").concat(roundDecimalNumber(totalClick)),
|
|
436
436
|
type: 'line',
|
|
437
437
|
data: ClickData,
|
|
438
438
|
fill: false,
|
|
@@ -459,19 +459,19 @@ var convertDataSetPattern = function (data) {
|
|
|
459
459
|
return [
|
|
460
460
|
{
|
|
461
461
|
data: ctr,
|
|
462
|
-
label:
|
|
462
|
+
label: i18n_1.default.t('Statistics.CTR'),
|
|
463
463
|
type: 'bar',
|
|
464
464
|
color: 'rgb(128, 176, 255)',
|
|
465
465
|
},
|
|
466
466
|
{
|
|
467
467
|
data: numberOfConnections,
|
|
468
|
-
label:
|
|
468
|
+
label: i18n_1.default.t('Statistics.NumberOfConnections'),
|
|
469
469
|
type: 'line',
|
|
470
470
|
color: 'rgb(0, 85, 184)',
|
|
471
471
|
},
|
|
472
472
|
{
|
|
473
473
|
data: impressions,
|
|
474
|
-
label:
|
|
474
|
+
label: i18n_1.default.t('Statistics.Impressions'),
|
|
475
475
|
type: 'line',
|
|
476
476
|
color: 'rgb(221, 4, 12)',
|
|
477
477
|
},
|