Skip to content

Commit 6193014

Browse files
author
marker dao ®
committed
fix(datebox): isStub && Update test
1 parent 8fcc551 commit 6193014

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ class DateBoxMask extends DateBoxBase {
476476
}
477477
// @ts-expect-error ts-error
478478
let index = fitIntoRange(this._activePartIndex + step, 0, this._dateParts.length - 1);
479-
if (this._dateParts[index].isStub) {
479+
if (this._dateParts[index]?.isStub) {
480480
const isBoundaryIndex = index === 0 && step < 0 || index === this._dateParts.length - 1 && step > 0;
481481
if (!isBoundaryIndex) {
482482
this._selectNextPart(step >= 0 ? step + 1 : step - 1);

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)