Open
Description
Given a random Temporal.ZonedDateTime
, I would like to get a Temporal.ZonedDateTime
for the time 00:00:00.000000
of the first Monday before that time. I have tried:
round()
: does not supportweek
as a rounding mode-
Temporal.ZonedDateTime.from({ timeZone: dateTime.timeZoneId, year: dateTime.year, weekOfYear: dateTime.weekOfYear, dayOfWeek: 1, });
with()
: does not support as an argumentdayOfWeek
Is the only way to do this to manually by subtracting dayOfWeek
from itself? Ie:
dateTime
.round({ smallestUnit: "day", roundingMode: "trunc" })
.subtract({ days: dateTime.dayOfWeek - 1 });