You can use moment.js
library to find the date string of last 3 days in typescript. Here's the code using moment.js
:
index.ts276 chars8 lines
In this code, we import moment
library and use it to get today's date in the specified format. We then subtract 3 days from today's date using subtract
method of moment
. Finally, we get the date string of last 3 days in the specified format using format
method of moment
.
gistlibby LogSnag