Open mohsenmehri6101 opened 1 year ago
@behrang
@mohsenmehri6101
const startOfCurrentWeek = moment().startOf("week").startOf("day")
const endOfCurrentWeek = moment().endOf("week").endOf("day")
@ngtive thanks for your answer .but this code get start week georgian (sunday) . but should be get saterday. and too about end week.
If I remember correctly, week start day has no relation to the calendar system. I think in moment
, you can change week start day or set it using a locale. Then you can do the calculations that you want.
@mohsenmehri6101 You can get the jalaali calendar start and end of the week like this:
moment().locale("fa").startOf("jWeek").format("jYYYY/jMM/jDD");
moment().locale("fa").endOf("jWeek").format("jYYYY/jMM/jDD");
how can get the stat and end from current week.
example if today is 1402-06-18 (سه شنبه) get :
start : 1402-06-15 end : 1402-06-21 ???