Good Practices
Luxon
The luxon package offers a powerful, modern, and friendly wrapper for JavaScript dates and times.
We recommend using it in all of your Date formatting.
Good Practices
The luxon package offers a powerful, modern, and friendly wrapper for JavaScript dates and times.
We recommend using it in all of your Date formatting.
<script lang="ts">
import { DateTime } from 'luxon';
</script>
<p class="text-sm text-slate-500">
The event will happen from <span class="font-bold text-slate-600"
>{events_id.start_time
? DateTime.fromISO(events_id.start_time).toLocaleString(DateTime.DATETIME_MED)
: '--'}</span
>
to
<span class="font-bold text-slate-600"
>{events_id.end_time
? DateTime.fromISO(events_id.end_time).toLocaleString(DateTime.DATETIME_MED)
: '--'}</span
>
</p>