Date utils - endOfDate

  • Hi,
    I’m using date.endOfDate this way:

    getEndDateOfYear (inputDate) {
        if (!date.isValid(inputDate)) {
          inputDate = this.getDate()
        return date.endOfDate(newDate, 'year')

    where inputDate value is for example : ‘Fri Sep 01 2017 00:00:00 GMT+0200 (Central Europe Daylight Time)’

    I found that output value of my method is ‘Sat Dec 30 2017 23:59:59 GMT+0100 (Central Europe Standard Time)’
    Is it correct? Because December has always 31 days… or is problem on my side?

    Thx in advance

  • Where did newDate come from?


Log in to reply