Returns a new DateTime
value that changes the Day
and Time
values from the
input to the beginning of the first day of the specified week.
The function treats Sunday as the first day of the week.
Introduced in DataWeave version 2.4.0.
This example changes the Day
and Time
values (06T18:23:20.351
) within
the DateTime
input to the beginning of the first day of the specified week
(04T00:00:00
).
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
atBeginningOfWeekDateTime: atBeginningOfWeek(|2020-10-06T18:23:20.351-03:00|)
}
Returns a new LocalDateTime
value that changes the Day
and Time
values from the
input to the beginning of the first day of the specified week.
The function treats Sunday as the first day of the week.
Introduced in DataWeave version 2.4.0.
This example changes the Day
and Time
values (06T18:23:20.351
) within
the LocalDateTime
input to the beginning of the first day of the specified week
(04T00:00:00
).
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
atBeginningOfWeekLocalDateTime: atBeginningOfWeek(|2020-10-06T18:23:20.351|)
}
Returns a new Date
value that changes the Date
input
input to the first day of the specified week.
The function treats Sunday as the first day of the week.
Introduced in DataWeave version 2.4.0.
This example changes the Day
value (06
) within
the Date
input to the first day of the week that contains 2020-10-06
(a Tuesday), which is 2020-10-04
(a Sunday).
The Day
value changes from 06
to 04
.
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
atBeginningOfWeekDate: atBeginningOfWeek(|2020-10-06|)
}