How to get current week start date ( Monday ) and End Date ( Sunday) in R.
My business weeks start from Monday and ends on Sunday.
How do i retrieve Start Date and End Date from my current date.
Eg. Curent date is 18-07-2020. How to retrieve Monday Date ( 18-07-2020) and Sunday Date (19-07-2020)
My Code :
library(lubridate)
library(mailR)
library(htmlTable)
library(DBI)
todays_date <- Sys.Date()
stdt <- floor_date(todays_date, 'week') + 1
lsdt <- floor_date(todays_date, 'week') + 7
If I execute the above code on Sunday, it falls on to next week. Any workaround to make the code to run on Sunday as well, by considering Monday to Sunday as working days.