@sis-cc/dotstatsuite-components 17.6.0 → 17.7.0

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.
@@ -81,7 +81,7 @@ var getReportedTimePeriodLabel = exports.getReportedTimePeriodLabel = function g
81
81
  var reportStartDate = new Date(year, reportYearStart.month, reportYearStart.day);
82
82
  var isReportFirstDate = _dateFns2.default.isEqual(reportStartDate, new Date(year, 1, 1));
83
83
  if (isReportFirstDate || freq === 'D') {
84
- return R.isNil(_format) ? id : _dateFns2.default.format(start, _format, { locale: getLocale(locale) });
84
+ return R.isNil(_format) || freq !== 'M' ? id : _dateFns2.default.format(start, _format, { locale: getLocale(locale) });
85
85
  }
86
86
  var nextYear = year + 1;
87
87
  if (freq === 'A') {
@@ -113,7 +113,6 @@ var getReportedTimePeriodLabel = exports.getReportedTimePeriodLabel = function g
113
113
 
114
114
  return year + '/' + nextYear + '-' + month;
115
115
  }
116
- // freq === 'W'
117
116
 
118
117
  var _R$match7 = R.match(/W[\d]{2}/, id),
119
118
  _R$match8 = (0, _slicedToArray3.default)(_R$match7, 1),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-components",
3
3
  "description": "Set components based on React.",
4
- "version": "17.6.0",
4
+ "version": "17.7.0",
5
5
  "main": "lib/index.js",
6
6
  "author": "OECD",
7
7
  "license": "MIT",
@@ -32,7 +32,8 @@ export const getReportedTimePeriodLabel = (freq, _format, locale) => (reportYear
32
32
  const reportStartDate = new Date(year, reportYearStart.month, reportYearStart.day);
33
33
  const isReportFirstDate = dateFns.isEqual(reportStartDate, new Date(year, 1, 1));
34
34
  if (isReportFirstDate || freq === 'D') {
35
- return R.isNil(_format) ? id : dateFns.format(start, _format, { locale: getLocale(locale) });
35
+ return R.isNil(_format) || freq !== 'M'
36
+ ? id : dateFns.format(start, _format, { locale: getLocale(locale) });
36
37
  }
37
38
  const nextYear = year + 1;
38
39
  if (freq === 'A') {
@@ -54,7 +55,6 @@ export const getReportedTimePeriodLabel = (freq, _format, locale) => (reportYear
54
55
  const [month] = R.match(/M[\d]{2}/, id);
55
56
  return `${year}/${nextYear}-${month}`;
56
57
  }
57
- // freq === 'W'
58
58
  const [week] = R.match(/W[\d]{2}/, id)
59
59
  return `${year}/${nextYear}-${week}`;
60
60
  };