Trying a simple code here using Intl library internally on top of Luxon here to get relative dates. If my current date is in 2 hours ago, in 2 hours, etc, I want it to display today. Else, I want it to display 1 day ago or in 1 day.
I have numeric set to auto but it doesn't seem to get picked up.
const {DateTime} = require('luxon');
console.log(DateTime.fromMillis(Date.now() - 10090909).toRelative({
numeric: 'auto',
}));
// Date.now - 10090909 is 2 hours ago,
// but output here comes out to be 0 days ago
// expected is today
Sources I m referring: