contentoh-components-library 21.3.0 → 21.3.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.
@@ -25,4 +25,9 @@ var Template = function Template(args) {
25
25
 
26
26
  var DefaultRangeCalendar = Template.bind({});
27
27
  exports.DefaultRangeCalendar = DefaultRangeCalendar;
28
- DefaultRangeCalendar.args = {};
28
+ DefaultRangeCalendar.args = {
29
+ currentDates: {
30
+ start: "2022-12-15T00:00:00.000Z",
31
+ end: "2022-12-25T00:00:00.000Z"
32
+ }
33
+ };
@@ -37,12 +37,12 @@ var RangeCalendar = function RangeCalendar(_ref) {
37
37
  _ref$calendarId = _ref.calendarId,
38
38
  calendarId = _ref$calendarId === void 0 ? "calendar-id" : _ref$calendarId;
39
39
 
40
- var _useState = (0, _react.useState)(currentDates !== null && currentDates !== void 0 && currentDates.start ? currentDates.start : new Date()),
40
+ var _useState = (0, _react.useState)(currentDates !== null && currentDates !== void 0 && currentDates.start ? new Date(currentDates.start) : new Date()),
41
41
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
42
42
  startDate = _useState2[0],
43
43
  setStartDate = _useState2[1];
44
44
 
45
- var _useState3 = (0, _react.useState)(currentDates !== null && currentDates !== void 0 && currentDates.end ? currentDates.end : new Date()),
45
+ var _useState3 = (0, _react.useState)(currentDates !== null && currentDates !== void 0 && currentDates.end ? new Date(currentDates.end) : new Date()),
46
46
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
47
47
  endDate = _useState4[0],
48
48
  setEndDate = _useState4[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.3.0",
3
+ "version": "21.3.1",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -8,4 +8,9 @@ export default {
8
8
  const Template = (args) => <RangeCalendar {...args} />;
9
9
 
10
10
  export const DefaultRangeCalendar = Template.bind({});
11
- DefaultRangeCalendar.args = {};
11
+ DefaultRangeCalendar.args = {
12
+ currentDates: {
13
+ start: "2022-12-15T00:00:00.000Z",
14
+ end: "2022-12-25T00:00:00.000Z",
15
+ },
16
+ };
@@ -13,10 +13,10 @@ export const RangeCalendar = ({
13
13
  calendarId = "calendar-id",
14
14
  }) => {
15
15
  const [startDate, setStartDate] = useState(
16
- currentDates?.start ? currentDates.start : new Date()
16
+ currentDates?.start ? new Date(currentDates.start) : new Date()
17
17
  );
18
18
  const [endDate, setEndDate] = useState(
19
- currentDates?.end ? currentDates.end : new Date()
19
+ currentDates?.end ? new Date(currentDates.end) : new Date()
20
20
  );
21
21
  const [showCalendar, setShowCalendar] = useCloseModal(calendarId);
22
22
  const onChange = (dates) => {