Skip to content

Commit 826849e

Browse files
committed
Update React-Date-Picker to 8.1.0, React-Time-Picker to 4.2.0
Closes #84
1 parent 8ee0175 commit 826849e

File tree

4 files changed

+57
-57
lines changed

4 files changed

+57
-57
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
"prop-types": "^15.6.0",
5353
"react-calendar": "^3.3.1",
5454
"react-clock": "^3.0.0",
55-
"react-date-picker": "^8.0.7",
55+
"react-date-picker": "^8.1.0",
5656
"react-fit": "^1.0.3",
57-
"react-time-picker": "^4.1.0"
57+
"react-time-picker": "^4.2.0"
5858
},
5959
"devDependencies": {
6060
"@babel/cli": "^7.8.0",

src/DateTimeInput.jsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ function datesAreDifferent(date1, date2) {
5454

5555
function isSameDate(date, year, month, day) {
5656
return (
57-
getYear(date) === year
58-
&& getMonthHuman(date) === month
59-
&& getDate(date) === day
57+
year === getYear(date).toString()
58+
&& month === getMonthHuman(date).toString()
59+
&& day === getDate(date).toString()
6060
);
6161
}
6262

@@ -185,12 +185,12 @@ export default class DateTimeInput extends PureComponent {
185185
) {
186186
if (nextValue) {
187187
[, nextState.amPm] = convert24to12(getHours(nextValue));
188-
nextState.year = getYear(nextValue);
189-
nextState.month = getMonthHuman(nextValue);
190-
nextState.day = getDate(nextValue);
191-
nextState.hour = getHours(nextValue);
192-
nextState.minute = getMinutes(nextValue);
193-
nextState.second = getSeconds(nextValue);
188+
nextState.year = getYear(nextValue).toString();
189+
nextState.month = getMonthHuman(nextValue).toString();
190+
nextState.day = getDate(nextValue).toString();
191+
nextState.hour = getHours(nextValue).toString();
192+
nextState.minute = getMinutes(nextValue).toString();
193+
nextState.second = getSeconds(nextValue).toString();
194194
} else {
195195
nextState.amPm = null;
196196
nextState.year = null;

src/DateTimeInput.spec.jsx

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ describe('DateTimeInput', () => {
130130
const customInputs = component.find('input[type="number"]');
131131

132132
expect(nativeInput.prop('value')).toBe('2017-09-30T22:17:00');
133-
expect(customInputs.at(0).prop('value')).toBe(9);
134-
expect(customInputs.at(1).prop('value')).toBe(30);
135-
expect(customInputs.at(2).prop('value')).toBe(2017);
136-
expect(customInputs.at(3).prop('value')).toBe(10);
137-
expect(customInputs.at(4).prop('value')).toBe(17);
138-
expect(customInputs.at(5).prop('value')).toBe(0);
133+
expect(customInputs.at(0).prop('value')).toBe('9');
134+
expect(customInputs.at(1).prop('value')).toBe('30');
135+
expect(customInputs.at(2).prop('value')).toBe('2017');
136+
expect(customInputs.at(3).prop('value')).toBe('10');
137+
expect(customInputs.at(4).prop('value')).toBe('17');
138+
expect(customInputs.at(5).prop('value')).toBe('0');
139139
});
140140

141141
it('shows a given date in all inputs correctly given array of Date objects (12-hour format)', () => {
@@ -153,12 +153,12 @@ describe('DateTimeInput', () => {
153153
const customInputs = component.find('input[type="number"]');
154154

155155
expect(nativeInput.prop('value')).toBe('2017-09-30T22:17:00');
156-
expect(customInputs.at(0).prop('value')).toBe(9);
157-
expect(customInputs.at(1).prop('value')).toBe(30);
158-
expect(customInputs.at(2).prop('value')).toBe(2017);
159-
expect(customInputs.at(3).prop('value')).toBe(10);
160-
expect(customInputs.at(4).prop('value')).toBe(17);
161-
expect(customInputs.at(5).prop('value')).toBe(0);
156+
expect(customInputs.at(0).prop('value')).toBe('9');
157+
expect(customInputs.at(1).prop('value')).toBe('30');
158+
expect(customInputs.at(2).prop('value')).toBe('2017');
159+
expect(customInputs.at(3).prop('value')).toBe('10');
160+
expect(customInputs.at(4).prop('value')).toBe('17');
161+
expect(customInputs.at(5).prop('value')).toBe('0');
162162
});
163163

164164
it('shows a given date in all inputs correctly given ISO string (12-hour format)', () => {
@@ -176,12 +176,12 @@ describe('DateTimeInput', () => {
176176
const customInputs = component.find('input[type="number"]');
177177

178178
expect(nativeInput.prop('value')).toBe('2017-09-30T22:17:00');
179-
expect(customInputs.at(0).prop('value')).toBe(9);
180-
expect(customInputs.at(1).prop('value')).toBe(30);
181-
expect(customInputs.at(2).prop('value')).toBe(2017);
182-
expect(customInputs.at(3).prop('value')).toBe(10);
183-
expect(customInputs.at(4).prop('value')).toBe(17);
184-
expect(customInputs.at(5).prop('value')).toBe(0);
179+
expect(customInputs.at(0).prop('value')).toBe('9');
180+
expect(customInputs.at(1).prop('value')).toBe('30');
181+
expect(customInputs.at(2).prop('value')).toBe('2017');
182+
expect(customInputs.at(3).prop('value')).toBe('10');
183+
expect(customInputs.at(4).prop('value')).toBe('17');
184+
expect(customInputs.at(5).prop('value')).toBe('0');
185185
});
186186

187187
itIfFullICU('shows a given date in all inputs correctly given Date (24-hour format)', () => {
@@ -200,12 +200,12 @@ describe('DateTimeInput', () => {
200200
const customInputs = component.find('input[type="number"]');
201201

202202
expect(nativeInput.prop('value')).toBe('2017-09-30T22:17:00');
203-
expect(customInputs.at(0).prop('value')).toBe(2017);
204-
expect(customInputs.at(1).prop('value')).toBe(9);
205-
expect(customInputs.at(2).prop('value')).toBe(30);
206-
expect(customInputs.at(3).prop('value')).toBe(22);
207-
expect(customInputs.at(4).prop('value')).toBe(17);
208-
expect(customInputs.at(5).prop('value')).toBe(0);
203+
expect(customInputs.at(0).prop('value')).toBe('2017');
204+
expect(customInputs.at(1).prop('value')).toBe('9');
205+
expect(customInputs.at(2).prop('value')).toBe('30');
206+
expect(customInputs.at(3).prop('value')).toBe('22');
207+
expect(customInputs.at(4).prop('value')).toBe('17');
208+
expect(customInputs.at(5).prop('value')).toBe('0');
209209
});
210210

211211
itIfFullICU('shows a given date in all inputs correctly given array of Date objects (24-hour format)', () => {
@@ -224,12 +224,12 @@ describe('DateTimeInput', () => {
224224
const customInputs = component.find('input[type="number"]');
225225

226226
expect(nativeInput.prop('value')).toBe('2017-09-30T22:17:00');
227-
expect(customInputs.at(0).prop('value')).toBe(2017);
228-
expect(customInputs.at(1).prop('value')).toBe(9);
229-
expect(customInputs.at(2).prop('value')).toBe(30);
230-
expect(customInputs.at(3).prop('value')).toBe(22);
231-
expect(customInputs.at(4).prop('value')).toBe(17);
232-
expect(customInputs.at(5).prop('value')).toBe(0);
227+
expect(customInputs.at(0).prop('value')).toBe('2017');
228+
expect(customInputs.at(1).prop('value')).toBe('9');
229+
expect(customInputs.at(2).prop('value')).toBe('30');
230+
expect(customInputs.at(3).prop('value')).toBe('22');
231+
expect(customInputs.at(4).prop('value')).toBe('17');
232+
expect(customInputs.at(5).prop('value')).toBe('0');
233233
});
234234

235235
itIfFullICU('shows a given date in all inputs correctly given ISO string (24-hour format)', () => {
@@ -248,12 +248,12 @@ describe('DateTimeInput', () => {
248248
const customInputs = component.find('input[type="number"]');
249249

250250
expect(nativeInput.prop('value')).toBe('2017-09-30T22:17:00');
251-
expect(customInputs.at(0).prop('value')).toBe(2017);
252-
expect(customInputs.at(1).prop('value')).toBe(9);
253-
expect(customInputs.at(2).prop('value')).toBe(30);
254-
expect(customInputs.at(3).prop('value')).toBe(22);
255-
expect(customInputs.at(4).prop('value')).toBe(17);
256-
expect(customInputs.at(5).prop('value')).toBe(0);
251+
expect(customInputs.at(0).prop('value')).toBe('2017');
252+
expect(customInputs.at(1).prop('value')).toBe('9');
253+
expect(customInputs.at(2).prop('value')).toBe('30');
254+
expect(customInputs.at(3).prop('value')).toBe('22');
255+
expect(customInputs.at(4).prop('value')).toBe('17');
256+
expect(customInputs.at(5).prop('value')).toBe('0');
257257
});
258258

259259
it('shows empty value in all inputs correctly given null', () => {

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6713,9 +6713,9 @@ fsevents@^2.1.2:
67136713
languageName: node
67146714
linkType: hard
67156715

6716-
"react-date-picker@npm:^8.0.7":
6717-
version: 8.0.7
6718-
resolution: "react-date-picker@npm:8.0.7"
6716+
"react-date-picker@npm:^8.1.0":
6717+
version: 8.1.0
6718+
resolution: "react-date-picker@npm:8.1.0"
67196719
dependencies:
67206720
"@types/react-calendar": ^3.0.0
67216721
"@wojtekmaj/date-utils": ^1.0.3
@@ -6729,7 +6729,7 @@ fsevents@^2.1.2:
67296729
peerDependencies:
67306730
react: ^16.3.0 || ^17.0.0-0
67316731
react-dom: ^16.3.0 || ^17.0.0-0
6732-
checksum: 9b6aec0ba9016db5c42a8a537efd4e4761014674b4ff653e19a9c41f318d1eaa45d5caeb20d8d84ea076c994b84c6f10180c6686e96fb189224b5acb6fd360c0
6732+
checksum: b871f9ede4ebbdcf665824ed8fb9d85e14f72a40006913a2d17db9e06cbc1527363cfb7f837410764f225f5ffec89ed4b4e367446adee5ae6aba44276df25f1f
67336733
languageName: node
67346734
linkType: hard
67356735

@@ -6757,10 +6757,10 @@ fsevents@^2.1.2:
67576757
react: ^17.0.0
67586758
react-calendar: ^3.3.1
67596759
react-clock: ^3.0.0
6760-
react-date-picker: ^8.0.7
6760+
react-date-picker: ^8.1.0
67616761
react-dom: ^17.0.0
67626762
react-fit: ^1.0.3
6763-
react-time-picker: ^4.1.0
6763+
react-time-picker: ^4.2.0
67646764
rimraf: ^3.0.0
67656765
peerDependencies:
67666766
react: ^16.3.0 || ^17.0.0-0
@@ -6834,9 +6834,9 @@ fsevents@^2.1.2:
68346834
languageName: node
68356835
linkType: hard
68366836

6837-
"react-time-picker@npm:^4.1.0":
6838-
version: 4.1.2
6839-
resolution: "react-time-picker@npm:4.1.2"
6837+
"react-time-picker@npm:^4.2.0":
6838+
version: 4.2.0
6839+
resolution: "react-time-picker@npm:4.2.0"
68406840
dependencies:
68416841
"@wojtekmaj/date-utils": ^1.0.0
68426842
get-user-locale: ^1.2.0
@@ -6849,7 +6849,7 @@ fsevents@^2.1.2:
68496849
peerDependencies:
68506850
react: ^16.3.0 || ^17.0.0-0
68516851
react-dom: ^16.3.0 || ^17.0.0-0
6852-
checksum: 21477910650583b5678ff617ad18cafa8ba002959355cbfe25804fc4f7edf5a89609eb42c9e5bc49b20c4725d21c5774b39a1f90d3ec3018ccb3a01851f20e9a
6852+
checksum: cb6d41c1116708e4340bda06f512060276ceb26b65be808f8c7999e7635cc16e04aa4b02fd70c0ae09c2fbc589aebbcbfcd74cff98881354305b4f666646a3e1
68536853
languageName: node
68546854
linkType: hard
68556855

0 commit comments

Comments
 (0)