There is no in-built support in luxon for that, but you can write your custom logic something like below.
// Import the DateTime class from Luxon
const DateTime = luxon.DateTime;
// Function to add ordinal suffix to day number
function addOrdinal(number) {
const suffixes = ['th', 'st', 'nd', 'rd'];
const v = number % 100;
return number + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);
}
const date = DateTime.local(2023, 1, 1);
// Format the date as "1st Jan"
const formattedDate = `${addOrdinal(date.day)} ${date.toFormat('LLL')}`;
console.log(formattedDate); // Output: 1st Jan
There is no in-built support in luxon for that, but you can write your custom logic something like below.