Answers for "react date component with word month"

0

react date component with word month

// Single-File-Component for React 
// Displays month as a word - format: December 31, 2021
export default function currentDate() {
  const current = new Date();

  const month = current.toLocaleString("default", { month: "long" });
  const date = `${month} ${current.getDate()}, ${current.getFullYear()}`;

  return <span>{date}</span>;
}
Posted by: Guest on December-27-2021

Code answers related to "react date component with word month"

Code answers related to "Javascript"

Browse Popular Code Answers by Language