@instructure/ui-calendar 9.5.2 → 9.6.1-pr-snapshot-1726659472372

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
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [9.6.1-pr-snapshot-1726659472372](https://github.com/instructure/instructure-ui/compare/v9.6.0...v9.6.1-pr-snapshot-1726659472372) (2024-09-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * **ui-date-input:** improve DateInput2 api, extend docs ([27bc27f](https://github.com/instructure/instructure-ui/commit/27bc27f8a5e18cf3cabee8b5ea18f75629728ab6))
12
+
13
+
14
+
15
+
16
+
17
+ # [9.6.0](https://github.com/instructure/instructure-ui/compare/v9.5.2...v9.6.0) (2024-08-14)
18
+
19
+
20
+ ### Features
21
+
22
+ * **ui-calendar,ui-date-input:** improve DateInput2 onChange callback, add date formatting option, extend docs ([4e2c23c](https://github.com/instructure/instructure-ui/commit/4e2c23c3288885e49030f1f471d61b2fed29b54c))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [9.5.2](https://github.com/instructure/instructure-ui/compare/v9.5.1...v9.5.2) (2024-08-05)
7
29
 
8
30
 
@@ -143,7 +143,7 @@ let Calendar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
143
143
  visibleMonth: newDate
144
144
  });
145
145
  };
146
- // date is returned es a ISO string, like 2021-09-14T22:00:00.000Z
146
+ // date is returned as an ISO string, like 2021-09-14T22:00:00.000Z
147
147
  this.handleDayClick = (event, {
148
148
  date
149
149
  }) => {
@@ -182,7 +182,7 @@ let Calendar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
182
182
  }
