Code Monkey home page Code Monkey logo

opencalendar-js's Introduction

Calendar.js

Have you ever needed to add a calendar to your web page, but didn't want to implement your own? This widget is for you. With a simple interface to customize your calendar, this can be easily added to any project. The calendar is implemented in JavaScript, with some CSS added for basic structure.

Customization

There is customization available through both CSS and JavaScript

CSS

In your CSS, you can customize the look of the calendar using the following selectors:

  • #calendar
  • #calendar-title
  • #calendar-days
  • .day
  • #highlighted-day

However, when customizing, do not use the following attributes:

  • display
  • grid-template-columns
  • grid-template-rows
  • grid-auto-flow
  • grid-column
  • grid-row

JavaScript

To create a calendar, simply call create_calendar(year, month), where year and month are integer values representing the year and the month. The month is 0-based, which means that January is 0, February is 1, and December is 11.

create_calendar returns an object with the following functions:

  • get_calendar(): returns a DOM object that can be inserted into the HTML
  • set_calendar_title(new_title): sets the title of the calendar
  • highlight_day(day_of_month): highlights the given day of the month

Issues

Find an issue? Feel free to report it! I'll fix it as soon as I can.

Contributing

Pull requests are welcome. Feel free to fix bugs, respond to issues, or add your own improvements. Just make sure that you explain what you did in your request.

opencalendar-js's People

Contributors

pixilcode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.