Giter VIP home page Giter VIP logo

elementcalendar's Introduction

New Calendar

Inspire from jackducasse/caleandar and I fork to [My Reposite] (https://github.com/rachmanzz/calendar) that make A lightweight, library independent JavaScript calendar.

Default theme using jackducasse/caleandar theme, but you can make custom theme by your own. You don't need follow default theme structure, you can make by your own structure but you need extra time to write your own thema in Element Calendar.

How to

To call instance Element Calendar like this:

    var element = document.getElementById('calendar')
    var calendar = new ElementCalendar(new Date()
    // or 
    var calendar = new ElementCalendar(new Date(2019, 10, 1)
    calendar.create(element) // to create calandar 

Extra setting is possible at Element Calendar

    var calendar = new ElementCalendar(new Date(), { /** setting **/ } )
  • Add Extra Style using styles object

    1. date
    2. currentMonth
    3. prevMonth
    4. nextMonth
    5. today
    6. selectedDay
  • Add custom tag and style using templetes object

    1. date
    2. currentMonth
    3. prevMonth
    4. nextMonth
  • add event click by onclick object

    1. date

Own Style and structure

In this case you can inject your own html template, no worry about default html structure.

    var element = document.getElementById('calendar')
    var calendar = new ElementCalendar(new Date()
    var custom = [
        {
            node: 'div', className: ['class'],
            attr: [ { name: 'title', value: 'Menu' } ],
            onlick: function () { /* click event */ },
            child: [ { node: 'div', className: ['class'] } ]
        }
    ]
    calendar.custom(custom).create(element) // to create calandar 

Learn how Custom template work

  1. node is html item tag like div, a, img and etc
  2. className is class array
  3. attr is html tag attribute
  4. onclick is event click in your html tag
  5. child to inject child html tag to your current html tag

theme from https://codepen.io/eliza-rjb/pen/xmbEWX

elementcalendar's People

Contributors

dependabot[bot] avatar rachmanzz avatar

Watchers

 avatar  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.