在Ionic 3中,如何增加到目前为止的天数?

时间:2019-03-08 10:03:29

标签: angular date ionic3

  ionViewDidEnter() {
    let self = this;
    self.originationsProvider.getOrigination()
      .then((data) => {

        self.origination = data;
        console.log(self.origination, "slefOrigination");
        this.complete = self.origination.filter((obj) => obj.state_status == 'completed');
        this.inComplete = self.origination.filter((obj) => obj.state_status == 'not_completed');
  
  // i am getting Change_Date from self.origination json
        console.log(this.inComplete, this.complete, "Incomplete");
        self.servicing = data;

        self.cdr.detectChanges();
      })
  }
                    <p style="white-space: initial;font-size: 15px;color: #3f454e;">Proxy payment due by: “No Later than {{account.Change_Date}}”</p>
  
  //I am getting date in Change_Date.I have to display the date by adding 9 days to it.

我想在今天的日期前加上9天。我正在使用Angular 4和Ionic3。谢谢!

1 个答案:

答案 0 :(得分:2)

var today = new Date();

迄今增加9天

var nextdate = new Date(today.getFullYear(),today.getMonth(),today.getDate()+9);