@tap-payments/os-micro-frontend-shared 0.1.365-test.19 → 0.1.365-test.20

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.
@@ -58,8 +58,10 @@ function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalend
58
58
  onChangeTimezone === null || onChangeTimezone === void 0 ? void 0 : onChangeTimezone(selectedTimezone);
59
59
  };
60
60
  const getSelectedDate = () => {
61
- const startSelectedTime = dates[0].format('MMM D');
62
- const endSelectedTime = dates[1] ? dates[1].format('MMM D') : dates[0].format('MMM D');
61
+ const nowYear = dayjs().year();
62
+ const formatDate = (date) => (date.year === nowYear ? date.format('MMM D') : date.format('MMM D, YYYY'));
63
+ const startSelectedTime = formatDate(dates[0]);
64
+ const endSelectedTime = dates[1] ? formatDate(dates[1]) : formatDate(dates[0]);
63
65
  return startSelectedTime === endSelectedTime && !noTimezone ? startSelectedTime : `${startSelectedTime} - ${endSelectedTime}`;
64
66
  };
65
67
  const onChange = (newDate) => {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.365-test.19",
5
- "testVersion": 19,
4
+ "version": "0.1.365-test.20",
5
+ "testVersion": 20,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",