@instructure/ui-calendar 9.6.1-snapshot-2 → 9.7.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 +10 -2
- package/es/Calendar/index.js +3 -2
- package/lib/Calendar/index.js +3 -2
- package/package.json +20 -20
- package/src/Calendar/index.tsx +10 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Calendar/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,17 @@
|
|
|
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
|
-
|
|
6
|
+
# [9.7.0](https://github.com/instructure/instructure-ui/compare/v9.6.0...v9.7.0) (2024-09-23)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui-calendar:** fix code to remove unnecessary warnings ([d139bd4](https://github.com/instructure/instructure-ui/commit/d139bd4e6f156744d5bd4f2fb6e7acacf58804d6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **ui-date-input:** improve DateInput2 api, extend docs ([f369604](https://github.com/instructure/instructure-ui/commit/f3696040d59f9baf9b9a27070e6fbc3d458e4495))
|
|
9
17
|
|
|
10
18
|
|
|
11
19
|
|
package/es/Calendar/index.js
CHANGED
|
@@ -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').
|
|
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, {
|
|
@@ -345,7 +346,7 @@ let Calendar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
|
|
|
345
346
|
return jsx(Calendar.Day, {
|
|
346
347
|
key: dateStr,
|
|
347
348
|
date: dateStr,
|
|
348
|
-
isSelected: selectedDate ? date.isSame(selectedDate, 'day') : false,
|
|
349
|
+
isSelected: selectedDate ? date.isSame(DateTime.parse(selectedDate, this.locale(), this.timezone()), 'day') : false,
|
|
349
350
|
isToday: date.isSame(today, 'day'),
|
|
350
351
|
isOutsideMonth: !date.isSame(visibleMonth, 'month'),
|
|
351
352
|
label: date.format('D MMMM YYYY') // used by screen readers
|
package/lib/Calendar/index.js
CHANGED
|
@@ -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').
|
|
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, {
|
|
@@ -356,7 +357,7 @@ let Calendar = exports.Calendar = (_dec = (0, _emotion.withStyle)(_styles.defaul
|
|
|
356
357
|
return (0, _emotion.jsx)(Calendar.Day, {
|
|
357
358
|
key: dateStr,
|
|
358
359
|
date: dateStr,
|
|
359
|
-
isSelected: selectedDate ? date.isSame(selectedDate, 'day') : false,
|
|
360
|
+
isSelected: selectedDate ? date.isSame(_DateTime.DateTime.parse(selectedDate, this.locale(), this.timezone()), 'day') : false,
|
|
360
361
|
isToday: date.isSame(today, 'day'),
|
|
361
362
|
isOutsideMonth: !date.isSame(visibleMonth, 'month'),
|
|
362
363
|
label: date.format('D MMMM YYYY') // used by screen readers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-calendar",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.0",
|
|
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.
|
|
27
|
-
"@instructure/ui-color-utils": "9.
|
|
28
|
-
"@instructure/ui-test-locator": "9.
|
|
29
|
-
"@instructure/ui-test-utils": "9.
|
|
30
|
-
"@instructure/ui-themes": "9.
|
|
26
|
+
"@instructure/ui-babel-preset": "9.7.0",
|
|
27
|
+
"@instructure/ui-color-utils": "9.7.0",
|
|
28
|
+
"@instructure/ui-test-locator": "9.7.0",
|
|
29
|
+
"@instructure/ui-test-utils": "9.7.0",
|
|
30
|
+
"@instructure/ui-themes": "9.7.0",
|
|
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.
|
|
38
|
-
"@instructure/emotion": "9.
|
|
39
|
-
"@instructure/shared-types": "9.
|
|
40
|
-
"@instructure/ui-a11y-content": "9.
|
|
41
|
-
"@instructure/ui-buttons": "9.
|
|
42
|
-
"@instructure/ui-i18n": "9.
|
|
43
|
-
"@instructure/ui-icons": "9.
|
|
44
|
-
"@instructure/ui-prop-types": "9.
|
|
45
|
-
"@instructure/ui-react-utils": "9.
|
|
46
|
-
"@instructure/ui-simple-select": "9.
|
|
47
|
-
"@instructure/ui-testable": "9.
|
|
48
|
-
"@instructure/ui-utils": "9.
|
|
49
|
-
"@instructure/ui-view": "9.
|
|
50
|
-
"@instructure/uid": "9.
|
|
37
|
+
"@instructure/console": "9.7.0",
|
|
38
|
+
"@instructure/emotion": "9.7.0",
|
|
39
|
+
"@instructure/shared-types": "9.7.0",
|
|
40
|
+
"@instructure/ui-a11y-content": "9.7.0",
|
|
41
|
+
"@instructure/ui-buttons": "9.7.0",
|
|
42
|
+
"@instructure/ui-i18n": "9.7.0",
|
|
43
|
+
"@instructure/ui-icons": "9.7.0",
|
|
44
|
+
"@instructure/ui-prop-types": "9.7.0",
|
|
45
|
+
"@instructure/ui-react-utils": "9.7.0",
|
|
46
|
+
"@instructure/ui-simple-select": "9.7.0",
|
|
47
|
+
"@instructure/ui-testable": "9.7.0",
|
|
48
|
+
"@instructure/ui-utils": "9.7.0",
|
|
49
|
+
"@instructure/ui-view": "9.7.0",
|
|
50
|
+
"@instructure/uid": "9.7.0",
|
|
51
51
|
"prop-types": "^15.8.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
package/src/Calendar/index.tsx
CHANGED
|
@@ -166,7 +166,7 @@ class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
166
166
|
this.state.visibleMonth
|
|
167
167
|
.clone()
|
|
168
168
|
.locale('en')
|
|
169
|
-
.
|
|
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={(
|
|
@@ -509,7 +510,14 @@ class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
509
510
|
<Calendar.Day
|
|
510
511
|
key={dateStr}
|
|
511
512
|
date={dateStr}
|
|
512
|
-
isSelected={
|
|
513
|
+
isSelected={
|
|
514
|
+
selectedDate
|
|
515
|
+
? date.isSame(
|
|
516
|
+
DateTime.parse(selectedDate, this.locale(), this.timezone()),
|
|
517
|
+
'day'
|
|
518
|
+
)
|
|
519
|
+
: false
|
|
520
|
+
}
|
|
513
521
|
isToday={date.isSame(today, 'day')}
|
|
514
522
|
isOutsideMonth={!date.isSame(visibleMonth, 'month')}
|
|
515
523
|
label={date.format('D MMMM YYYY')} // used by screen readers
|