[Javascript] Relative time foramt
const rtf = new Intl.RelativeTimeFormat(
navigator.language
)
const res = rtf.format(-2, 'day')
console.log(res) // "2 days ago"
const rtf = new Intl.RelativeTimeFormat(
navigator.language
)
const res = rtf.format(-2, 'day')
console.log(res) // "2 days ago"