<template>
    <v-card-text class="py-0 px-1 d-flex align-center justify-space-between">
        <strong class="text-caption">
            {{ __('Perioada')}}
        </strong>
        <v-chip-group column class="my-0">
            <v-chip small>
                {{ period }}
            </v-chip>
        </v-chip-group>
    </v-card-text>
</template>

<script>
    export default {
        props: {
            curs: {required: true},
        },

        computed: {
            period() {
                if(! this.curs.date_to && ! this.curs.date_from )
                {
                    return '';
                }

                if(this.curs.date_to && this.curs.date_from)
                {
                    return this.ToDate(this.curs.date_from) + ' - ' + this.ToDate(this.curs.date_to)
                }

                if(this.curs.date_from)
                {
                    return this.__('De la :date', {date: this.ToDate(this.curs.date_from)})
                }

                return this.__('Până la :date', {date: this.ToDate(this.curs.date_to)})
            }
        },

        name: 'CursCardPeriod',
    }
</script>