Skip to content

Commit d34ec07

Browse files
Moriyoshi Koizumimoriyoshi
Moriyoshi Koizumi
authored andcommitted
Fix typo
1 parent 7e30d6c commit d34ec07

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/DateTime.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ export default class Datetime extends React.Component {
451451
let needsUpdate = false;
452452
let thisProps = this.props;
453453

454-
['locale', 'utc', 'displayZone', 'dateFormat', 'timeFormat'].forEach( function(p) {
454+
['locale', 'utc', 'displayTimeZone', 'dateFormat', 'timeFormat'].forEach( function(p) {
455455
prevProps[p] !== thisProps[p] && (needsUpdate = true);
456456
});
457457

test/tests.spec.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -919,29 +919,35 @@ describe('Datetime', () => {
919919
it('displayTimeZone -> value should change format (undefined->America/New_York)', () => {
920920
const date = new Date(2000, 0, 15, 2, 2, 2, 2),
921921
momentDate = moment(date),
922-
component = utils.createDatetime({ value: momentDate }),
922+
component = utils.createDatetime({ initialViewMode: 'time', timeFormat: 'HH', value: momentDate }),
923923
displayTimeZone = (moment.tz.guess() === 'America/New_York' ? 'America/Los_Angeles' : 'America/New_York');
924924

925925
const valueBefore = utils.getInputValue(component);
926+
const timeCountBefore = component.find('.rdtCount').text();
926927
component.setProps({ displayTimeZone: displayTimeZone }, () => {
927928
const valueAfter = utils.getInputValue(component);
928929

929930
expect(valueBefore).not.toEqual(valueAfter);
930931
});
932+
const timeCountAfter = component.find('.rdtCount').text();
933+
expect(timeCountBefore).not.toEqual(timeCountAfter);
931934
});
932935

933936
it('displayTimeZone -> value should change format (America/New_York->undefined)', () => {
934937
const date = new Date(2000, 0, 15, 2, 2, 2, 2),
935938
momentDate = moment(date),
936939
displayTimeZone = (moment.tz.guess() === 'America/New_York' ? 'America/Los_Angeles' : 'America/New_York'),
937-
component = utils.createDatetime({ value: momentDate, displayTimeZone: displayTimeZone });
940+
component = utils.createDatetime({ initialViewMode: 'time', timeFormat: 'HH', value: momentDate, displayTimeZone: displayTimeZone });
938941

939942
const valueBefore = utils.getInputValue(component);
943+
const timeCountBefore = component.find('.rdtCount').text();
940944
component.setProps({ displayTimeZone: undefined }, () => {
941945
const valueAfter = utils.getInputValue(component);
942946

943947
expect(valueBefore).not.toEqual(valueAfter);
944948
});
949+
const timeCountAfter = component.find('.rdtCount').text();
950+
expect(timeCountBefore).not.toEqual(timeCountAfter);
945951
});
946952

947953
it('locale -> picker should change language (initialViewMode=days)', () => {

0 commit comments

Comments
 (0)