You can make your own functions to do this in the database. For instance,
start.of.week <- function(date) date - (setNames(c(6,0:5),0:6) [strftime(date,'%w')]) end.of.week <- function(date) date + (setNames(c(0,6:1),0:6) [strftime(date,'%w')]) start.of.week(as.Date(c('2014-01-05','2014-10-02','2014-09-22','2014-09-27'))) # "2013-12-30" "2014-09-29" "2014-09-22" "2014-09-22" end.of.week(as.Date(c('2014-01-05','2014-10-02','2014-09-22','2014-09-27'))) # "2014-01-05" "2014-10-05" "2014-09-28" "2014-09-28"
source share