File size: 433 Bytes
3206347 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import { DateTime } from 'luxon';
export default function getDateTimeObjectRepresentation(dateTime) {
const defaults = dateTime.toObject();
return {
...defaults,
ISO_date_time: dateTime.toISO(),
pretty_date: dateTime.toLocaleString(DateTime.DATE_MED),
pretty_time: dateTime.toLocaleString(DateTime.TIME_WITH_SECONDS),
pretty_day_of_week: dateTime.toFormat('cccc'),
day_of_week: dateTime.weekday,
};
}
|