@semcore/date-picker 3.1.2 → 3.2.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [3.2.0] - 2022-08-18
6
+
7
+ ### Changed
8
+
9
+ - Removed spaces around dash in formatted date.
10
+
11
+ ## [3.1.4] - 2022-08-18
12
+
13
+ ### Changed
14
+
15
+ - Version patch update due to children dependencies update (`@semcore/base-trigger` [3.0.15 ~> 3.0.16], `@semcore/icon` [2.30.0 ~> 2.30.1]).
16
+
17
+ ## [3.1.3] - 2022-08-18
18
+
19
+ ### Changed
20
+
21
+ - Version patch update due to children dependencies update (`@semcore/base-trigger` [3.0.14 ~> 3.0.15], `@semcore/icon` [2.29.5 ~> 2.30.0]).
22
+
5
23
  ## [3.1.2] - 2022-08-18
6
24
 
7
25
  ### Changed
@@ -66,26 +66,26 @@ var style = (
66
66
  /*__reshadow_css_start__*/
67
67
  _core.sstyled.insert(
68
68
  /*__inner_css_start__*/
69
- ".___SCalendar_flzkf_gg_{display:flex;flex-direction:column}.___SGridDays_flzkf_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto));grid-template-rows:repeat(auto-fit,minmax(32px,auto))}.___SGridMonths_flzkf_gg_{display:grid;grid-row-gap:8px;grid-template-columns:repeat(3,minmax(60px,auto));grid-template-rows:repeat(4,minmax(32px,auto))}.___SWeekDays_flzkf_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto))}.___SWeekDay_flzkf_gg_{min-width:32px;min-height:32px;display:flex;align-items:center;justify-content:center;color:#6c6e79;font-size:14px;font-weight:400;overflow:hidden}.___SCalendarUnit_flzkf_gg_{font-family:inherit;font-weight:400;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:#191b23;outline:0;box-shadow:none;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background:transparent;align-items:center;border-radius:6px;box-sizing:border-box;cursor:pointer;display:flex;font-size:14px;justify-content:center;min-height:32px;min-width:32px;position:relative;transition:color .15s,background .15s;outline:none}.___SCalendarUnit_flzkf_gg_:hover{color:#191b23;background:#e0e1e9}.___SCalendarUnit_flzkf_gg_.focus-visible{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SCalendarUnit_flzkf_gg_:focus-visible{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SCalendarUnit_flzkf_gg_.__today_flzkf_gg_:before{content:\"\";position:absolute;display:block;top:1px;left:1px;border-radius:6px;width:calc(100% - 2px);height:calc(100% - 2px);box-sizing:border-box;border:1px solid #c4c7cf}.___SCalendarUnit_flzkf_gg_.__today_flzkf_gg_.___SCalendarUnit_flzkf_gg_.__endSelected_flzkf_gg_:before,.___SCalendarUnit_flzkf_gg_.__today_flzkf_gg_.___SCalendarUnit_flzkf_gg_.__startSelected_flzkf_gg_:before{border-color:hsla(0,0%,100%,.5)}.___SCalendarUnit_flzkf_gg_.__selected_flzkf_gg_{background:#c4e5fe;border-radius:0;color:#191b23}.___SCalendarUnit_flzkf_gg_.__selected_flzkf_gg_:hover{background:#008ff8}.___SCalendarUnit_flzkf_gg_.__highlighted_flzkf_gg_{background:rgba(0,143,248,.2);border-radius:0;color:#191b23}.___SCalendarUnit_flzkf_gg_.__highlighted_flzkf_gg_:hover{background:rgba(0,143,248,.3)}.___SCalendarUnit_flzkf_gg_.__startSelected_flzkf_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:0;border-top-left-radius:6px;border-top-right-radius:0;color:#fff;background:#2bb3ff}.___SCalendarUnit_flzkf_gg_.__startSelected_flzkf_gg_:hover{color:#fff;background:#008ff8}.___SCalendarUnit_flzkf_gg_.__endSelected_flzkf_gg_{background:#2bb3ff;border-bottom-left-radius:0;border-bottom-right-radius:6px;border-top-left-radius:0;border-top-right-radius:6px;color:#fff}.___SCalendarUnit_flzkf_gg_.__endSelected_flzkf_gg_:hover{color:#fff;background:#008ff8}.___SCalendarUnit_flzkf_gg_.__startHighlighted_flzkf_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:0;border-top-left-radius:6px;border-top-right-radius:0}.___SCalendarUnit_flzkf_gg_.__endHighlighted_flzkf_gg_{border-bottom-left-radius:0;border-bottom-right-radius:6px;border-top-left-radius:0;border-top-right-radius:6px}.___SCalendarUnit_flzkf_gg_.__startHighlighted_flzkf_gg_.___SCalendarUnit_flzkf_gg_.__endHighlighted_flzkf_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}.___SCalendarUnit_flzkf_gg_.__startSelected_flzkf_gg_.___SCalendarUnit_flzkf_gg_.__endSelected_flzkf_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}.___SCalendarUnit_flzkf_gg_.__outdated_flzkf_gg_{opacity:.2}.___SCalendarUnit_flzkf_gg_.__disabled_flzkf_gg_{opacity:.4;cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SCalendarUnit_flzkf_gg_{transition:none}}"
69
+ ".___SCalendar_84cju_gg_{display:flex;flex-direction:column}.___SGridDays_84cju_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto));grid-template-rows:repeat(auto-fit,minmax(32px,auto))}.___SGridMonths_84cju_gg_{display:grid;grid-row-gap:8px;grid-template-columns:repeat(3,minmax(60px,auto));grid-template-rows:repeat(4,minmax(32px,auto))}.___SWeekDays_84cju_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto))}.___SWeekDay_84cju_gg_{min-width:32px;min-height:32px;display:flex;align-items:center;justify-content:center;color:#6c6e79;font-size:14px;font-weight:400;overflow:hidden}.___SCalendarUnit_84cju_gg_{font-family:inherit;font-weight:400;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:#191b23;outline:0;box-shadow:none;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background:transparent;align-items:center;border-radius:6px;box-sizing:border-box;cursor:pointer;display:flex;font-size:14px;justify-content:center;min-height:32px;min-width:32px;position:relative;transition:color .15s,background .15s;outline:none}.___SCalendarUnit_84cju_gg_:hover{color:#191b23;background:#e0e1e9}.___SCalendarUnit_84cju_gg_.focus-visible{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SCalendarUnit_84cju_gg_:focus-visible{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SCalendarUnit_84cju_gg_.__today_84cju_gg_:before{content:\"\";position:absolute;display:block;top:1px;left:1px;border-radius:6px;width:calc(100% - 2px);height:calc(100% - 2px);box-sizing:border-box;border:1px solid #c4c7cf}.___SCalendarUnit_84cju_gg_.__today_84cju_gg_.___SCalendarUnit_84cju_gg_.__endSelected_84cju_gg_:before,.___SCalendarUnit_84cju_gg_.__today_84cju_gg_.___SCalendarUnit_84cju_gg_.__startSelected_84cju_gg_:before{border-color:hsla(0,0%,100%,.5)}.___SCalendarUnit_84cju_gg_.__selected_84cju_gg_{background:#c4e5fe;border-radius:0;color:#191b23}.___SCalendarUnit_84cju_gg_.__selected_84cju_gg_:hover{background:#008ff8}.___SCalendarUnit_84cju_gg_.__highlighted_84cju_gg_{background:rgba(0,143,248,.2);border-radius:0;color:#191b23}.___SCalendarUnit_84cju_gg_.__highlighted_84cju_gg_:hover{background:rgba(0,143,248,.3)}.___SCalendarUnit_84cju_gg_.__startSelected_84cju_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:0;border-top-left-radius:6px;border-top-right-radius:0;color:#fff;background:#2bb3ff}.___SCalendarUnit_84cju_gg_.__startSelected_84cju_gg_:hover{color:#fff;background:#008ff8}.___SCalendarUnit_84cju_gg_.__endSelected_84cju_gg_{background:#2bb3ff;border-bottom-left-radius:0;border-bottom-right-radius:6px;border-top-left-radius:0;border-top-right-radius:6px;color:#fff}.___SCalendarUnit_84cju_gg_.__endSelected_84cju_gg_:hover{color:#fff;background:#008ff8}.___SCalendarUnit_84cju_gg_.__startHighlighted_84cju_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:0;border-top-left-radius:6px;border-top-right-radius:0}.___SCalendarUnit_84cju_gg_.__endHighlighted_84cju_gg_{border-bottom-left-radius:0;border-bottom-right-radius:6px;border-top-left-radius:0;border-top-right-radius:6px}.___SCalendarUnit_84cju_gg_.__startHighlighted_84cju_gg_.___SCalendarUnit_84cju_gg_.__endHighlighted_84cju_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}.___SCalendarUnit_84cju_gg_.__startSelected_84cju_gg_.___SCalendarUnit_84cju_gg_.__endSelected_84cju_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}.___SCalendarUnit_84cju_gg_.__outdated_84cju_gg_{opacity:.2}.___SCalendarUnit_84cju_gg_.__disabled_84cju_gg_{opacity:.4;cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SCalendarUnit_84cju_gg_{transition:none}}"
70
70
  /*__inner_css_end__*/
71
- , "flzkf_gg_")
71
+ , "84cju_gg_")
72
72
  /*__reshadow_css_end__*/
