UNPKG

nodebook

Version:

Node.js — Apprendre par l'exemple • Devenez autonome avec JavaScript, l'écosystème npm, le développement frontend, les applications web et en ligne de commande.

10 lines (7 loc) 389 B
const past = new Date('2013-12-04 10:00:00'); const options = { year: 'numeric', month: 'short', day: 'numeric' }; const longOptions = {...options, weekday: 'long', month: 'long'}; const fr = new Intl.DateTimeFormat('fr-FR', options); const frLong = new Intl.DateTimeFormat('fr-FR', longOptions); console.log(fr.format(past)); // <1> console.log(frLong.format(past)); // <2>