Menu

gitpiper

dayName javascript Code Snippet in 2024

datebeginner

Last Updated: 1 December 2024

Gets the name of the weekday from a Date object.

  • Use Date.prototype.toLocaleDateString() with the { weekday: 'long' } option to retrieve the weekday.
  • Use the optional second argument to get a language-specific name or omit it to use the default locale.
const dayName = (date, locale) => date.toLocaleDateString(locale, { weekday: 'long' });
dayName(new Date()); // 'Saturday' dayName(new Date('09/23/2020'), 'de-DE'); // 'Samstag'

javascript snippet similar to dayName For You in December 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️