73
73
  , {
74
- "__SCalendar": "___SCalendar_flzkf_gg_",
75
- "__SGridDays": "___SGridDays_flzkf_gg_",
76
- "__SGridMonths": "___SGridMonths_flzkf_gg_",
77
- "__SWeekDays": "___SWeekDays_flzkf_gg_",
78
- "__SWeekDay": "___SWeekDay_flzkf_gg_",
79
- "__SCalendarUnit": "___SCalendarUnit_flzkf_gg_",
80
- "_today": "__today_flzkf_gg_",
81
- "_endSelected": "__endSelected_flzkf_gg_",
82
- "_startSelected": "__startSelected_flzkf_gg_",
83
- "_selected": "__selected_flzkf_gg_",
84
- "_highlighted": "__highlighted_flzkf_gg_",
85
- "_startHighlighted": "__startHighlighted_flzkf_gg_",
86
- "_endHighlighted": "__endHighlighted_flzkf_gg_",
87
- "_outdated": "__outdated_flzkf_gg_",
88
- "_disabled": "__disabled_flzkf_gg_"
74
+ "__SCalendar": "___SCalendar_84cju_gg_",
75
+ "__SGridDays": "___SGridDays_84cju_gg_",
76
+ "__SGridMonths": "___SGridMonths_84cju_gg_",
77
+ "__SWeekDays": "___SWeekDays_84cju_gg_",
78
+ "__SWeekDay": "___SWeekDay_84cju_gg_",
79
+ "__SCalendarUnit": "___SCalendarUnit_84cju_gg_",
80
+ "_today": "__today_84cju_gg_",
81
+ "_endSelected": "__endSelected_84cju_gg_",
82
+ "_startSelected": "__startSelected_84cju_gg_",
83
+ "_selected": "__selected_84cju_gg_",
84
+ "_highlighted": "__highlighted_84cju_gg_",
85
+ "_startHighlighted": "__startHighlighted_84cju_gg_",
86
+ "_endHighlighted": "__endHighlighted_84cju_gg_",
87
+ "_outdated": "__outdated_84cju_gg_",
88
+ "_disabled": "__disabled_84cju_gg_"
89
89
  });
90
90
 
91
91
  _dayjs["default"].extend(_isBetween["default"]);
@@ -64,16 +64,16 @@ var style = (
64
64
  /*__reshadow_css_start__*/
65
65
  _core.sstyled.insert(
66
66
  /*__inner_css_start__*/
67
- ".___SPopper_1wrcu_gg_{padding:16px;outline:0}.___SPopper_1wrcu_gg_::-moz-focus-inner{border:none;padding:0}.___SPopper_1wrcu_gg_:active,.___SPopper_1wrcu_gg_:focus,.___SPopper_1wrcu_gg_:hover{outline:0;text-decoration:none}.___SPopper_1wrcu_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SHeader_1wrcu_gg_{display:flex;align-items:center}.___STitle_1wrcu_gg_{font-size:14px;color:#191b23;height:32px;width:100%;display:flex;justify-content:center;align-items:center}.___SToday_1wrcu_gg_{display:flex;margin-top:12px;justify-content:center}.___SPeriod_1wrcu_gg_{display:flex;flex-direction:column;margin-bottom:8px}"
67
+ ".___SPopper_h465c_gg_{padding:16px;outline:0}.___SPopper_h465c_gg_::-moz-focus-inner{border:none;padding:0}.___SPopper_h465c_gg_:active,.___SPopper_h465c_gg_:focus,.___SPopper_h465c_gg_:hover{outline:0;text-decoration:none}.___SPopper_h465c_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SHeader_h465c_gg_{display:flex;align-items:center}.___STitle_h465c_gg_{font-size:14px;color:#191b23;height:32px;width:100%;display:flex;justify-content:center;align-items:center}.___SToday_h465c_gg_{display:flex;margin-top:12px;justify-content:center}.___SPeriod_h465c_gg_{display:flex;flex-direction:column;margin-bottom:8px}"
68
68
  /*__inner_css_end__*/
69
- , "1wrcu_gg_")
69
+ , "h465c_gg_")
70
70
  /*__reshadow_css_end__*/
71
71
  , {
72
- "__SPopper": "___SPopper_1wrcu_gg_",
73
- "__SHeader": "___SHeader_1wrcu_gg_",
74
- "__STitle": "___STitle_1wrcu_gg_",
75
- "__SToday": "___SToday_1wrcu_gg_",
76
- "__SPeriod": "___SPeriod_1wrcu_gg_"
72
+ "__SPopper": "___SPopper_h465c_gg_",
73
+ "__SHeader": "___SHeader_h465c_gg_",
74
+ "__STitle": "___STitle_h465c_gg_",
75
+ "__SToday": "___SToday_h465c_gg_",
76
+ "__SPeriod": "___SPeriod_h465c_gg_"
77
77
  });
