Chalarangelo/30-seconds-of-code

Add 'getLocaleDate' with long/short options'

huyxgit opened this issue · 0 comments

Hi, I would like to add a new snippet to get a locale date format with an option short/long.

Example:
console.log(getLocaleDate(new Date('2020-09-09'), 'en-US', 'L')) // Tuesday, September 8, 2020
getLocaleDate(new Date('2020-09-09'), 'vi-VN', 'L') // Thứ Tư, 9 tháng 9, 2020
getLocaleDate(new Date('2020-09-09'), 'vi-VN', 'S') // 9/9/2020

Thanks!