Skip to content

Commit

Permalink
fix(ui5-date-picker): adjust timestamp (#9355)
Browse files Browse the repository at this point in the history
Fixes: #9217
  • Loading branch information
unazko authored Jul 30, 2024
1 parent f887689 commit b72ed21
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
6 changes: 6 additions & 0 deletions packages/main/src/DatePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ class DatePicker extends DateComponentBase implements IFormInputElement {
}

onResponsivePopoverBeforeOpen() {
this._calendar.timestamp = this._calendarTimestamp;
this._calendarCurrentPicker = this.firstPicker;
}

Expand All @@ -421,6 +422,11 @@ class DatePicker extends DateComponentBase implements IFormInputElement {
this.liveValue = this.value;
}

get _calendar() {
return this.shadowRoot!.querySelector<ResponsivePopover>("[ui5-responsive-popover]")!
.querySelector<Calendar>("[ui5-calendar]")!;
}

/**
* Override in derivatives to change calendar selection mode
* @protected
Expand Down
1 change: 0 additions & 1 deletion packages/main/src/DatePickerPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
primary-calendar-type="{{_primaryCalendarType}}"
secondary-calendar-type="{{secondaryCalendarType}}"
format-pattern="{{_formatPattern}}"
timestamp="{{_calendarTimestamp}}"
.selectionMode="{{_calendarSelectionMode}}"
.minDate="{{minDate}}"
.maxDate="{{maxDate}}"
Expand Down
1 change: 0 additions & 1 deletion packages/main/src/DateRangePicker.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
primary-calendar-type="{{_primaryCalendarType}}"
secondary-calendar-type="{{secondaryCalendarType}}"
format-pattern="{{_formatPattern}}"
timestamp="{{_calendarTimestamp}}"
.selectionMode="{{_calendarSelectionMode}}"
.minDate="{{minDate}}"
.maxDate="{{maxDate}}"
Expand Down
1 change: 0 additions & 1 deletion packages/main/src/DateTimePickerPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
primary-calendar-type="{{_primaryCalendarType}}"
secondary-calendar-type="{{secondaryCalendarType}}"
format-pattern="{{_formatPattern}}"
timestamp="{{_calendarTimestamp}}"
.selectionMode="{{_calendarSelectionMode}}"
.minDate="{{minDate}}"
.maxDate="{{maxDate}}"
Expand Down
3 changes: 1 addition & 2 deletions packages/main/test/specs/DatePicker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,7 @@ describe("Date Picker Tests", () => {
}

await innerInput.keys("May 5, 2100");
const root = await datepicker.getRoot();
await root.keys("Enter");
await innerInput.keys("Enter");

const input = await datepicker.getInput();
assert.equal(await input.getProperty("valueState"), "Negative", "value state of the input is Negative");
Expand Down

0 comments on commit b72ed21

Please sign in to comment.