@carbonplan/components 11.0.6 → 11.1.1

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/dst/index.js CHANGED
@@ -2903,7 +2903,7 @@ var formatDateElement = function formatDateElement(date, element, option) {
2903
2903
  var format = typeof option === 'string' ? option : defaultOptions[element];
2904
2904
  var result = date.toLocaleString('default', (_date$toLocaleString = {}, _date$toLocaleString[element] = format, _date$toLocaleString));
2905
2905
 
2906
- if (format === 'numeric' && element === 'day') {
2906
+ if (format === 'numeric' && ['day', 'month'].includes(element)) {
2907
2907
  return result.padStart(2, '0');
2908
2908
  } else {
2909
2909
  return result;
@@ -2911,6 +2911,8 @@ var formatDateElement = function formatDateElement(date, element, option) {
2911
2911
  };
2912
2912
 
2913
2913
  var formatDate = function formatDate(date, options) {
2914
+ var _options$separator;
2915
+
2914
2916
  if (options === void 0) {
2915
2917
  options = defaultOptions;
2916
2918
  }
@@ -2919,7 +2921,7 @@ var formatDate = function formatDate(date, options) {
2919
2921
  var month = formatDateElement(d, 'month', options.month);
2920
2922
  var day = formatDateElement(d, 'day', options.day);
2921
2923
  var year = formatDateElement(d, 'year', options.year);
2922
- return [month, day, year].filter(Boolean).join(' ');
2924
+ return [month, day, year].filter(Boolean).join((_options$separator = options.separator) != null ? _options$separator : ' ');
2923
2925
  };
2924
2926
 
2925
2927
  exports.Badge = Badge;