rykdesjardins / js-calendar

The lightest Javascript calendar out there, without any dependency.
MIT License
34 stars 7 forks source link

Adding support for js import statement #10

Closed jamacon36 closed 6 years ago

jamacon36 commented 6 years ago

Thanks for this package, it's a lifesaver!

Recompiled using the original npx babel dev/js-calendar.js -o dist/js-calendar.js command after adding JSCalendar & JSCalendarEvent to module.exports:

(() => {
    module.exports = {JSCalendar, JSCalendarEvent}
})(JSCalendar, JSCalendarEvent)

This addresses issue #4 and replaces my original pull request ( #9 ) that has since been closed.

Usage:

import * as LibName from "vanilla-js-calendar"

var elem = document.getElementById("myCalendar");
var JSCalendar = LibName.JSCalendar;
var JSCalendarEvent = LibName.JSCalendarEvent;
var calendar = new JSCalendar(elem, { /* options */ }).init().render();
rykdesjardins commented 6 years ago

Hi @jamacon36, thank you so much for this contribution!

As I don't maintain this library no more, I'm surprised you went into that much trouble to fork this and fix two issues at once ; that's great.

Everything seems to be on point. I will merge your PR in a dev branch before pushing the whole thing to NPM, and you should get your green squares in no time ;)

Thanks again!