rescript-date icon indicating copy to clipboard operation
rescript-date copied to clipboard

How do you calculate a date from a week number?

Open vasco3 opened this issue 4 years ago • 0 comments

let date = Js.Date.fromString("2021-01-05")

date->ReDate.getWeek // returns 1

do you know how can I convert that "2021-W1" back to a date?

I would like to be able to get the start of that week.

something like

ReDate.getDateFromWeekNumber(~year=2021., ~weekNumber=1., ~weekStartsOn=Friday) 
// would return "2021-01-01T06:00:00.000Z"

vasco3 avatar Dec 22 '21 06:12 vasco3