0
votes

I would like to find all five dates of the current week (Mon - fri) in Angular Typescript project using moment.js. For example Is Monday is the starting day of this week :-

Monday 22nd March Tuesday 23rd March Wednesday 24th March Thursday 25th March Friday 26th March

1
Need to be in typescript.Farjana Ahsan
This is the very same in TypeScript. TS is JS with types on top...Philipp Meissner
Does this answer your question? Get current weekPhilipp Meissner
not really unfortunatelyFarjana Ahsan

1 Answers

1
votes

I have solved it using :

  dateMon: moment.Moment; 
  dateTues: moment.Moment; 
  dateWed: moment.Moment; 
  dateThurs: moment.Moment; 
  dateFri: moment.Moment;  


    this.dateMon = moment().weekday(1);
    this.dateTues = moment().weekday(2);
    this.dateWed = moment().weekday(3);
    this.dateThurs = moment().weekday(4);
    this.dateFri = moment().weekday(5);