@datarailsshared/dr_renderer 1.2.155-dragons → 1.2.157-dragons

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.155-dragons",
3
+ "version": "1.2.157-dragons",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -7581,6 +7581,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7581
7581
  }
7582
7582
 
7583
7583
  let filters = [];
7584
+
7585
+ this.formatDatesWithAggregationIfRequired(widget, null);
7586
+
7584
7587
  lodash.forEach(col_key, function (col_value, index) {
7585
7588
  if (widget && widget.cols[index]) {
7586
7589
  let temp = highchartsRenderer.createFilterObject(widget.cols[index]);
@@ -7783,10 +7786,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7783
7786
  datesFields = lodash.filter(widget.rows, element => element.type == 'Date');
7784
7787
  datesFields = datesFields.concat(lodash.filter(widget.cols, element => element.type == 'Date'));
7785
7788
 
7786
- const aggregationConfigs = widget.options ? widget.options.date_aggregation_configs || [] : [];
7787
- if (aggregationConfigs.length && datesFields && datesFields.length) {
7788
- highchartsRenderer.formatDatesWithAggregationIfRequired(aggregationConfigs, datesFields, defaultDateFormat);
7789
- }
7789
+ highchartsRenderer.formatDatesWithAggregationIfRequired(widget, defaultDateFormat);
7790
7790
 
7791
7791
  const isCustomSorting = widget.options.sortingFields && Array.isArray(widget.options.sortingFields) && widget.options.sortingFields.length > 0;
7792
7792
  if (isCustomSorting) {
@@ -8216,21 +8216,29 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8216
8216
  yAxis.max = !isNaN(maxNumber) ? maxNumber : null;
8217
8217
  }
8218
8218
 
8219
- highchartsRenderer.formatDatesWithAggregationIfRequired = function(aggregationConfigs, datesFields, defaultDateFormat) {
8220
- _.forEach(aggregationConfigs, aggregationConfig => {
8221
- const aggregationTimeframe = aggregationConfig ? aggregationConfig.aggregate_by : null;
8222
- const isFormattingByAggregation = aggregationConfig ? aggregationConfig.is_formatting_by_aggregation_method : false;
8219
+ highchartsRenderer.formatDatesWithAggregationIfRequired = function(widget, defaultDateFormat) {
8220
+
8221
+ let datesFields = [];
8222
+ datesFields = lodash.filter(widget.rows, element => element.type == 'Date');
8223
+ datesFields = datesFields.concat(lodash.filter(widget.cols, element => element.type == 'Date'));
8224
+ const aggregationConfigs = widget.options ? widget.options.date_aggregation_configs || [] : [];
8223
8225
 
8224
- if (aggregationTimeframe && isFormattingByAggregation) {
8225
- const dateField = lodash.find(
8226
- datesFields,
8227
- (element) => element.id === aggregationConfig.field_id
8228
- );
8229
- if (dateField) {
8230
- dateField.format = highchartsRenderer.getDateFormatByAggregation(aggregationTimeframe, defaultDateFormat);
8226
+ if (aggregationConfigs.length && datesFields && datesFields.length) {
8227
+ _.forEach(aggregationConfigs, aggregationConfig => {
8228
+ const aggregationTimeframe = aggregationConfig ? aggregationConfig.aggregate_by : null;
8229
+ const isFormattingByAggregation = aggregationConfig ? aggregationConfig.is_formatting_by_aggregation_method : false;
8230
+
8231
+ if (aggregationTimeframe && isFormattingByAggregation) {
8232
+ const dateField = lodash.find(
8233
+ datesFields,
8234
+ (element) => element.id === aggregationConfig.field_id
8235
+ );
8236
+ if (dateField) {
8237
+ dateField.format = highchartsRenderer.getDateFormatByAggregation(aggregationTimeframe, defaultDateFormat);
8238
+ }
8231
8239
  }
8232
- }
8233
- });
8240
+ });
8241
+ }
8234
8242
  }
8235
8243
 
8236
8244
  highchartsRenderer.getDateFormatByAggregation = function(timeframe, defaultDateFormat) {