Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ycsm's avatar
Level 1

Vue.JS - V-Calendar - Can't add name/description/label to date?

I'm looking to implement a very simple calendar that lists events. I can add the events to the calendar - but I can't seem to add a corresponding description. What is it I'm doing wrong here?

enter image description here

<template>
    <div>
        <v-calendar  :columns="$screens({ default: 1, lg: 3, xl: 4 })"
                     :rows="$screens({ default: 1, lg: 2, xl: 3 })"
                     :is-expanded="$screens({ default: true, lg: false })"
                     :attributes='attrs'
                     :min-date='new Date()'
        ></v-calendar>
    </div>
</template>

<script>

    export default {
        data() {
            return {
                attrs: [
                    {
                        highlight: {
                            backgroundColor: '#000',
                        },
                        popover: {label: 'something'},
                        dates: [
                            {
                                popover: 'ergerg', // doesn't work
                                label: 'John Birthday', // doesn't work
                                name: 'John Birthday', // doesn't work
                                title: 'John Birthday', //doesn't work
                                start: new Date(2020, 3, 1),
                                end: new Date(2020, 3, 1),

                            }
                        ]
                    }
                ],
            };
        },
    };
</script>

<style scoped>

</style>

0 likes
2 replies
Sti3bas's avatar
Sti3bas
Best Answer
Level 53

@ycsm not sure if I fully understand you, but each object in attrs array represent an event:

attrs: [
   {
      highlight: '#000',
      popover: {
         label: 'John Birthday'
      },
      dates: new Date(2020, 3, 1)
   },
   {
      highlight: '#000',
      popover: {
         label: 'Other event'
      },
      dates: new Date(2020, 5, 1)
   }
],

https://vcalendar.io/attributes.html#quick-guide

ycsm's avatar
Level 1

Damn, such a simple thing I overlooked..! Thanks for your help

Please or to participate in this conversation.