techouse/intl-date-time

Invalid date in index view when field value is null

Closed this issue · 1 comments

Hi.

When a Datetime field has null value in the index view it's displayed as 'Invalid date'.
In detail view it works and show '—'.

I think v-if/else is missing in resources/js/components/Index/DateTimeField.vue.

From:

<template>
    <span class="whitespace-no-wrap">{{ localizedDateTime }}</span>
</template>

To:

<template>
    <span v-if="field.value" class="whitespace-no-wrap">{{ localizedDateTime }}</span>
    <span v-else>&mdash;</span>
</template>
  • laravel/framework v5.7.27
  • laravel/nova v1.3.2
  • techouse/intl-date-time v1.0.4

Thanx for reporing it. Fixed!