78
78
  var i18n = {
79
79
  de: _de["default"],
@@ -72,16 +72,16 @@ var style = (
72
72
  /*__reshadow_css_start__*/
73
73
  _core.sstyled.insert(
74
74
  /*__inner_css_start__*/
75
- ".___SPopper_1wrcu_gg_{padding:16px;outline:0}.___SPopper_1wrcu_gg_::-moz-focus-inner{border:none;padding:0}.___SPopper_1wrcu_gg_:active,.___SPopper_1wrcu_gg_:focus,.___SPopper_1wrcu_gg_:hover{outline:0;text-decoration:none}.___SPopper_1wrcu_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SHeader_1wrcu_gg_{display:flex;align-items:center}.___STitle_1wrcu_gg_{font-size:14px;color:#191b23;height:32px;width:100%;display:flex;justify-content:center;align-items:center}.___SToday_1wrcu_gg_{display:flex;margin-top:12px;justify-content:center}.___SPeriod_1wrcu_gg_{display:flex;flex-direction:column;margin-bottom:8px}"
75
+ ".___SPopper_h465c_gg_{padding:16px;outline:0}.___SPopper_h465c_gg_::-moz-focus-inner{border:none;padding:0}.___SPopper_h465c_gg_:active,.___SPopper_h465c_gg_:focus,.___SPopper_h465c_gg_:hover{outline:0;text-decoration:none}.___SPopper_h465c_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SHeader_h465c_gg_{display:flex;align-items:center}.___STitle_h465c_gg_{font-size:14px;color:#191b23;height:32px;width:100%;display:flex;justify-content:center;align-items:center}.___SToday_h465c_gg_{display:flex;margin-top:12px;justify-content:center}.___SPeriod_h465c_gg_{display:flex;flex-direction:column;margin-bottom:8px}"
76
76
  /*__inner_css_end__*/
77
- , "1wrcu_gg_")
77
+ , "h465c_gg_")
78
78
  /*__reshadow_css_end__*/
79
79
  , {
80
- "__SPopper": "___SPopper_1wrcu_gg_",
81
- "__SHeader": "___SHeader_1wrcu_gg_",
82
- "__STitle": "___STitle_1wrcu_gg_",
83
- "__SToday": "___SToday_1wrcu_gg_",
84
- "__SPeriod": "___SPeriod_1wrcu_gg_"
80
+ "__SPopper": "___SPopper_h465c_gg_",
81
+ "__SHeader": "___SHeader_h465c_gg_",
82
+ "__STitle": "___STitle_h465c_gg_",
83
+ "__SToday": "___SToday_h465c_gg_",
84
+ "__SPeriod": "___SPeriod_h465c_gg_"
85
85
  });
86
86
  var i18n = {
87
87
  de: _de["default"],
@@ -132,12 +132,12 @@ var stylesBtn = (
132
132
  /*__reshadow_css_start__*/
133
133
  _core.sstyled.insert(
134
134
  /*__inner_css_start__*/
135
- ".___SInner_1hyup_gg_{justify-content:flex-start}"
135
+ ".___SInner_19b66_gg_{justify-content:flex-start}"
136
136
  /*__inner_css_end__*/
137
- , "1hyup_gg_")
137
+ , "19b66_gg_")
138
138
  /*__reshadow_css_end__*/
139
139
  , {
140
- "__SInner": "___SInner_1hyup_gg_"
140
+ "__SInner": "___SInner_19b66_gg_"
141
141
  });
142
142
 
143
143
  var Period = /*#__PURE__*/function (_Component) {
@@ -56,7 +56,7 @@ function shortDateRangeFormat(dates, _ref) {
56
56
 
57
57
  return "".concat(new Intl.DateTimeFormat(locale, {
58
58
  month: options.month
59
- }).format(normalizeDates[0]), " ").concat(normalizeDates[0].getDate(), " - ").concat(normalizeDates[1].getDate(), ", ").concat(normalizeDates[0].getFullYear());
59
+ }).format(normalizeDates[0]), " ").concat(normalizeDates[0].getDate(), "-").concat(normalizeDates[1].getDate(), ", ").concat(normalizeDates[0].getFullYear());
60
60
  }
61
61
 
62
62
  if (isSimilarDay) {
@@ -65,7 +65,7 @@ function shortDateRangeFormat(dates, _ref) {
65
65
  }).format(normalizeDates[0]), " ").concat(normalizeDates[0].getFullYear());
66
66
  }
67
67
 
68
- return "".concat(normalizeDates[0].getDate(), " - ").concat(normalizeDates[1].getDate(), " ").concat(new Intl.DateTimeFormat(locale, {
68
+ return "".concat(normalizeDates[0].getDate(), "-").concat(normalizeDates[1].getDate(), " ").concat(new Intl.DateTimeFormat(locale, {
69
69
  month: options.month
70
70
  }).format(normalizeDates[0]), " ").concat(normalizeDates[0].getFullYear());
71
71
  }
@@ -76,13 +76,13 @@ function shortDateRangeFormat(dates, _ref) {
76
76
  newOptions = (0, _objectWithoutProperties2["default"])(options, _excluded2);
77
77
 
78
78
  if (getDayJSLocale(locale) === 'en') {
79
- return "".concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[0]), " - ").concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[1]), ", ").concat(normalizeDates[0].getFullYear());
79
+ return "".concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[0]), "-").concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[1]), ", ").concat(normalizeDates[0].getFullYear());
80
80
  }
81
81
 
82
- return "".concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[0]), " - ").concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[1]), " ").concat(normalizeDates[0].getFullYear());
82
+ return "".concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[0]), "-").concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[1]), " ").concat(normalizeDates[0].getFullYear());
83
83
  }
84
84
 
85
- return "".concat(format(normalizeDates[0]), " - ").concat(format(normalizeDates[1]));
85
+ return "".concat(format(normalizeDates[0]), "-").concat(format(normalizeDates[1]));
86
86
  }
87
87
 
88
88
  return format(normalizeDates[0]);
