To use the startOfYesterday
function from the date-fns
library with TypeScript, you will first need to install the library:
index.ts21 chars2 lines
Next, you can import the function into your TypeScript file:
index.ts45 chars2 lines
Then, you can use it in your code:
index.ts131 chars3 lines
This function returns a Date
object representing the start of yesterday (12:00 AM at the beginning of the day) in your current timezone.
gistlibby LogSnag