<template>
    <v-chip
        small
        outlined
    >
        {{ period }}
    </v-chip>
</template>

<script>
    export default {
        props: {
            curs: {required: true},
            app: {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: 'CursPeriod',
    }
</script>