endOfWeek
returns the last day of a week and the end of the day time, however, lastDayOfWeek
does the same but it returns the start of the day time, so in two words, it’s a shortcut for:
date->ReDate.endOfWeek->ReDate.startOfDay
yes, a few ReDate functions were returning int
type before v1
but I feel, in terms of improving the developer experience, it’s much easier to use ReDate, when it’s fully compatible with Js.Date
(which expects float type) and other ReDate
functions, so I would say the consistency is a good word in this case
take a look at the pseudo-code example below:
let today = Js.Date.make()
let fstDate = Js.Date.makeWithYMD(~year=2021., ~month=10., ~date=10., ())
let sndDate = Js.Date.makeWithYMD(~year=2021., ~month=10., ~date=1., ())
let diff = fstDate->ReDate.differenceInBusinessDays(sndDate)
// before v1 you had to use float_of_int
// today->ReDate.addDays(float_of_int(diff))
let date = today->ReDate.addDays(diff)
this sounds good to me! so obvious that getDay
is often used by devs and it’s still missing in ReDate, I will add it for sure
(or, don’t you mind opening a new PR?
)
btw. you can see the current lib status here: https://mobily.github.io/rescript-date/docs/status
do you exactly mean the is
function? https://github.com/mobily/rescript-date/blob/213cced4812ef7b30987ba78a666f2cbb1f06078/src/ReDate_utils.res#L80
yes, the documentation is built with docusaurus
, I prefer using it to any other tool because I’m familiar with the tool (I have been using it in multiple projects), can customize things quickly and the generated site just looks good 
yup, definitely you’re right
thanks for the suggestion, I will fix it 