183
183
  get hasNextMonth() {
184
184
  // this is needed for locales that doesn't use the latin script for numbers e.g.: arabic
185
- const yearNumber = Number(this.state.visibleMonth.clone().locale('en').subtract({
185
+ const yearNumber = Number(this.state.visibleMonth.clone().locale('en').add({
186
186
  months: 1
187
187
  }).format('YYYY'));
188
188
  return !this.props.withYearPicker || this.props.withYearPicker && yearNumber <= this.props.withYearPicker.endYear;
@@ -216,6 +216,7 @@ let Calendar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
216
216
  }, jsx(SimpleSelect, {
217
217
  width: "90px",
218
218
  renderLabel: "",
219
+ placeholder: "--",
219
220
  assistiveText: withYearPicker.screenReaderLabel,
220
221
  value: visibleMonth.format('YYYY'),
221
222
  onChange: (e, {
@@ -154,7 +154,7 @@ let Calendar = exports.Calendar = (_dec = (0, _emotion.withStyle)(_styles.defaul
154
154
  visibleMonth: newDate
155
155
  });
156
156
  };
157
- // date is returned es a ISO string, like 2021-09-14T22:00:00.000Z
157
+ // date is returned as an ISO string, like 2021-09-14T22:00:00.000Z
158
158
  this.handleDayClick = (event, {
159
159
  date
160
160
  }) => {
@@ -193,7 +193,7 @@ let Calendar = exports.Calendar = (_dec = (0, _emotion.withStyle)(_styles.defaul
193
193
  }
194
194
  get hasNextMonth() {
195
195
  // this is needed for locales that doesn't use the latin script for numbers e.g.: arabic
196
- const yearNumber = Number(this.state.visibleMonth.clone().locale('en').subtract({
196
+ const yearNumber = Number(this.state.visibleMonth.clone().locale('en').add({
197
197
  months: 1
198
198
  }).format('YYYY'));
199
199
  return !this.props.withYearPicker || this.props.withYearPicker && yearNumber <= this.props.withYearPicker.endYear;
@@ -227,6 +227,7 @@ let Calendar = exports.Calendar = (_dec = (0, _emotion.withStyle)(_styles.defaul
227
227
  }, (0, _emotion.jsx)(_SimpleSelect.SimpleSelect, {
228
228
  width: "90px",
229
229
  renderLabel: "",
230
+ placeholder: "--",
230
231
  assistiveText: withYearPicker.screenReaderLabel,
231
232
  value: visibleMonth.format('YYYY'),
232
233
  onChange: (e, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-calendar",
3
- "version": "9.5.2",
3
+ "version": "9.6.1-pr-snapshot-1726659472372",
4
4
  "description": "A calendar component.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,31 +23,31 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "9.5.2",
27
- "@instructure/ui-color-utils": "9.5.2",
28
- "@instructure/ui-test-locator": "9.5.2",
29
- "@instructure/ui-test-utils": "9.5.2",
30
- "@instructure/ui-themes": "9.5.2",
26
+ "@instructure/ui-babel-preset": "9.6.1-pr-snapshot-1726659472372",
27
+ "@instructure/ui-color-utils": "9.6.1-pr-snapshot-1726659472372",
28
+ "@instructure/ui-test-locator": "9.6.1-pr-snapshot-1726659472372",
29
+ "@instructure/ui-test-utils": "9.6.1-pr-snapshot-1726659472372",
30
+ "@instructure/ui-themes": "9.6.1-pr-snapshot-1726659472372",
31
31
  "@testing-library/jest-dom": "^6.4.6",
32
32
  "@testing-library/react": "^15.0.7",
33
33
  "vitest": "^2.0.2"
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.24.5",
37
- "@instructure/console": "9.5.2",
38
- "@instructure/emotion": "9.5.2",
39
- "@instructure/shared-types": "9.5.2",
40
- "@instructure/ui-a11y-content": "9.5.2",
41
- "@instructure/ui-buttons": "9.5.2",
42
- "@instructure/ui-i18n": "9.5.2",
43
- "@instructure/ui-icons": "9.5.2",
44
- "@instructure/ui-prop-types": "9.5.2",
45
- "@instructure/ui-react-utils": "9.5.2",
46
- "@instructure/ui-simple-select": "9.5.2",
47
- "@instructure/ui-testable": "9.5.2",
48
- "@instructure/ui-utils": "9.5.2",
49
- "@instructure/ui-view": "9.5.2",
50
- "@instructure/uid": "9.5.2",
37
+ "@instructure/console": "9.6.1-pr-snapshot-1726659472372",
38
+ "@instructure/emotion": "9.6.1-pr-snapshot-1726659472372",
39
+ "@instructure/shared-types": "9.6.1-pr-snapshot-1726659472372",
40
+ "@instructure/ui-a11y-content": "9.6.1-pr-snapshot-1726659472372",
41
+ "@instructure/ui-buttons": "9.6.1-pr-snapshot-1726659472372",
42
+ "@instructure/ui-i18n": "9.6.1-pr-snapshot-1726659472372",
43
+ "@instructure/ui-icons": "9.6.1-pr-snapshot-1726659472372",
44
+ "@instructure/ui-prop-types": "9.6.1-pr-snapshot-1726659472372",
45
+ "@instructure/ui-react-utils": "9.6.1-pr-snapshot-1726659472372",
46
+ "@instructure/ui-simple-select": "9.6.1-pr-snapshot-1726659472372",
47
+ "@instructure/ui-testable": "9.6.1-pr-snapshot-1726659472372",
48
+ "@instructure/ui-utils": "9.6.1-pr-snapshot-1726659472372",
49
+ "@instructure/ui-view": "9.6.1-pr-snapshot-1726659472372",
50
+ "@instructure/uid": "9.6.1-pr-snapshot-1726659472372",
51
51
  "prop-types": "^15.8.1"
52
52
  },
53
53
  "peerDependencies": {
@@ -166,7 +166,7 @@ class Calendar extends Component<CalendarProps, CalendarState> {
166
166
  this.state.visibleMonth
167
167
  .clone()
168
168
  .locale('en')
169
- .subtract({ months: 1 })
169
+ .add({ months: 1 })
170
170
  .format('YYYY')
171
171
  )
172
172
  return (
@@ -318,6 +318,7 @@ class Calendar extends Component<CalendarProps, CalendarState> {
318
318
  <SimpleSelect
319
319
  width="90px"
320
320
  renderLabel=""
321
+ placeholder="--"
321
322
  assistiveText={withYearPicker.screenReaderLabel}
322
323
  value={visibleMonth.format('YYYY')}
323
324
  onChange={(
@@ -465,7 +466,7 @@ class Calendar extends Component<CalendarProps, CalendarState> {
465
466
  return DateTime.browserTimeZone()
466
467
  }
467
468
 
468
- // date is returned es a ISO string, like 2021-09-14T22:00:00.000Z
469
+ // date is returned as an ISO string, like 2021-09-14T22:00:00.000Z
469
470
  handleDayClick = (event: MouseEvent<any>, { date }: { date: string }) => {
470
471
  if (this.props.onDateSelected) {
471
472
  const parsedDate = DateTime.parse(date, this.locale(), this.timezone())