1. Good Practices
  2. Luxon

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.

Usage Example

        <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>