@@ -1 +1 @@
1
- {"version":3,"file":"shortDateRangeFormat.js","names":["getDayJSLocale","locale","includes","shortDateRangeFormat","dates","options","Intl","DateTimeFormat","format","normalizeDates","map","date","dayjs","toDate","monthsYears","month","year","length","isSimilarDay","isSimilarMonth","isSimilarYear","day","getDate","getFullYear","newOptions"],"sources":["../../../src/utils/shortDateRangeFormat.js"],"sourcesContent":["import dayjs from 'dayjs';\n\nfunction getDayJSLocale(locale) {\n if (locale.includes('en') || locale.includes('ja')) {\n return 'en';\n }\n return 'ru';\n}\n\nexport default function shortDateRangeFormat(dates, { locale = 'en-US', ...options }) {\n const { format } = new Intl.DateTimeFormat(locale, options);\n const normalizeDates = dates.map((date) => dayjs(date).toDate());\n const monthsYears = dates.map((date) => [\n dayjs(date).date(),\n dayjs(date).month(),\n dayjs(date).year(),\n ]);\n\n if (monthsYears.length > 1) {\n const isSimilarDay = monthsYears[0][0] === monthsYears[1][0];\n const isSimilarMonth = monthsYears[0][1] === monthsYears[1][1];\n const isSimilarYear = monthsYears[0][2] === monthsYears[1][2];\n\n if (isSimilarMonth && isSimilarYear && !options.day) {\n return format(normalizeDates[0]);\n }\n if (isSimilarMonth && isSimilarYear) {\n if (getDayJSLocale(locale) === 'en') {\n if (isSimilarDay) {\n return `${new Intl.DateTimeFormat(locale, { month: options.month }).format(\n normalizeDates[0],\n )} ${normalizeDates[0].getDate()}, ${normalizeDates[0].getFullYear()}`;\n }\n return `${new Intl.DateTimeFormat(locale, { month: options.month }).format(\n normalizeDates[0],\n )} ${normalizeDates[0].getDate()} - ${normalizeDates[1].getDate()}, ${normalizeDates[0].getFullYear()}`;\n }\n if (isSimilarDay) {\n return `${normalizeDates[0].getDate()} ${new Intl.DateTimeFormat(locale, {\n month: options.month,\n }).format(normalizeDates[0])} ${normalizeDates[0].getFullYear()}`;\n }\n return `${normalizeDates[0].getDate()} - ${normalizeDates[1].getDate()} ${new Intl.DateTimeFormat(\n locale,\n { month: options.month },\n ).format(normalizeDates[0])} ${normalizeDates[0].getFullYear()}`;\n }\n\n if (isSimilarYear) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { year, ...newOptions } = options;\n if (getDayJSLocale(locale) === 'en') {\n return `${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[0],\n )} - ${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[1],\n )}, ${normalizeDates[0].getFullYear()}`;\n }\n return `${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[0],\n )} - ${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[1],\n )} ${normalizeDates[0].getFullYear()}`;\n }\n\n return `${format(normalizeDates[0])} - ${format(normalizeDates[1])}`;\n }\n\n return format(normalizeDates[0]);\n}\n"],"mappings":";;;;;;;;;;;AAAA;;;;;AAEA,SAASA,cAAT,CAAwBC,MAAxB,EAAgC;EAC9B,IAAIA,MAAM,CAACC,QAAP,CAAgB,IAAhB,KAAyBD,MAAM,CAACC,QAAP,CAAgB,IAAhB,CAA7B,EAAoD;IAClD,OAAO,IAAP;EACD;;EACD,OAAO,IAAP;AACD;;AAEc,SAASC,oBAAT,CAA8BC,KAA9B,QAAuE;EAAA,uBAAhCH,MAAgC;EAAA,IAAhCA,MAAgC,4BAAvB,OAAuB;EAAA,IAAXI,OAAW;;EACpF,2BAAmB,IA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R,GAAgCX,OAAhC,CAAQW,IAAR;MAAA,IAAiBQ,UAAjB,6CAAgCnB,OAAhC;;MACA,IAAIL,cAAc,CAACC,MAAD,CAAd,KAA2B,IAA/B,EAAqC;QACnC,iBAAU,IAAIK,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCuB,UAAhC,EAA4ChB,MAA5C,CACRC,cAAc,CAAC,CAAD,CADN,CAAV,gBAEO,IAAIH,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCuB,UAAhC,EAA4ChB,MAA5C,CACLC,cAAc,CAAC,CAAD,CADT,CAFP,eAIMA,cAAc,CAAC,CAAD,CAAd,CAAkBc,WAAlB,EAJN;MAKD;;MACD,iBAAU,IAAIjB,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCuB,UAAhC,EAA4ChB,MAA5C,CACRC,cAAc,CAAC,CAAD,CADN,CAAV,gBAEO,IAAIH,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCuB,UAAhC,EAA4ChB,MAA5C,CACLC,cAAc,CAAC,CAAD,CADT,CAFP,cAIKA,cAAc,CAAC,CAAD,CAAd,CAAkBc,WAAlB,EAJL;IAKD;;IAED,iBAAUf,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAAhB,gBAAyCD,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAA/C;EACD;;EAED,OAAOD,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAAb;AACD"}
1
+ {"version":3,"file":"shortDateRangeFormat.js","names":["getDayJSLocale","locale","includes","shortDateRangeFormat","dates","options","Intl","DateTimeFormat","format","normalizeDates","map","date","dayjs","toDate","monthsYears","month","year","length","isSimilarDay","isSimilarMonth","isSimilarYear","day","getDate","getFullYear","newOptions"],"sources":["../../../src/utils/shortDateRangeFormat.js"],"sourcesContent":["import dayjs from 'dayjs';\n\nfunction getDayJSLocale(locale) {\n if (locale.includes('en') || locale.includes('ja')) {\n return 'en';\n }\n return 'ru';\n}\n\nexport default function shortDateRangeFormat(dates, { locale = 'en-US', ...options }) {\n const { format } = new Intl.DateTimeFormat(locale, options);\n const normalizeDates = dates.map((date) => dayjs(date).toDate());\n const monthsYears = dates.map((date) => [\n dayjs(date).date(),\n dayjs(date).month(),\n dayjs(date).year(),\n ]);\n\n if (monthsYears.length > 1) {\n const isSimilarDay = monthsYears[0][0] === monthsYears[1][0];\n const isSimilarMonth = monthsYears[0][1] === monthsYears[1][1];\n const isSimilarYear = monthsYears[0][2] === monthsYears[1][2];\n\n if (isSimilarMonth && isSimilarYear && !options.day) {\n return format(normalizeDates[0]);\n }\n if (isSimilarMonth && isSimilarYear) {\n if (getDayJSLocale(locale) === 'en') {\n if (isSimilarDay) {\n return `${new Intl.DateTimeFormat(locale, { month: options.month }).format(\n normalizeDates[0],\n )} ${normalizeDates[0].getDate()}, ${normalizeDates[0].getFullYear()}`;\n }\n return `${new Intl.DateTimeFormat(locale, { month: options.month }).format(\n normalizeDates[0],\n )} ${normalizeDates[0].getDate()}-${normalizeDates[1].getDate()}, ${normalizeDates[0].getFullYear()}`;\n }\n if (isSimilarDay) {\n return `${normalizeDates[0].getDate()} ${new Intl.DateTimeFormat(locale, {\n month: options.month,\n }).format(normalizeDates[0])} ${normalizeDates[0].getFullYear()}`;\n }\n return `${normalizeDates[0].getDate()}-${normalizeDates[1].getDate()} ${new Intl.DateTimeFormat(\n locale,\n { month: options.month },\n ).format(normalizeDates[0])} ${normalizeDates[0].getFullYear()}`;\n }\n\n if (isSimilarYear) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { year, ...newOptions } = options;\n if (getDayJSLocale(locale) === 'en') {\n return `${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[0],\n )}-${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[1],\n )}, ${normalizeDates[0].getFullYear()}`;\n }\n return `${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[0],\n )}-${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[1],\n )} ${normalizeDates[0].getFullYear()}`;\n }\n\n return `${format(normalizeDates[0])}-${format(normalizeDates[1])}`;\n }\n\n return format(normalizeDates[0]);\n}\n"],"mappings":";;;;;;;;;;;AAAA;;;;;AAEA,SAASA,cAAT,CAAwBC,MAAxB,EAAgC;EAC9B,IAAIA,MAAM,CAACC,QAAP,CAAgB,IAAhB,KAAyBD,MAAM,CAACC,QAAP,CAAgB,IAAhB,CAA7B,EAAoD;IAClD,OAAO,IAAP;EACD;;EACD,OAAO,IAAP;AACD;;AAEc,SAASC,oBAAT,CAA8BC,KAA9B,QAAuE;EAAA,uBAAhCH,MAAgC;EAAA,IAAhCA,MAAgC,4BAAvB,OAAuB;EAAA,IAAXI,OAAW;;EACpF,2BAAmB,IAAIC,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCI,OAAhC,CAAnB;EAAA,IAAQG,MAAR,wBAAQA,MAAR;;EACA,IAAMC,cAAc,GAAGL,KAAK,CAACM,GAAN,CAAU,UAACC,IAAD;IAAA,OAAU,IAAAC,iBAAA,EAAMD,IAAN,EAAYE,MAAZ,EAAV;EAAA,CAAV,CAAvB;EACA,IAAMC,WAAW,GAAGV,KAAK,CAACM,GAAN,CAAU,UAACC,IAAD;IAAA,OAAU,CACtC,IAAAC,iBAAA,EAAMD,IAAN,EAAYA,IAAZ,EADsC,EAEtC,IAAAC,iBAAA,EAAMD,IAAN,EAAYI,KAAZ,EAFsC,EAGtC,IAAAH,iBAAA,EAAMD,IAAN,EAAYK,IAAZ,EAHsC,CAAV;EAAA,CAAV,CAApB;;EAMA,IAAIF,WAAW,CAACG,MAAZ,GAAqB,CAAzB,EAA4B;IAC1B,IAAMC,YAAY,GAAGJ,WAAW,CAAC,CAAD,CAAX,CAAe,CAAf,MAAsBA,WAAW,CAAC,CAAD,CAAX,CAAe,CAAf,CAA3C;IACA,IAAMK,cAAc,GAAGL,WAAW,CAAC,CAAD,CAAX,CAAe,CAAf,MAAsBA,WAAW,CAAC,C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CAAC,CAAD,CAAf,CAAhB,cAAuCD,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAA7C;EACD;;EAED,OAAOD,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAAb;AACD"}
@@ -38,26 +38,26 @@ var style = (
38
38
  /*__reshadow_css_start__*/
39
39
  _sstyled.insert(
40
40
  /*__inner_css_start__*/
41
- ".___SCalendar_flzkf_gg_{display:flex;flex-direction:column}.___SGridDays_flzkf_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto));grid-template-rows:repeat(auto-fit,minmax(32px,auto))}.___SGridMonths_flzkf_gg_{display:grid;grid-row-gap:8px;grid-template-columns:repeat(3,minmax(60px,auto));grid-template-rows:repeat(4,minmax(32px,auto))}.___SWeekDays_flzkf_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto))}.___SWeekDay_flzkf_gg_{min-width:32px;min-height:32px;display:flex;align-items:center;justify-content:center;color:#6c6e79;font-size:14px;font-weight:400;overflow:hidden}.___SCalendarUnit_flzkf_gg_{font-family:inherit;font-weight:400;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:#191b23;outline:0;box-shadow:none;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background:transparent;align-items:center;border-radius:6px;box-sizing:border-box;cursor:pointer;display:flex;font-size:14px;justify-content:center;min-height:32px;min-width:32px;position:relative;transition:color .15s,background .15s;outline:none}.___SCalendarUnit_flzkf_gg_:hover{color:#191b23;background:#e0e1e9}.___SCalendarUnit_flzkf_gg_.focus-visible{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SCalendarUnit_flzkf_gg_:focus-visible{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SCalendarUnit_flzkf_gg_.__today_flzkf_gg_:before{content:\"\";position:absolute;display:block;top:1px;left:1px;border-radius:6px;width:calc(100% - 2px);height:calc(100% - 2px);box-sizing:border-box;border:1px solid #c4c7cf}.___SCalendarUnit_flzkf_gg_.__today_flzkf_gg_.___SCalendarUnit_flzkf_gg_.__endSelected_flzkf_gg_:before,.___SCalendarUnit_flzkf_gg_.__today_flzkf_gg_.___SCalendarUnit_flzkf_gg_.__startSelected_flzkf_gg_:before{border-color:hsla(0,0%,100%,.5)}.___SCalendarUnit_flzkf_gg_.__selected_flzkf_gg_{background:#c4e5fe;border-radius:0;color:#191b23}.___SCalendarUnit_flzkf_gg_.__selected_flzkf_gg_:hover{background:#008ff8}.___SCalendarUnit_flzkf_gg_.__highlighted_flzkf_gg_{background:rgba(0,143,248,.2);border-radius:0;color:#191b23}.___SCalendarUnit_flzkf_gg_.__highlighted_flzkf_gg_:hover{background:rgba(0,143,248,.3)}.___SCalendarUnit_flzkf_gg_.__startSelected_flzkf_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:0;border-top-left-radius:6px;border-top-right-radius:0;color:#fff;background:#2bb3ff}.___SCalendarUnit_flzkf_gg_.__startSelected_flzkf_gg_:hover{color:#fff;background:#008ff8}.___SCalendarUnit_flzkf_gg_.__endSelected_flzkf_gg_{background:#2bb3ff;border-bottom-left-radius:0;border-bottom-right-radius:6px;border-top-left-radius:0;border-top-right-radius:6px;color:#fff}.___SCalendarUnit_flzkf_gg_.__endSelected_flzkf_gg_:hover{color:#fff;background:#008ff8}.___SCalendarUnit_flzkf_gg_.__startHighlighted_flzkf_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:0;border-top-left-radius:6px;border-top-right-radius:0}.___SCalendarUnit_flzkf_gg_.__endHighlighted_flzkf_gg_{border-bottom-left-radius:0;border-bottom-right-radius:6px;border-top-left-radius:0;border-top-right-radius:6px}.___SCalendarUnit_flzkf_gg_.__startHighlighted_flzkf_gg_.___SCalendarUnit_flzkf_gg_.__endHighlighted_flzkf_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}.___SCalendarUnit_flzkf_gg_.__startSelected_flzkf_gg_.___SCalendarUnit_flzkf_gg_.__endSelected_flzkf_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}.___SCalendarUnit_flzkf_gg_.__outdated_flzkf_gg_{opacity:.2}.___SCalendarUnit_flzkf_gg_.__disabled_flzkf_gg_{opacity:.4;cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SCalendarUnit_flzkf_gg_{transition:none}}"
41
+ ".___SCalendar_84cju_gg_{display:flex;flex-direction:column}.___SGridDays_84cju_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto));grid-template-rows:repeat(auto-fit,minmax(32px,auto))}.___SGridMonths_84cju_gg_{display:grid;grid-row-gap:8px;grid-template-columns:repeat(3,minmax(60px,auto));grid-template-rows:repeat(4,minmax(32px,auto))}.___SWeekDays_84cju_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto))}.___SWeekDay_84cju_gg_{min-width:32px;min-height:32px;display:flex;align-items:center;justify-content:center;color:#6c6e79;font-size:14px;font-weight:400;overflow:hidden}.___SCalendarUnit_84cju_gg_{font-family:inherit;font-weight:400;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:#191b23;outline:0;box-shadow:none;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background:transparent;align-items:center;border-radius:6px;box-sizing:border-box;cursor:pointer;display:flex;font-size:14px;justify-content:center;min-height:32px;min-width:32px;position:relative;transition:color .15s,background .15s;outline:none}.___SCalendarUnit_84cju_gg_:hover{color:#191b23;background:#e0e1e9}.___SCalendarUnit_84cju_gg_.focus-visible{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SCalendarUnit_84cju_gg_:focus-visible{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SCalendarUnit_84cju_gg_.__today_84cju_gg_:before{content:\"\";position:absolute;display:block;top:1px;left:1px;border-radius:6px;width:calc(100% - 2px);height:calc(100% - 2px);box-sizing:border-box;border:1px solid #c4c7cf}.___SCalendarUnit_84cju_gg_.__today_84cju_gg_.___SCalendarUnit_84cju_gg_.__endSelected_84cju_gg_:before,.___SCalendarUnit_84cju_gg_.__today_84cju_gg_.___SCalendarUnit_84cju_gg_.__startSelected_84cju_gg_:before{border-color:hsla(0,0%,100%,.5)}.___SCalendarUnit_84cju_gg_.__selected_84cju_gg_{background:#c4e5fe;border-radius:0;color:#191b23}.___SCalendarUnit_84cju_gg_.__selected_84cju_gg_:hover{background:#008ff8}.___SCalendarUnit_84cju_gg_.__highlighted_84cju_gg_{background:rgba(0,143,248,.2);border-radius:0;color:#191b23}.___SCalendarUnit_84cju_gg_.__highlighted_84cju_gg_:hover{background:rgba(0,143,248,.3)}.___SCalendarUnit_84cju_gg_.__startSelected_84cju_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:0;border-top-left-radius:6px;border-top-right-radius:0;color:#fff;background:#2bb3ff}.___SCalendarUnit_84cju_gg_.__startSelected_84cju_gg_:hover{color:#fff;background:#008ff8}.___SCalendarUnit_84cju_gg_.__endSelected_84cju_gg_{background:#2bb3ff;border-bottom-left-radius:0;border-bottom-right-radius:6px;border-top-left-radius:0;border-top-right-radius:6px;color:#fff}.___SCalendarUnit_84cju_gg_.__endSelected_84cju_gg_:hover{color:#fff;background:#008ff8}.___SCalendarUnit_84cju_gg_.__startHighlighted_84cju_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:0;border-top-left-radius:6px;border-top-right-radius:0}.___SCalendarUnit_84cju_gg_.__endHighlighted_84cju_gg_{border-bottom-left-radius:0;border-bottom-right-radius:6px;border-top-left-radius:0;border-top-right-radius:6px}.___SCalendarUnit_84cju_gg_.__startHighlighted_84cju_gg_.___SCalendarUnit_84cju_gg_.__endHighlighted_84cju_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}.___SCalendarUnit_84cju_gg_.__startSelected_84cju_gg_.___SCalendarUnit_84cju_gg_.__endSelected_84cju_gg_{border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}.___SCalendarUnit_84cju_gg_.__outdated_84cju_gg_{opacity:.2}.___SCalendarUnit_84cju_gg_.__disabled_84cju_gg_{opacity:.4;cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SCalendarUnit_84cju_gg_{transition:none}}"
42
42
  /*__inner_css_end__*/
43
- , "flzkf_gg_")
43
+ , "84cju_gg_")
44
44
  /*__reshadow_css_end__*/
