techouse / intl-date-time

International DateTime for Laravel Nova
MIT License
57 stars 21 forks source link

Invalid date in index view when field value is null #1

Closed aviuz80 closed 5 years ago

aviuz80 commented 5 years ago

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>
techouse commented 5 years ago

Thanx for reporing it. Fixed!