Skip to main content
Version: 1.x

Function: setDateRangeSelection()

setDateRangeSelection(page, controlId, startDate, endDate, options?): Promise<void>

Defined in: src/modules/date.ts:369

Ai

Sets a date range on a sap.m.DateRangeSelection control.

Parameters

page

DatePage

Playwright Page (or compatible subset).

controlId

string

The ID of the DateRangeSelection control.

startDate

DateInput

The start date.

endDate

DateInput

The end date.

options?

DateOptions

Optional date operation settings.

Returns

Promise<void>

Intent

Set both start and end dates on a DateRangeSelection control.

Guarantee

On success, both date values are set and fireChange() is called.

Prerequisite

startDate must be before or equal to endDate.

Ai Context

Uses setDateValue() and setSecondDateValue() + fireChange(). Validates that start date is before or equal to end date before setting.

Sap Module

sap.m.DateRangeSelection — setDateValue(), setSecondDateValue()

Business Context

Set date range filters (fiscal period, delivery window, reporting range).

Throws

ControlError if startDate is after endDate.

Example

await setDateRangeSelection(page, 'range1', '2024-01-01', '2024-01-31');