45
45
  , {
46
- "__SCalendar": "___SCalendar_flzkf_gg_",
47
- "__SGridDays": "___SGridDays_flzkf_gg_",
48
- "__SGridMonths": "___SGridMonths_flzkf_gg_",
49
- "__SWeekDays": "___SWeekDays_flzkf_gg_",
50
- "__SWeekDay": "___SWeekDay_flzkf_gg_",
51
- "__SCalendarUnit": "___SCalendarUnit_flzkf_gg_",
52
- "_today": "__today_flzkf_gg_",
53
- "_endSelected": "__endSelected_flzkf_gg_",
54
- "_startSelected": "__startSelected_flzkf_gg_",
55
- "_selected": "__selected_flzkf_gg_",
56
- "_highlighted": "__highlighted_flzkf_gg_",
57
- "_startHighlighted": "__startHighlighted_flzkf_gg_",
58
- "_endHighlighted": "__endHighlighted_flzkf_gg_",
59
- "_outdated": "__outdated_flzkf_gg_",
60
- "_disabled": "__disabled_flzkf_gg_"
46
+ "__SCalendar": "___SCalendar_84cju_gg_",
47
+ "__SGridDays": "___SGridDays_84cju_gg_",
48
+ "__SGridMonths": "___SGridMonths_84cju_gg_",
49
+ "__SWeekDays": "___SWeekDays_84cju_gg_",
50
+ "__SWeekDay": "___SWeekDay_84cju_gg_",
51
+ "__SCalendarUnit": "___SCalendarUnit_84cju_gg_",
52
+ "_today": "__today_84cju_gg_",
53
+ "_endSelected": "__endSelected_84cju_gg_",
54
+ "_startSelected": "__startSelected_84cju_gg_",
55
+ "_selected": "__selected_84cju_gg_",
56
+ "_highlighted": "__highlighted_84cju_gg_",
57
+ "_startHighlighted": "__startHighlighted_84cju_gg_",
58
+ "_endHighlighted": "__endHighlighted_84cju_gg_",
59
+ "_outdated": "__outdated_84cju_gg_",
60
+ "_disabled": "__disabled_84cju_gg_"
61
61
  });
