Giter Site home page Giter Site logo

datepicker.js's Introduction

JavaScript Hijri/Gregorian Datepicker Library

DOI: 10.5281/zenodo.2600133

Demo

Demo here.

Dependencies

Usage

Simply put this code snippet to anywhere you want in the body of your html file:

Offline

<div id="datepicker"></div>
<link rel="stylesheet" href="../w3css/w3.css" />
<script type="text/javascript" src="../HijriDate.js/hijri-date.js"></script>
<script type="text/javascript" src="datepicker.js"></script>
<script type="text/javascript">
    let datepicker = new Datepicker();
    document.getElementById('datepicker').appendChild(datepicker.getElement());
    // or use
    // datepicker.attachTo(document.getElementById('datepicker'));
    // other code
</script>

Online

<div id="datepicker"></div>
<link rel="stylesheet" href="https://zulns.github.io/w3css/w3.css" />
<script type="text/javascript" src="https://zulns.github.io/HijriDate.js/hijri-date.js"></script>
<script type="text/javascript" src="https://zulns.github.io/Datepicker.js/datepicker.js"></script>
<script type="text/javascript">
    let datepicker = new Datepicker();
    document.getElementById('datepicker').appendChild(datepicker.getElement());
    // or use
    // datepicker.attachTo(document.getElementById('datepicker'));
    // other code
</script>

Supported Languages

Languages currently supported are:

  • Arabic ("ar")
  • English ("en")
  • Indonesian ("id")

You can extend with your own language by adding this code snippet (assume your language is English):

Datepicker.language["en"] = {
    isRTL: false,             // or true for right to left language
    eraSuffix: ["AD", "BC"],  // suffix for Gregorian era
    hEraSuffix: ["H", "BH"],  // suffix for Hijri era
    monthNames: [
        "January",
        "February",
        "March",
        "April",
        "May",
        "June",
        "July",
        "August",
        "September",
        "October",
        "November",
        "December"
    ],
    weekdayNames: [
        "Sunday",
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday"
    ],
    weekdayShortNames: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    hMonthNames: [
        "Muharram",
        "Safar",
        "Rabi'ul-Awwal",
        "Rabi'ul-Akhir",
        "Jumadal-Ula",
        "Jumadal-Akhir",
        "Rajab","Sha'ban",
        "Ramadan",
        "Syawwal",
        "Dhul-Qa'da",
        "Dhul-Hijja"
    ];
};

API Documentation

API doc here.

 

 

 


Designed By ZulNs

@Gorontalo, 8 January 2019

datepicker.js's People

Contributors

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