npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@viclen/vue-month-event-calendar

v0.1.8

Published

Npm: https://www.npmjs.com/package/@viclen/vue-month-event-calendar

Downloads

1

Readme

vue-month-event-calendar

Npm: https://www.npmjs.com/package/@viclen/vue-month-event-calendar

GitHub: https://github.com/viclen/vue-month-event-calendar

Library installation

// npm
npm i @viclen/vue-month-event-calendar --save

// yarn
yarn add @viclen/vue-month-event-calendar

Basic Usage

<template>
  <div id="app">
    <event-calendar :events="eventList" />
  </div>
</template>

<script>
export default {
  name: "app",
  components: {
  },
  data() {
    return {
      eventList: [
        {
          date: new Date(2019,11,12,10,10,10),
          title: "First event",
          desc: "We can set date as a date object or as a string, like the next one."
        },
        {
          date: "2019-12-25 10:00",
          title: "Christmas",
          desc: "An annual festival commemorating the birth of Jesus Christ... (<a href='https://en.wikipedia.org/wiki/Christmas'>Wikipedia</a>)"
        },
        {
          date: new Date(2019,11,10,10,10,0),
          title: "HTML Description",
          desc: "I can create <a href=''>links</a> within the <b>description</b>."
        }
      ]
    };
  }
};
</script>

Language

You may choose the language of the calendar by changing the :language property. The current available languages are en and pt.

If your language is none of the above, or you just want to change which words are displayed, there is also the :translation property. You may create your own translation to what appears to the calendar.

See code below. All available options are there.

<event-calendar :events="eventList" :language="'pt'" :translation="translation" />

<script>
export default {
  data() {
    return {
        translation: {
            noEvent: "No events today.",
            months: [
                "January",
                "February",
                "March",
                "April",
                "May",
                "June",
                "July",
                "August",
                "September",
                "October",
                "November",
                "December"
            ],
            weekDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
            event: "Event", // singular
            events: "Events", // plural
            day: "Day",
        }
    }
  }
}

Color

You may also change the main color of the calendar.

Available colors

To customize the color, you may just write them into the :color property as a string. See the code for more.

Normal

<event-calendar :events="eventList" :color="'normal'" />

normal

Blue

<event-calendar :events="eventList" :color="'blue'" />

blue

Black

<event-calendar :events="eventList" :color="'black'" />

black

Red

<event-calendar :events="eventList" :color="'red'" />

red

Green

<event-calendar :events="eventList" :color="'green'" />

green

Event Deletion

For each event shown in the calendar, there is an '×' button for deleting that event.

If you don't want events to be deletable, use the :showDelete property:

<event-calendar :showDelete="false" />

onDeleteEvent function

If you want to make it possible to delete an event, you shoud inform the onDeleteEvent property.

The parameters of that function are:

  • e -> the event to be deleted, which comes from the :events array;
  • callback -> this is the function that will remove the event from the calendar. You must call this if you want to update the events in the calendar after you delete it.
<event-calendar :onDeleteEvent="(e, callback) => myDeleteFunction(e, callback)" />

<script>
export default {
  methods: {
    // the event (e) here is exactly the same from the events array.
    myDeleteFunction(e, callback){
      // do some async requests
      axios.get('/delete').then(() => {
        // if the event was successfully deleted and the callback exists
        if(eventDeleted && callback){
          // executes the callback
          callback();
        }
      });
    }
  }
}
</script>

Vue JS configuration reference

See Configuration Reference.