62
62
  dayjs.extend(isBetween);
63
63
 
@@ -34,16 +34,16 @@ var style = (
34
34
  /*__reshadow_css_start__*/
35
35
  _sstyled.insert(
36
36
  /*__inner_css_start__*/
37
- ".___SPopper_1wrcu_gg_{padding:16px;outline:0}.___SPopper_1wrcu_gg_::-moz-focus-inner{border:none;padding:0}.___SPopper_1wrcu_gg_:active,.___SPopper_1wrcu_gg_:focus,.___SPopper_1wrcu_gg_:hover{outline:0;text-decoration:none}.___SPopper_1wrcu_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SHeader_1wrcu_gg_{display:flex;align-items:center}.___STitle_1wrcu_gg_{font-size:14px;color:#191b23;height:32px;width:100%;display:flex;justify-content:center;align-items:center}.___SToday_1wrcu_gg_{display:flex;margin-top:12px;justify-content:center}.___SPeriod_1wrcu_gg_{display:flex;flex-direction:column;margin-bottom:8px}"
37
+ ".___SPopper_h465c_gg_{padding:16px;outline:0}.___SPopper_h465c_gg_::-moz-focus-inner{border:none;padding:0}.___SPopper_h465c_gg_:active,.___SPopper_h465c_gg_:focus,.___SPopper_h465c_gg_:hover{outline:0;text-decoration:none}.___SPopper_h465c_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SHeader_h465c_gg_{display:flex;align-items:center}.___STitle_h465c_gg_{font-size:14px;color:#191b23;height:32px;width:100%;display:flex;justify-content:center;align-items:center}.___SToday_h465c_gg_{display:flex;margin-top:12px;justify-content:center}.___SPeriod_h465c_gg_{display:flex;flex-direction:column;margin-bottom:8px}"
38
38
  /*__inner_css_end__*/
39
- , "1wrcu_gg_")
39
+ , "h465c_gg_")
40
40
  /*__reshadow_css_end__*/
41
41
  , {
42
- "__SPopper": "___SPopper_1wrcu_gg_",
43
- "__SHeader": "___SHeader_1wrcu_gg_",
44
- "__STitle": "___STitle_1wrcu_gg_",
45
- "__SToday": "___SToday_1wrcu_gg_",
46
- "__SPeriod": "___SPeriod_1wrcu_gg_"
42
+ "__SPopper": "___SPopper_h465c_gg_",
43
+ "__SHeader": "___SHeader_h465c_gg_",
44
+ "__STitle": "___STitle_h465c_gg_",
45
+ "__SToday": "___SToday_h465c_gg_",
46
+ "__SPeriod": "___SPeriod_h465c_gg_"
47
47
  });
48
48
  import includesDate from '../utils/includesDate';
49
49
  var i18n = {
@@ -40,16 +40,16 @@ var style = (
40
40
  /*__reshadow_css_start__*/
41
41
  _sstyled.insert(
42
42
  /*__inner_css_start__*/
43
- ".___SPopper_1wrcu_gg_{padding:16px;outline:0}.___SPopper_1wrcu_gg_::-moz-focus-inner{border:none;padding:0}.___SPopper_1wrcu_gg_:active,.___SPopper_1wrcu_gg_:focus,.___SPopper_1wrcu_gg_:hover{outline:0;text-decoration:none}.___SPopper_1wrcu_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SHeader_1wrcu_gg_{display:flex;align-items:center}.___STitle_1wrcu_gg_{font-size:14px;color:#191b23;height:32px;width:100%;display:flex;justify-content:center;align-items:center}.___SToday_1wrcu_gg_{display:flex;margin-top:12px;justify-content:center}.___SPeriod_1wrcu_gg_{display:flex;flex-direction:column;margin-bottom:8px}"
43
+ ".___SPopper_h465c_gg_{padding:16px;outline:0}.___SPopper_h465c_gg_::-moz-focus-inner{border:none;padding:0}.___SPopper_h465c_gg_:active,.___SPopper_h465c_gg_:focus,.___SPopper_h465c_gg_:hover{outline:0;text-decoration:none}.___SPopper_h465c_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SHeader_h465c_gg_{display:flex;align-items:center}.___STitle_h465c_gg_{font-size:14px;color:#191b23;height:32px;width:100%;display:flex;justify-content:center;align-items:center}.___SToday_h465c_gg_{display:flex;margin-top:12px;justify-content:center}.___SPeriod_h465c_gg_{display:flex;flex-direction:column;margin-bottom:8px}"
44
44
  /*__inner_css_end__*/
45
- , "1wrcu_gg_")
45
+ , "h465c_gg_")
46
46
  /*__reshadow_css_end__*/
47
47
  , {
48
- "__SPopper": "___SPopper_1wrcu_gg_",
49
- "__SHeader": "___SHeader_1wrcu_gg_",
50
- "__STitle": "___STitle_1wrcu_gg_",
51
- "__SToday": "___SToday_1wrcu_gg_",
52
- "__SPeriod": "___SPeriod_1wrcu_gg_"
48
+ "__SPopper": "___SPopper_h465c_gg_",
49
+ "__SHeader": "___SHeader_h465c_gg_",
50
+ "__STitle": "___STitle_h465c_gg_",
51
+ "__SToday": "___SToday_h465c_gg_",
52
+ "__SPeriod": "___SPeriod_h465c_gg_"
53
53
  });
