You can achieve this by using the Date()
constructor in JavaScript to parse the string and then using string interpolation or concatenation to format it in the desired way.
Here's the most concise way to do it in JavaScript:
index.tsx206 chars4 lines
Alternatively, you can write it in a more explicit manner by storing the parsed date in a variable first:
index.tsx223 chars5 lines
gistlibby LogSnag