Skip to content

Commit fd62b1f

Browse files
author
marker dao ®
committed
fix(datebox): isStub && Update test
1 parent 7bda6f2 commit fd62b1f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/devextreme/js/__internal/ui/date_box/date_box.mask.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable class-methods-use-this */
21
import eventsEngine from '@js/common/core/events/core/events_engine';
32
import { addNamespace, isCommandKeyPressed, normalizeKeyName } from '@js/common/core/events/utils/index';
43
import { getFormat } from '@js/common/core/localization/ldml/date.format';
@@ -503,7 +502,7 @@ class DateBoxMask extends DateBoxBase {
503502

504503
const activePartIndex = this._activePartIndex ?? 0;
505504
let index = fitIntoRange(activePartIndex + step, 0, this._dateParts.length - 1);
506-
if (this._dateParts[index].isStub) {
505+
if (this._dateParts[index]?.isStub) {
507506
const isBoundaryIndex = (index === 0 && step < 0)
508507
|| (index === this._dateParts.length - 1 && step > 0);
509508
if (!isBoundaryIndex) {

packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/datebox.mask.tests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,8 @@ module('Date AM/PM Handling', setupModule, () => {
13021302

13031303
this.instance.option({
13041304
value: new Date('10/10/2012 22:00'),
1305-
displayFormat: 'a'
1305+
displayFormat: 'a',
1306+
useMaskBehavior: true,
13061307
});
13071308

13081309
assert.strictEqual(this.$input.val(), pmName, 'initial value is localized PM');

0 commit comments

Comments
 (0)