54
54
  var i18n = {
55
55
  de: de,
@@ -96,12 +96,12 @@ var stylesBtn = (
96
96
  /*__reshadow_css_start__*/
97
97
  sstyled.insert(
98
98
  /*__inner_css_start__*/
99
- ".___SInner_1hyup_gg_{justify-content:flex-start}"
99
+ ".___SInner_19b66_gg_{justify-content:flex-start}"
100
100
  /*__inner_css_end__*/
101
- , "1hyup_gg_")
101
+ , "19b66_gg_")
102
102
  /*__reshadow_css_end__*/
103
103
  , {
104
- "__SInner": "___SInner_1hyup_gg_"
104
+ "__SInner": "___SInner_19b66_gg_"
105
105
  });
106
106
  export var Period = /*#__PURE__*/function (_Component) {
107
107
  _inherits(Period, _Component);
@@ -45,7 +45,7 @@ export default function shortDateRangeFormat(dates, _ref) {
45
45
 
46
46
  return "".concat(new Intl.DateTimeFormat(locale, {
47
47
  month: options.month
48
- }).format(normalizeDates[0]), " ").concat(normalizeDates[0].getDate(), " - ").concat(normalizeDates[1].getDate(), ", ").concat(normalizeDates[0].getFullYear());
48
+ }).format(normalizeDates[0]), " ").concat(normalizeDates[0].getDate(), "-").concat(normalizeDates[1].getDate(), ", ").concat(normalizeDates[0].getFullYear());
49
49
  }
50
50
 
51
51
  if (isSimilarDay) {
@@ -54,7 +54,7 @@ export default function shortDateRangeFormat(dates, _ref) {
54
54
  }).format(normalizeDates[0]), " ").concat(normalizeDates[0].getFullYear());
55
55
  }
56
56
 
57
- return "".concat(normalizeDates[0].getDate(), " - ").concat(normalizeDates[1].getDate(), " ").concat(new Intl.DateTimeFormat(locale, {
57
+ return "".concat(normalizeDates[0].getDate(), "-").concat(normalizeDates[1].getDate(), " ").concat(new Intl.DateTimeFormat(locale, {
58
58
  month: options.month
59
59
  }).format(normalizeDates[0]), " ").concat(normalizeDates[0].getFullYear());
60
60
  }
@@ -65,13 +65,13 @@ export default function shortDateRangeFormat(dates, _ref) {
65
65
  newOptions = _objectWithoutProperties(options, _excluded2);
66
66
 
67
67
  if (getDayJSLocale(locale) === 'en') {
68
- return "".concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[0]), " - ").concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[1]), ", ").concat(normalizeDates[0].getFullYear());
68
+ return "".concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[0]), "-").concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[1]), ", ").concat(normalizeDates[0].getFullYear());
69
69
  }
70
70
 
71
- return "".concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[0]), " - ").concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[1]), " ").concat(normalizeDates[0].getFullYear());
71
+ return "".concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[0]), "-").concat(new Intl.DateTimeFormat(locale, newOptions).format(normalizeDates[1]), " ").concat(normalizeDates[0].getFullYear());
72
72
  }
73
73
 
74
- return "".concat(format(normalizeDates[0]), " - ").concat(format(normalizeDates[1]));
74
+ return "".concat(format(normalizeDates[0]), "-").concat(format(normalizeDates[1]));
75
75
  }
76
76
 
77
77
  return format(normalizeDates[0]);
