How should I convert a date format of YYYY-MM-DD
into a human readable format %e %B %Y
in JS by taking into an account a different language from system's locale?
In PHP it would be like
<?php echo trim(strftime('%e %B %Y', strtotime('2019-07-31'))); ?>
// Renders: 31 July 2019
I want to have the same, but with a corresponding language locale, for example "French format" so it will become : 31 Juillet 2019
==== UPDATED ====
As mention by @Baljinder Singh, solution below from the link, works perfectly
console.log(
new Date('2019-07-31').toLocaleDateString('fr-FR', {
year: 'numeric',
month: 'long',
day: 'numeric'
})
)