To use the isThursday()
function from the date-fns
library in Javascript, you will first need to install the library via npm (or yarn) using the following command:
21 chars2 lines
Once installed, you can import the isThursday()
function into your code like this:
39 chars2 lines
Then, simply call the isThursday()
function and pass in a date object as an argument to determine if the given date is a Thursday:
117 chars4 lines
Alternatively, you can also pass in a string that can be parsed into a date object:
153 chars6 lines
gistlibby LogSnag