Git Product home page Git Product logo

pmdatespicker's Introduction

PMDatesPicker

see live demo here : https://hossein-khalili.github.io/PMDatesPicker/

Description

PMDatesPicker is a Jalali multidates picker calendar based on persianDate library and jQuery.

to find out more about persianDate see here : http://babakhani.github.io/PersianWebToolkit/doc/persiandate/0.1.8/

How To Use

lets see how to use it

Installation

first you should add jQuery and persianDate to your project. to do that you just need to add these line of code to your html file.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="http://rawgithub.com/babakhani/PersianDate/master/dist/0.1.8/persian-date-0.1.8.min.js"></script>

add fontawesome stylesheets

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">

and also you should load PMDatesPicker's .js and .css file

<link rel="stylesheet" type="text/css" href="PMDatesPicker.css">
<script src="PMDatesPicker.js"></script>

now you should create a div and add .calendar class and an id to it

<div class="calendar" id="yourFavoriteId" ></div>

after these steps you should initialize your calendar add a script tag to your html and call init function like below

<script>
  var myCalendar = PMDatesPicker.calendar("#yourFavoriteId"); // you can use any selector but i recommend to use ids
</script>

Methods

  var myCalendar = PMDatesPicker.calendar( selector , limit /*optional*/ );

this method create your calendar inside of the element that you selected with the selector. you can also set limits, it's an optional parameter to set number of months from now that user can pick dates from them. limit's default value is 12 months from now.

  myCalendar.now();

returns this moment's persianDate object

  myCalendar.selectDays([date1,date2,...]);
  myCalendar.deselectDays([date1,date2,...]);

select and deselect a special day in calendar, give a list of dates as an argument. dates' format should be like "YYYY-MM-DD"

  myCalendar.nextMonth($("#yourFavoriteId"));
  myCalendar.prevMonth($("#yourFavoriteId"));

go to next or previous month on calendar

  myCalendar.getSelectedDays();

returns a list of selected days.

pmdatespicker's People

Contributors

hossein-khalili avatar

Watchers

 avatar  avatar

pmdatespicker's Issues

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.