@@ -1 +1 @@
1
- {"version":3,"file":"shortDateRangeFormat.js","names":["dayjs","getDayJSLocale","locale","includes","shortDateRangeFormat","dates","options","Intl","DateTimeFormat","format","normalizeDates","map","date","toDate","monthsYears","month","year","length","isSimilarDay","isSimilarMonth","isSimilarYear","day","getDate","getFullYear","newOptions"],"sources":["../../../src/utils/shortDateRangeFormat.js"],"sourcesContent":["import dayjs from 'dayjs';\n\nfunction getDayJSLocale(locale) {\n if (locale.includes('en') || locale.includes('ja')) {\n return 'en';\n }\n return 'ru';\n}\n\nexport default function shortDateRangeFormat(dates, { locale = 'en-US', ...options }) {\n const { format } = new Intl.DateTimeFormat(locale, options);\n const normalizeDates = dates.map((date) => dayjs(date).toDate());\n const monthsYears = dates.map((date) => [\n dayjs(date).date(),\n dayjs(date).month(),\n dayjs(date).year(),\n ]);\n\n if (monthsYears.length > 1) {\n const isSimilarDay = monthsYears[0][0] === monthsYears[1][0];\n const isSimilarMonth = monthsYears[0][1] === monthsYears[1][1];\n const isSimilarYear = monthsYears[0][2] === monthsYears[1][2];\n\n if (isSimilarMonth && isSimilarYear && !options.day) {\n return format(normalizeDates[0]);\n }\n if (isSimilarMonth && isSimilarYear) {\n if (getDayJSLocale(locale) === 'en') {\n if (isSimilarDay) {\n return `${new Intl.DateTimeFormat(locale, { month: options.month }).format(\n normalizeDates[0],\n )} ${normalizeDates[0].getDate()}, ${normalizeDates[0].getFullYear()}`;\n }\n return `${new Intl.DateTimeFormat(locale, { month: options.month }).format(\n normalizeDates[0],\n )} ${normalizeDates[0].getDate()} - ${normalizeDates[1].getDate()}, ${normalizeDates[0].getFullYear()}`;\n }\n if (isSimilarDay) {\n return `${normalizeDates[0].getDate()} ${new Intl.DateTimeFormat(locale, {\n month: options.month,\n }).format(normalizeDates[0])} ${normalizeDates[0].getFullYear()}`;\n }\n return `${normalizeDates[0].getDate()} - ${normalizeDates[1].getDate()} ${new Intl.DateTimeFormat(\n locale,\n { month: options.month },\n ).format(normalizeDates[0])} ${normalizeDates[0].getFullYear()}`;\n }\n\n if (isSimilarYear) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { year, ...newOptions } = options;\n if (getDayJSLocale(locale) === 'en') {\n return `${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[0],\n )} - ${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[1],\n )}, ${normalizeDates[0].getFullYear()}`;\n }\n return `${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[0],\n )} - ${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[1],\n )} ${normalizeDates[0].getFullYear()}`;\n }\n\n return `${format(normalizeDates[0])} - ${format(normalizeDates[1])}`;\n }\n\n return format(normalizeDates[0]);\n}\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;;AAEA,SAASC,cAAT,CAAwBC,MAAxB,EAAgC;EAC9B,IAAIA,MAAM,CAACC,QAAP,CAAgB,IAAhB,KAAyBD,MAAM,CAACC,QAAP,CAAgB,IAAhB,CAA7B,EAAoD;IAClD,OAAO,IAAP;EACD;;EACD,OAAO,IAAP;AACD;;AAED,eAAe,SAASC,oBAAT,CAA8BC,KAA9B,QAAuE;EAAA,uBAAhCH,MAAgC;EAAA,IAAhCA,MAAgC,4BAAvB,OAAuB;EAAA,IAAXI,OAAW;;EACpF,2BAAmB,IAAIC,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCI,OAAhC,CAAnB;EAAA,IAAQG,MAAR,wBAAQA,MAAR;;EACA,IAAMC,cAAc,GAAGL,KAAK,CAACM,GAAN,CAAU,UAACC,IAAD;IAAA,OAAUZ,KAAK,CAACY,IAAD,CAAL,CAAYC,MAAZ,EAAV;EAAA,CAAV,CAAvB;EACA,IAAMC,WAAW,GAAGT,KAAK,CAACM,GAAN,CAAU,UAACC,IAAD;IAAA,OAAU,CACtCZ,KAAK,CAACY,IAAD,CAAL,CAAYA,IAAZ,EADsC,EAEtCZ,KAAK,CAACY,IAAD,CAAL,CAAYG,KAAZ,EAFsC,EAGtCf,KAAK,CAACY,IAAD,CAAL,CAAYI,IAAZ,EAHsC,CAAV;EAAA,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AhC,EAA4Cf,MAA5C,CACRC,cAAc,CAAC,CAAD,CADN,CAAV,gBAEO,IAAIH,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCsB,UAAhC,EAA4Cf,MAA5C,CACLC,cAAc,CAAC,CAAD,CADT,CAFP,cAIKA,cAAc,CAAC,CAAD,CAAd,CAAkBa,WAAlB,EAJL;IAKD;;IAED,iBAAUd,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAAhB,gBAAyCD,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAA/C;EACD;;EAED,OAAOD,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAAb;AACD"}
1
+ {"version":3,"file":"shortDateRangeFormat.js","names":["dayjs","getDayJSLocale","locale","includes","shortDateRangeFormat","dates","options","Intl","DateTimeFormat","format","normalizeDates","map","date","toDate","monthsYears","month","year","length","isSimilarDay","isSimilarMonth","isSimilarYear","day","getDate","getFullYear","newOptions"],"sources":["../../../src/utils/shortDateRangeFormat.js"],"sourcesContent":["import dayjs from 'dayjs';\n\nfunction getDayJSLocale(locale) {\n if (locale.includes('en') || locale.includes('ja')) {\n return 'en';\n }\n return 'ru';\n}\n\nexport default function shortDateRangeFormat(dates, { locale = 'en-US', ...options }) {\n const { format } = new Intl.DateTimeFormat(locale, options);\n const normalizeDates = dates.map((date) => dayjs(date).toDate());\n const monthsYears = dates.map((date) => [\n dayjs(date).date(),\n dayjs(date).month(),\n dayjs(date).year(),\n ]);\n\n if (monthsYears.length > 1) {\n const isSimilarDay = monthsYears[0][0] === monthsYears[1][0];\n const isSimilarMonth = monthsYears[0][1] === monthsYears[1][1];\n const isSimilarYear = monthsYears[0][2] === monthsYears[1][2];\n\n if (isSimilarMonth && isSimilarYear && !options.day) {\n return format(normalizeDates[0]);\n }\n if (isSimilarMonth && isSimilarYear) {\n if (getDayJSLocale(locale) === 'en') {\n if (isSimilarDay) {\n return `${new Intl.DateTimeFormat(locale, { month: options.month }).format(\n normalizeDates[0],\n )} ${normalizeDates[0].getDate()}, ${normalizeDates[0].getFullYear()}`;\n }\n return `${new Intl.DateTimeFormat(locale, { month: options.month }).format(\n normalizeDates[0],\n )} ${normalizeDates[0].getDate()}-${normalizeDates[1].getDate()}, ${normalizeDates[0].getFullYear()}`;\n }\n if (isSimilarDay) {\n return `${normalizeDates[0].getDate()} ${new Intl.DateTimeFormat(locale, {\n month: options.month,\n }).format(normalizeDates[0])} ${normalizeDates[0].getFullYear()}`;\n }\n return `${normalizeDates[0].getDate()}-${normalizeDates[1].getDate()} ${new Intl.DateTimeFormat(\n locale,\n { month: options.month },\n ).format(normalizeDates[0])} ${normalizeDates[0].getFullYear()}`;\n }\n\n if (isSimilarYear) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { year, ...newOptions } = options;\n if (getDayJSLocale(locale) === 'en') {\n return `${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[0],\n )}-${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[1],\n )}, ${normalizeDates[0].getFullYear()}`;\n }\n return `${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[0],\n )}-${new Intl.DateTimeFormat(locale, newOptions).format(\n normalizeDates[1],\n )} ${normalizeDates[0].getFullYear()}`;\n }\n\n return `${format(normalizeDates[0])}-${format(normalizeDates[1])}`;\n }\n\n return format(normalizeDates[0]);\n}\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;;AAEA,SAASC,cAAT,CAAwBC,MAAxB,EAAgC;EAC9B,IAAIA,MAAM,CAACC,QAAP,CAAgB,IAAhB,KAAyBD,MAAM,CAACC,QAAP,CAAgB,IAAhB,CAA7B,EAAoD;IAClD,OAAO,IAAP;EACD;;EACD,OAAO,IAAP;AACD;;AAED,eAAe,SAASC,oBAAT,CAA8BC,KAA9B,QAAuE;EAAA,uBAAhCH,MAAgC;EAAA,IAAhCA,MAAgC,4BAAvB,OAAuB;EAAA,IAAXI,OAAW;;EACpF,2BAAmB,IAAI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C,CAAQU,IAAR;MAAA,IAAiBQ,UAAjB,4BAAgClB,OAAhC;;MACA,IAAIL,cAAc,CAACC,MAAD,CAAd,KAA2B,IAA/B,EAAqC;QACnC,iBAAU,IAAIK,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCsB,UAAhC,EAA4Cf,MAA5C,CACRC,cAAc,CAAC,CAAD,CADN,CAAV,cAEK,IAAIH,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCsB,UAAhC,EAA4Cf,MAA5C,CACHC,cAAc,CAAC,CAAD,CADX,CAFL,eAIMA,cAAc,CAAC,CAAD,CAAd,CAAkBa,WAAlB,EAJN;MAKD;;MACD,iBAAU,IAAIhB,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCsB,UAAhC,EAA4Cf,MAA5C,CACRC,cAAc,CAAC,CAAD,CADN,CAAV,cAEK,IAAIH,IAAI,CAACC,cAAT,CAAwBN,MAAxB,EAAgCsB,UAAhC,EAA4Cf,MAA5C,CACHC,cAAc,CAAC,CAAD,CADX,CAFL,cAIKA,cAAc,CAAC,CAAD,CAAd,CAAkBa,WAAlB,EAJL;IAKD;;IAED,iBAAUd,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAAhB,cAAuCD,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAA7C;EACD;;EAED,OAAOD,MAAM,CAACC,cAAc,CAAC,CAAD,CAAf,CAAb;AACD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/date-picker",
3
3
  "description": "Semrush DatePicker Component",
4
- "version": "3.1.2",
4
+ "version": "3.2.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",