Date Utils



  • When i use date.endOfDate(,‘month’). I got this error : TypeError: t.getFullYear is not a function.
    i don’t get it because i use the date.startOfDate(,‘month’) it’s working…

      state.PaieCalendar[0].EndPeriod = date.formatDate(
        date.endOfDate(payload, "month"),
        "YYYY/MM/DD"
      );


  • state.PaieCalendar[0].EndPeriod = date.formatDate(
    date.subtractFromDate(
    date.startOfDate(date.addToDate(payload, { month: 1 }), “month”),
    { days: 1 }
    ),
    “YYYY/MM/DD”
    );
    i found this but…



  • I find date-fns module very helpful