@datarailsshared/dr_renderer 1.2.73 → 1.2.77
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
CHANGED
package/src/dataformatter.js
CHANGED
|
@@ -497,6 +497,13 @@ var DataFormatterImpl = function () {
|
|
|
497
497
|
var minutes = n.getMinutes();
|
|
498
498
|
var seconds = n.getSeconds();
|
|
499
499
|
|
|
500
|
+
var padStartTime = function(time) {
|
|
501
|
+
if (time < 10) {
|
|
502
|
+
return '0' + time;
|
|
503
|
+
}
|
|
504
|
+
return time;
|
|
505
|
+
}
|
|
506
|
+
|
|
500
507
|
// Build res
|
|
501
508
|
var res = pattern.replace(/((?:am\/pm)|(?:a\/p))|(?:(h[^ydsap]*?)mm)|(?:mm([^ydh]*?s))|(?:(h[^ydsap]*?)m)|(?:m([^ydh]*?s))/gi, function (a, ampm, fmin, fmin2, mmin, mmin2) {
|
|
502
509
|
|
|
@@ -506,11 +513,11 @@ var DataFormatterImpl = function () {
|
|
|
506
513
|
}
|
|
507
514
|
|
|
508
515
|
if (fmin) {
|
|
509
|
-
return fmin + _this3.applyNumberPattern(minutes, '00');
|
|
516
|
+
return fmin + _this3.applyNumberPattern(padStartTime(minutes), '00');
|
|
510
517
|
}
|
|
511
518
|
|
|
512
519
|
if (fmin2) {
|
|
513
|
-
return _this3.applyNumberPattern(minutes, '00') + fmin2;
|
|
520
|
+
return _this3.applyNumberPattern(padStartTime(minutes), '00') + fmin2;
|
|
514
521
|
}
|
|
515
522
|
|
|
516
523
|
if (mmin) {
|
|
@@ -527,7 +534,7 @@ var DataFormatterImpl = function () {
|
|
|
527
534
|
return res.replace(/(ss)|(s)|(hh)|(h)|(dddd)|(ddd)|(dd)|(d)|(mmmmm)|(mmmm)|(mmm)|(mm)|(m)|(yyyy)|(yy)|(\[\])/gi, function (a, ss, s, hh, h, dddd, ddd, dd, d, mmmmm, mmmm, mmm, mm, m, yyyy, yy, ampm) {
|
|
528
535
|
|
|
529
536
|
if (ss) {
|
|
530
|
-
return _this3.applyNumberPattern(seconds, '00');
|
|
537
|
+
return _this3.applyNumberPattern(padStartTime(seconds), '00');
|
|
531
538
|
}
|
|
532
539
|
|
|
533
540
|
if (s) {
|
|
@@ -535,7 +542,7 @@ var DataFormatterImpl = function () {
|
|
|
535
542
|
}
|
|
536
543
|
|
|
537
544
|
if (hh) {
|
|
538
|
-
return _this3.applyNumberPattern(foundAMPM ? hours % 12 : hours, '00');
|
|
545
|
+
return _this3.applyNumberPattern(padStartTime(foundAMPM ? hours % 12 : hours), '00');
|
|
539
546
|
}
|
|
540
547
|
|
|
541
548
|
if (h) {
|
|
@@ -2017,7 +2017,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
2017
2017
|
};
|
|
2018
2018
|
|
|
2019
2019
|
highchartsRenderer.setTitleAndSubTitle = function (chartOptions, opts, additionOptions) {
|
|
2020
|
-
chartOptions.title = opts.chartOptions.hideChartHeader ? null : {
|
|
2020
|
+
chartOptions.title = opts.chartOptions.hideChartHeader ? { text: null } : {
|
|
2021
2021
|
align: 'center',
|
|
2022
2022
|
text: opts && opts.chart_title ? opts.chart_title : "",
|
|
2023
2023
|
style: {
|
|
@@ -4307,6 +4307,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4307
4307
|
format = format.replace('dd', 'DD');
|
|
4308
4308
|
format = format.replace('yyyy', 'YYYY');
|
|
4309
4309
|
format = format.replace('yy', 'YY');
|
|
4310
|
+
format = lodash.replace(format, /h/g, 'H');
|
|
4310
4311
|
return moment_lib(tryParse).utcOffset(0).format(format) + "";
|
|
4311
4312
|
} else {
|
|
4312
4313
|
return 'Wrong date format';
|
|
@@ -7374,6 +7375,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7374
7375
|
minHeight: 16,
|
|
7375
7376
|
maxHeight: 45,
|
|
7376
7377
|
x: -3,
|
|
7378
|
+
y: -26,
|
|
7377
7379
|
layout: "horizontal"
|
|
7378
7380
|
} : {
|
|
7379
7381
|
enabled: rowAttrsLength > 0,
|
|
@@ -88,9 +88,7 @@ let getPublishedItemsRenderer = function (publishedItemsRenderer) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
publishedItemsRenderer.changedAutoResize = function (
|
|
92
|
-
if (options.autoResize !== new_auto_resize) {
|
|
93
|
-
options.autoResize = new_auto_resize;
|
|
91
|
+
publishedItemsRenderer.changedAutoResize = function (options, window, document) {
|
|
94
92
|
if (!options.autoResize) {
|
|
95
93
|
publishedItemsRenderer.resetTableZoom(document);
|
|
96
94
|
} else {
|
|
@@ -100,7 +98,6 @@ let getPublishedItemsRenderer = function (publishedItemsRenderer) {
|
|
|
100
98
|
}, 100);
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
|
-
}
|
|
104
101
|
}
|
|
105
102
|
|
|
106
103
|
publishedItemsRenderer.changedInputValue = function (firstTime, scope, options) {
|