behzadi_persian_datepicker 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +50 -0
- data/Rakefile +2 -0
- data/app/assets/javascripts/persianDatepicker.min.js +14 -0
- data/app/assets/stylesheets/persianDatepicker-dark.css +190 -0
- data/app/assets/stylesheets/persianDatepicker-default.css +190 -0
- data/behzadi_persian_datepicker.gemspec +24 -0
- data/lib/behzadi_persian_datepicker.rb +6 -0
- data/lib/behzadi_persian_datepicker/engine.rb +4 -0
- data/lib/behzadi_persian_datepicker/version.rb +3 -0
- metadata +84 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: c21c4db8db464d71a94fb1c184fd2f1f703c6a97
|
|
4
|
+
data.tar.gz: 37a1db584248c8f5e9a3797653f21c7d7fe66bb3
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9480d44a958647bf83ca9876009d99db36262ffde85eae78fe566436040c8768847150751d662491c8a9dd9577e89e9b2ed727fac6aa511a232e97c27f955fd2
|
|
7
|
+
data.tar.gz: 4616f2ca93cd26b1fe32e0deafc558c90db2280d862467eee5600231e446c826e225408e6af54cd4b4d9653d5bffa8696d176224232421e03354c49120b17a20
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Pouya Gharib Pour
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# BehzadiPersianDatepicker
|
|
2
|
+
|
|
3
|
+
Rails plugin for [persianDatepicker](https://github.com/behzadi/persianDatepicker) JS library.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'behzadi_persian_datepicker'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
Or install it yourself as:
|
|
18
|
+
|
|
19
|
+
$ gem install behzadi_persian_datepicker
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Require javascript file in your **application.js** file:
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
//= require persianDatepicker.min
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
And require the theme you want to use in your **application.css** file:
|
|
31
|
+
|
|
32
|
+
```scss
|
|
33
|
+
*= require persianDatepicker-dark
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or:
|
|
37
|
+
|
|
38
|
+
```scss
|
|
39
|
+
*= require persianDatepicker-default
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Contributing
|
|
43
|
+
|
|
44
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/psparabara/behzadi_persian_datepicker.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
50
|
+
|
data/Rakefile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* persianDatepicker v0.1.0
|
|
3
|
+
* http://github.com/behzadi/persianDatepicker/
|
|
4
|
+
* http://mbehzadi.com/persianDatepicker/
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2013 Mohammad hasan Behzadi All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Released under the MIT license.
|
|
9
|
+
*
|
|
10
|
+
* jalali Date Functions from NASA.gov
|
|
11
|
+
*
|
|
12
|
+
* Date: Tue Jan 1 2013
|
|
13
|
+
*/
|
|
14
|
+
(function(){$.fn.persianDatepicker=function(n){var i="persianDatepicker",r=this.data(i);return r?n===!0?r:this:this.each(function(){return $(this).data(i,new t(this,n))})};var t=function(){function n(n,t){var e={months:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],dowTitle:["شنبه","یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنج شنبه","جمعه"],shortDowTitle:["ش","ی","د","س","چ","پ","ج"],showGregorianDate:!1,persianNumbers:!0,formatDate:"YYYY/MM/DD",selectedBefore:!1,prevArrow:"◄",nextArrow:"►",theme:"default",alwaysShow:!1,selectableYears:null,selectableMonths:[1,2,3,4,5,6,7,8,9,10,11,12],cellWidth:25,cellHeight:20,fontSize:13,isRTL:!1,calendarPosition:{x:0,y:0},onShow:function(n){n.show()},onHide:function(n){n.hide()}},i=this,r,o,f;i.el=$(n),r=i.el,i.options=$.extend(!0,{},e,t),o=i.options,_fontSize=i.options.fontSize,i.cellStyle="style='width:"+i.options.cellWidth+"px;height:"+i.options.cellHeight+"px;line-height:"+i.options.cellHeight+"px; font-size:"+_fontSize+"px; ' ",i.headerStyle="style='height:"+(i.options.cellHeight+10)+"px;line-height:"+i.options.cellHeight+"px; font-size:"+(_fontSize+4)+"px;' ",i.selectUlStyle="style='margin-top:"+i.options.cellHeight+"px;height:"+(i.options.cellHeight*7+20)+"px; font-size:"+(_fontSize-2)+"px;' ",i.selectMonthLiStyle="style='height:"+(i.options.cellHeight*7+7)/4+"px;line-height:"+(i.options.cellHeight*7+7)/4+"px; width:"+(7*i.options.cellWidth+1)/3+"px;width:"+7*i.options.cellWidth/3+"px\\9;' ",i.selectYearLiStyle="style='height:"+(i.options.cellHeight*7+10)/6+"px;line-height:"+(i.options.cellHeight*7+10)/6+"px; width:"+(7*i.options.cellWidth-14)/3+"px;width:"+(7*i.options.cellWidth-15)/3+"px\\9;' ",i.footerStyle="style='height:"+i.options.cellHeight+"px;line-height:"+i.options.cellHeight+"px; font-size:"+_fontSize+"px;' ",i.jDateFunctions=new u,_persianDate=i.now(),i.options.selectableYears!=undefined&&i.options.selectableYears._indexOf(_persianDate.year)==-1&&(_persianDate.year=this.options.selectableYears[0]),i.options.selectableMonths._indexOf(_persianDate.month)==-1&&(_persianDate.month=this.options.selectableMonths[0]),i.persianDate=_persianDate,i._id="pdp-"+Math.round(Math.random()*1e7),i.persianDate.formatDate=i.options.formatDate,i.calendar=$('<div id="'+i._id+'" class="pdp-'+i.options.theme+'" />'),(r.attr("pdp-id")||"").length||r.attr("pdp-id",i._id),r.addClass("pdp-el").bind("click",function(n){i.show(n)}).bind("focus",function(n){i.show(n)}),i.options.selectedBefore&&!i.options.showGregorianDate&&i.showDate(r,i.now().toString(i.options.formatDate)),i.options.selectedBefore&&i.options.showGregorianDate&&i.showDate(r,i.now().gDate._toString(i.options.formatDate)),i.options.isRTL&&r.addClass("rtl"),i.calendar.length&&!o.alwaysShow&&i.calendar.hide(),$(document).bind("mouseup",function(n){var u=n.target,f=i.calendar,t;r.is(u)||f.is(u)||f.has(u).length!==0||!f.is(":visible")||i.hide(),t=$(".pdp-"+i.options.theme+" .yearSelect"),t.is(n.target)||t.has(n.target).length!==0||t.hide(),t=$(".pdp-"+i.options.theme+" .monthSelect"),t.is(n.target)||t.has(n.target).length!==0||t.hide()}),f=function(){var n=r.offset();i.calendar.css({top:n.top+r.outerHeight()+i.options.calendarPosition.y+"px",left:n.left+i.options.calendarPosition.x+"px"})},$(window).resize(f),f(),$("body").append(i.calendar),i.render()}return n.prototype={show:function(){$.each($(".pdp-el").not(this.el),function(n,t){if(t.length)t.options.onHide(t.calendar)});this.options.onShow(this.calendar)},hide:function(){if(this.options&&!this.options.alwaysShow)this.options.onHide(this.calendar)},render:function(){this.calendar.children().remove(),this.header(),this.dows(),this.content(),this.footer()},header:function(){var n=this,h,o,s;_monthYear=$('<div class="" />'),_monthYear.appendTo(this.calendar),_head=$('<div class="pdp-header" '+n.headerStyle+" />"),_head.appendTo(this.calendar),_next=$('<div class="nextArrow" />').html(this.options.nextArrow).attr("title","ماه بعد").bind("click",function(){for(nextMonth=n.persianDate.month+1;n.options.selectableMonths._indexOf(nextMonth)==-1&&nextMonth<13;nextMonth++);n.persianDate.addMonth(nextMonth-n.persianDate.month),n.render()}),_next.appendTo(_head);var r=$('<ul class="monthSelect" '+n.selectUlStyle+" />").hide(),t=$('<ul class="yearSelect" '+n.selectUlStyle+" />").hide(),f=$("<span/>").html(n.options.months[n.persianDate.month-1]).mousedown(function(){return!1}).click(function(n){n.stopPropagation(),t.css({display:"none"}),r.css({display:"inline-block"})}),e=$("<span/>").html(n.options.persianNumbers?n.jDateFunctions.toPersianNums(n.persianDate.year):n.persianDate.year).mousedown(function(){return!1}).click(function(n){n.stopPropagation(),r.css({display:"none"}),t.css({display:"inline-block"}),t.scrollTop(70)}),u=function(r,u){var f=!1,e;for(r===undefined&&u===undefined?(b=n.persianDate.year-19,a=n.persianDate.year+29):u==0?(a=r,b=a-6,f=!0):r==0&&(b=u,a=b+6),e=[],i=b;i<a&&a>0;i++)e.push(parseInt(i));$.each(n.options.selectableYears||e,function(i,r){var u=$("<li "+n.selectYearLiStyle+" />").html(n.options.persianNumbers?n.jDateFunctions.toPersianNums(r):r);r==n.persianDate.year&&u.addClass("selected"),u.attr("value",r),u.bind("click",function(){n.persianDate.date=1,n.persianDate.year=parseInt(r),n.render()}),f?t.prepend(u):t.append(u)})};u(),h=function(){var t=[];for(i=0;i<12;i++)t.push(n.options.months[i]);return t},o=function(){var t=[];for(i=0;i<12;i++)t.push(n.options.months[i]);return t},$.each(o(),function(t,i){var u=n.options.selectableMonths._indexOf(t+1)==-1?$('<li class="desableMonth" '+n.selectMonthLiStyle+" />").html(i):$("<li "+n.selectMonthLiStyle+" />").html(i);t+1==n.persianDate.month&&u.addClass("selected"),u.data("month",i),u.bind("click",function(){u.hasClass("desableMonth")||(n.persianDate.date=1,n.persianDate.month=parseInt(t+1),n.render())}),r.append(u)}),t.bind("scroll",function(){n.options.selectableYears==undefined&&(c=$(this).find("li").length,firstYear=parseInt($(this).find("li:first").val()),lastYear=parseInt($(this).children("li:last").val()),lisHeight=c/3*($(this).find("li:first").height()+4),_com=$(this).scrollTop().toString().length*500,$(this).scrollTop()<_com.toString().length*1e3&&firstYear>=1&&u(firstYear,0),_com=$(this).scrollTop().toString().length*100,lisHeight-$(this).scrollTop()>-_com&&lisHeight-$(this).scrollTop()<_com&&(u(0,lastYear),$(this).scrollTop($(this).scrollTop()-50)),$(this).scrollTop()<_com.toString().length&&$(this).scrollTop(_com.toString().length*500))}),_monthYear.append(r).append(t),s=$('<div class="monthYear" />').append(f).append("<span> <\/span>").append(e),_head.append(s),_prev=$('<div class="prevArrow" />').html(this.options.prevArrow).attr("title","ماه قبل").bind("click",function(){for(prevMonth=n.persianDate.month-1;n.options.selectableMonths._indexOf(prevMonth)==-1&&prevMonth>0;prevMonth--);n.persianDate.addMonth(-(n.persianDate.month-prevMonth)),n.render()}),_prev.appendTo(_head)},dows:function(){for(_row=$('<div class="dows" />'),i=0;i<7;i++)_cell=$('<div class="dow cell " '+this.cellStyle+" />").html(this.options.shortDowTitle[i]),_cell.appendTo(_row);_row.appendTo(this.calendar)},content:function(){var n=this,r,t,i;for(_days=$('<div class="days" />'),_days.appendTo(this.calendar),jd=n.persianDate,jd.date=1,_start=n.jDateFunctions.getWeekday(n.jDateFunctions.getJulianDayFromPersian(jd)),_end=n.jDateFunctions.getLastDayOfPersianMonth(n.persianDate),r=0,t=0;r<6;r++){for(_row=$("<div />"),i=0;i<7;i++,t++)t<_start||t-_start+1>_end?_cell=$('<div class="nul cell " '+n.cellStyle+" />").html(" "):(_dt=n.getDate(n.persianDate,t-_start+1),_today="",_selday="",n.now().compare(_dt)==0&&(_today="today"),t-_start+1==n.now().date&&(_selday="selday"),_fri=i==6?"friday":"",_cell=$('<div class="day cell '+_fri+" "+_today+" "+_selday+'" '+n.cellStyle+" />"),_cell.data("date",{jDate:_dt.toString("YYYY/MM/DD/DW"),gDate:n.jDateFunctions.getGDate(_dt)._toString(n.options.formatDate)}),_cell.html(n.options.persianNumbers?n.jDateFunctions.toPersianNums(t-_start+1):t-_start+1).bind("click",function(){n.calendar.find(".day").removeClass("selday"),$(this).addClass("selday"),n.options.showGregorianDate?n.showDate(n.el,$(this).data("date").gDate):n.showDate(n.el,n.persianDate.parse($(this).data("date").jDate).toString(n.options.formatDate)),n.calendar.hide()})),_cell.appendTo(_row);_row.appendTo(_days)}},footer:function(){var n=this;_footer=$('<div class="footer" '+n.footerStyle+" />"),_footer.appendTo(this.calendar),n.options.selectableMonths._indexOf(n.persianDate.month)>-1&&(_goToday=$('<a class="goToday" />'),_goToday.data("date",{jDate:n.now().toString("YYYY/MM/DD/DW"),gDate:n.jDateFunctions.getGDate(n.now())._toString(n.options.formatDate)}),_goToday.attr("href","javascript:;").html("هم اکنون").bind("click",function(){n.persianDate=n.now(),n.options.showGregorianDate?n.showDate(n.el,$(this).data("date").gDate._toString(n.options.formatDate)):n.showDate(n.el,n.persianDate.parse($(this).data("date").jDate).toString(n.options.formatDate)),n.calendar.find(".day").removeClass("selday"),n.render(),n.calendar.find(".today").addClass("selday"),n.hide()}),_goToday.appendTo(_footer))},showDate:function(n,t){n.is("input")?n.val(t):n.html(t)},getDate:function(n,t){return n.date=t,n.day=this.jDateFunctions.getWeekday(this.jDateFunctions.getJulianDayFromPersian(n)),n},now:function(){return this.jDateFunctions.getPCalendarDate(this.jDateFunctions.getJulianDay(new Date))}},n}(),n=function(){function n(){var n=this;n.months=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],n.dowTitle=["شنبه","یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنج شنبه","جمعه"],n.year=1300,n.month=1,n.date=1,n.day=1,n.gDate=new Date}return n.prototype={addMonth:function(n){return this.month+=n,this.month>=13?(this.month=1,this.addYear(1)):this.month<=0&&(this.month=12,this.addYear(-1)),this},addYear:function(n){this.year+=n},compare:function(n){if(n.year==this.year&&n.month==this.month&&n.date==this.date)return 0},parse:function(t){arr=t.split("/"),y=arr[0],m=arr[1],d=arr[2],wd=arr[3];var i=new n,r=new Date;return i.year=parseInt(y),i.month=parseInt(m),i.date=parseInt(d),i.day=wd,i.gDate=new Date,i},toString:function(n){return n===undefined?this.year+"/"+this.month+"/"+this.date:n.replace("YYYY",this.year).replace("MM",this.month).replace("DD",this.date).replace("hh",this.gDate.getHours()).replace("mm",this.gDate.getMinutes()).replace("ss",this.gDate.getSeconds()).replace("tm",this.gDate.getHours()>=12&&this.gDate.getMinutes()>0?"ب.ظ":"ق.ظ").replace("ms",this.gDate.getMilliseconds()).replace("NM",this.months[this.month-1]).replace("DW",this.day).replace("ND",this.dowTitle[this.day])}},n}(),u=function(){function t(){}return t.prototype={toPersianNums:function(n){for(strnum=n.toString(),nums=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],res="",i=0;i<strnum.length;i++)res+=nums[parseInt(strnum[i])];return res},getGDate:function(n){return this.getGCalendarDate(this.getJulianDayFromPersian(n),"gmonth")},getPCalendarDate:function(t){var u=0,f=0,c=0,v,w,h,r;if(t>0){var l=t+.5,y=Math.floor(l),b=l-y,e=Math.floor(t)+.5,i=new n;i.year=475,i.month=1,i.date=1;var a=e-this.getJulianDayFromPersian(i),p=Math.floor(a/1029983),o=a%1029983,s;o==1029982?s=2820:(v=Math.floor(o/366),w=o%366,s=Math.floor((2134*v+2816*w+2815)/1028522)+v+1),u=s+2820*p+474,u<=0&&u--,i.year=u,i.month=1,i.date=1,h=e-this.getJulianDayFromPersian(i)+1,f=h<=186?Math.ceil(h/31):Math.ceil((h-6)/30),i.year=u,i.month=f,i.date=1,c=e-this.getJulianDayFromPersian(i)+1}else alert("Invalid date");return r=new n,r.year=u,r.month=f,r.date=c,r.day=this.getWeekday(this.getJulianDayFromPersian(r)),r.gDate=new Date,r},getGCalendarDate:function(n,t){var e=0,i=0,c=0,a;if(n>0){var l=n+.5,u=Math.floor(l),y=l-u,o;t=="jmonth"||t=="jgmonth"&&u<2299161?o=u:(t=="gmonth"||t=="jgmonth"&&u>=2299161)&&(a=Math.floor((u-1867216.25)/36524.25),o=u+1+a-Math.floor(a/4));var s=o+1524,h=Math.floor((s-122.1)/365.25),v=Math.floor(365.25*h),f=Math.floor((s-v)/30.6001);c=s-v-Math.floor(30.6001*f)+y,f<14?i=f-1:(f==14||f==15)&&(i=f-13),i>2?e=h-4716:(i==1||i==2)&&(e=h-4715)}else alert("Invalid date");return r=new Date,new Date(e,i-1,c,r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds())},getJulianDay:function(n,t){var t=t===undefined?0:t,r=n.getFullYear(),i=n.getMonth()+1,u=n.getDate(),f=r+0,e=i+0,n=u+0,o,s,h;return e<=2&&(f=f-1,e=e+12),o=0,(u<1||(i==1||i==3||i==5||i==7||i==8||i==10||i==12)&&u>31||(i==4||i==6||i==9||i==11)&&u>30)&&alert("Invalid date"),t==2||t==0&&(r<1582||r==1582&&i<10||r==1582&&i==10&&u<=4)?(o=0,r/4==Math.round(r/4)&&i==2&&u>29&&alert("Invalid date")):t==1||t==0&&(r>1582||r==1582&&i>10||r==1582&&i==10&&u>=15)?(s=Math.floor(f/100),o=2-s+Math.floor(s/4),r/4==Math.round(r/4)&&(r/100==Math.round(r/100)?r/400==Math.round(r/400)&&i==2&&u>29&&alert("Invalid date"):i==2&&u>29&&alert("Invalid date"))):alert("Invalid date"),h=Math.floor(365.25*(f+4716))+Math.floor(30.6001*(e+1))+n+o-1524.5},getJulianDayFromPersian:function(n){y0=n.year,m0=n.month,d0=n.date;var t=y0-(y0>=0?474:473),i=474+t%2820;return d0+(m0<=7?(m0-1)*31:(m0-1)*30+6)+Math.floor((i*682-110)/2816)+(i-1)*365+Math.floor(t/2820)*1029983+(1948320.5-1)},getWeekday:function(n){return wds=[1,2,3,4,5,6,0],wd=Math.floor((n+1.5)%7),wds[wd]},getLastDayOfPersianMonth:function(n){return(y=n.year,m=n.month,m>=1&&m<=6)?31:m>=7&&m<12?30:(m!=12&&alert("Invalid date"),((y-(y>0?474:473))%2820+474+38)*682%2816<682)?30:29}},t}();(function(){Date.prototype._toString=function(n){return(months=["Januray","February","March","April","May","June","Julay","August","September","October","November","December"],dows=["Sun","Mon","Tue","Wed","Tur","Fri","Sat"],n===undefined||n=="default")?this:n.replace("YYYY",this.getFullYear()).replace("MM",this.getMonth()+1).replace("DD",this.getDate()).replace("hh",this.getHours()).replace("mm",this.getMinutes()).replace("ss",this.getSeconds()).replace("ms",this.getMilliseconds()).replace("tm",this.getHours()>=12&&this.getMinutes()>0?"PM":"AM").replace("NM",months[this.getMonth()]).replace("DW",this.getDay()).replace("ND",dows[this.getDay()])},Array.prototype._indexOf=function(n){return $.inArray(n,this)}})()})()
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
|
|
2
|
+
@keyframes start {
|
|
3
|
+
from {
|
|
4
|
+
transform: scale(.5);
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
transform: scale(1);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@-webkit-keyframes start {
|
|
12
|
+
from {
|
|
13
|
+
-webkit-transform: scale(.5);
|
|
14
|
+
}
|
|
15
|
+
to {
|
|
16
|
+
-webkit-transform: scale(1);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.rtl{direction:rtl}
|
|
20
|
+
.pdp-dark {
|
|
21
|
+
position: absolute;
|
|
22
|
+
direction: rtl;
|
|
23
|
+
color: #f2f2f2;
|
|
24
|
+
box-shadow: 1px 1px 8px 1px rgba(0, 0, 0, 0.49);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.pdp-dark ::-webkit-scrollbar-track
|
|
28
|
+
{
|
|
29
|
+
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
|
30
|
+
background-color: #F5F5F5;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.pdp-dark ::-webkit-scrollbar
|
|
34
|
+
{
|
|
35
|
+
width: 15px;
|
|
36
|
+
background-color: #F5F5F5;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.pdp-dark ::-webkit-scrollbar-thumb
|
|
40
|
+
{
|
|
41
|
+
background-color: #444444;
|
|
42
|
+
}
|
|
43
|
+
.pdp-dark ::selection{
|
|
44
|
+
color: #67cdcc;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pdp-dark .pdp-header{
|
|
48
|
+
background-color: #333;
|
|
49
|
+
border-top: 2px solid #999;
|
|
50
|
+
border-left: 1px solid #999;
|
|
51
|
+
border-right: 1px solid #999;
|
|
52
|
+
border-bottom: none;
|
|
53
|
+
padding: 2px;
|
|
54
|
+
font-weight: bold;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.pdp-dark .yearSelect{
|
|
58
|
+
overflow-y: auto;
|
|
59
|
+
direction: ltr;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.pdp-dark .monthSelect li.desableMonth, .pdp-dark .monthSelect li.desableMonth:hover{
|
|
63
|
+
color: #bbb;
|
|
64
|
+
background: #eee;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.pdp-dark .yearSelect, .pdp-dark .monthSelect{
|
|
68
|
+
font:normal 12px Tahoma;
|
|
69
|
+
background: #555;
|
|
70
|
+
border: 1px solid #999;
|
|
71
|
+
list-style: none;
|
|
72
|
+
position: absolute;
|
|
73
|
+
padding: 0;
|
|
74
|
+
width: 99.6%;
|
|
75
|
+
text-align: right;
|
|
76
|
+
z-index: 9999;
|
|
77
|
+
animation: start 0.2s;
|
|
78
|
+
-webkit-animation: start 0.2s;
|
|
79
|
+
}
|
|
80
|
+
.pdp-dark .selected{
|
|
81
|
+
background: #15a6eb;
|
|
82
|
+
color: #ffffff;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.pdp-dark .yearSelect li, .pdp-dark .monthSelect li {
|
|
86
|
+
padding: 1px;
|
|
87
|
+
cursor: default;
|
|
88
|
+
display: inline-table;
|
|
89
|
+
text-align: center;
|
|
90
|
+
border: 1px dotted #888;
|
|
91
|
+
}
|
|
92
|
+
.pdp-dark .yearSelect li:hover, .pdp-dark .monthSelect li:hover {
|
|
93
|
+
background: #FF9933;
|
|
94
|
+
color: #ffffff;
|
|
95
|
+
border-color: #FF7700;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.pdp-dark .nextArrow{
|
|
99
|
+
right:0;
|
|
100
|
+
}
|
|
101
|
+
.pdp-dark .prevArrow{
|
|
102
|
+
left:0;
|
|
103
|
+
}
|
|
104
|
+
.pdp-dark .monthYear{
|
|
105
|
+
width: 80%;
|
|
106
|
+
margin: 0 auto;
|
|
107
|
+
text-align: center;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.pdp-dark .nextArrow, .pdp-dark .prevArrow{
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
position: absolute;
|
|
114
|
+
top:1px;
|
|
115
|
+
padding: 2px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.pdp-dark .nextArrow:hover, .pdp-dark .prevArrow:hover{
|
|
119
|
+
color: #0073ea;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.pdp-dark .cell {
|
|
123
|
+
display: inline-block;
|
|
124
|
+
cursor: default;
|
|
125
|
+
text-align: center;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Days of the week */
|
|
129
|
+
.pdp-dark .dows {
|
|
130
|
+
background: #35516F;
|
|
131
|
+
color: #fff;
|
|
132
|
+
}
|
|
133
|
+
.pdp-dark .dow {
|
|
134
|
+
font: bold 14px 'helvetica';
|
|
135
|
+
border: 1px solid #35516F;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.pdp-dark .days{
|
|
139
|
+
background-color: #444;
|
|
140
|
+
border: 1px solid #777;
|
|
141
|
+
border-top: none;
|
|
142
|
+
font: normal 12px Tahoma;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.pdp-dark .day{
|
|
146
|
+
border: 1px solid #777;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.pdp-dark .day:hover{
|
|
150
|
+
background: #aaa;
|
|
151
|
+
border: 1px solid #f0f0f0;
|
|
152
|
+
}
|
|
153
|
+
.pdp-dark .selday, .pdp-dark .selday:hover{
|
|
154
|
+
background: #eadaa6;
|
|
155
|
+
border-color: #eb5b04;
|
|
156
|
+
color: #222;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.pdp-dark .friday{
|
|
160
|
+
color: #D55372;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.pdp-dark .today{
|
|
164
|
+
color: #fff;
|
|
165
|
+
background: #0073ea;
|
|
166
|
+
}
|
|
167
|
+
.pdp-dark .today:hover{
|
|
168
|
+
color: #fff;
|
|
169
|
+
background: #0073ea;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.pdp-dark .nul{
|
|
173
|
+
border: 1px solid #777;
|
|
174
|
+
background: #777;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.pdp-dark .footer{
|
|
178
|
+
background: #888;
|
|
179
|
+
font: normal 12px Tahoma;
|
|
180
|
+
text-align: center;
|
|
181
|
+
height: 17px;
|
|
182
|
+
}
|
|
183
|
+
.pdp-dark .footer .goToday{
|
|
184
|
+
color: #f0f0f0;
|
|
185
|
+
text-decoration: none;
|
|
186
|
+
}
|
|
187
|
+
.pdp-dark .footer .goToday:hover{
|
|
188
|
+
color: #ffffff;
|
|
189
|
+
text-decoration: overline;
|
|
190
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
|
|
2
|
+
@keyframes start {
|
|
3
|
+
from {
|
|
4
|
+
transform: scale(.5);
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
transform: scale(1);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@-webkit-keyframes start {
|
|
12
|
+
from {
|
|
13
|
+
-webkit-transform: scale(.5);
|
|
14
|
+
}
|
|
15
|
+
to {
|
|
16
|
+
-webkit-transform: scale(1);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.rtl{direction:rtl}
|
|
20
|
+
.pdp-default {
|
|
21
|
+
position: absolute;
|
|
22
|
+
direction: rtl;
|
|
23
|
+
color: #555;
|
|
24
|
+
box-shadow: 1px 1px 8px 1px rgba(0, 0, 0, 0.19);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.pdp-default ::-webkit-scrollbar-track
|
|
28
|
+
{
|
|
29
|
+
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
|
30
|
+
background-color: #F5F5F5;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.pdp-default ::-webkit-scrollbar
|
|
34
|
+
{
|
|
35
|
+
width: 15px;
|
|
36
|
+
background-color: #F5F5F5;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.pdp-default ::-webkit-scrollbar-thumb
|
|
40
|
+
{
|
|
41
|
+
background-color: #444444;
|
|
42
|
+
}
|
|
43
|
+
.pdp-default ::selection{
|
|
44
|
+
color: #67cdcc;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pdp-default .pdp-header{
|
|
48
|
+
background-color: #ffffff;
|
|
49
|
+
border-top: 2px solid #999;
|
|
50
|
+
border-left: 1px solid #999;
|
|
51
|
+
border-right: 1px solid #999;
|
|
52
|
+
border-bottom: none;
|
|
53
|
+
padding: 2px;
|
|
54
|
+
font-weight: bold;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.pdp-default .yearSelect{
|
|
58
|
+
overflow-y: auto;
|
|
59
|
+
direction: ltr;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.pdp-default .monthSelect li.desableMonth, .pdp-default .monthSelect li.desableMonth:hover{
|
|
63
|
+
color: #bbb;
|
|
64
|
+
background: #eee;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.pdp-default .yearSelect, .pdp-default .monthSelect{
|
|
68
|
+
font:normal 12px Tahoma;
|
|
69
|
+
background: #f9f9f9;
|
|
70
|
+
border: 1px solid #ccc;
|
|
71
|
+
list-style: none;
|
|
72
|
+
position: absolute;
|
|
73
|
+
padding: 0;
|
|
74
|
+
width: 99.6%;
|
|
75
|
+
text-align: right;
|
|
76
|
+
z-index: 9999;
|
|
77
|
+
animation: start 0.2s;
|
|
78
|
+
-webkit-animation: start 0.2s;
|
|
79
|
+
}
|
|
80
|
+
.pdp-default .selected{
|
|
81
|
+
background: #15a6eb;
|
|
82
|
+
color: #ffffff;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.pdp-default .yearSelect li, .pdp-default .monthSelect li {
|
|
86
|
+
padding: 1px;
|
|
87
|
+
cursor: default;
|
|
88
|
+
display: inline-table;
|
|
89
|
+
text-align: center;
|
|
90
|
+
border: 1px dotted #ddd;
|
|
91
|
+
}
|
|
92
|
+
.pdp-default .yearSelect li:hover, .pdp-default .monthSelect li:hover {
|
|
93
|
+
background: #FF9933;
|
|
94
|
+
color: #ffffff;
|
|
95
|
+
border-color: #FF7700;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.pdp-default .nextArrow{
|
|
99
|
+
right:0;
|
|
100
|
+
}
|
|
101
|
+
.pdp-default .prevArrow{
|
|
102
|
+
left:0;
|
|
103
|
+
}
|
|
104
|
+
.pdp-default .monthYear{
|
|
105
|
+
width: 80%;
|
|
106
|
+
margin: 0 auto;
|
|
107
|
+
text-align: center;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.pdp-default .nextArrow, .pdp-default .prevArrow{
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
position: absolute;
|
|
114
|
+
top:1px;
|
|
115
|
+
padding: 2px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.pdp-default .nextArrow:hover, .pdp-default .prevArrow:hover{
|
|
119
|
+
color: #0073ea;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.pdp-default .cell {
|
|
123
|
+
display: inline-block;
|
|
124
|
+
cursor: default;
|
|
125
|
+
text-align: center;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Days of the week */
|
|
129
|
+
.pdp-default .dows {
|
|
130
|
+
background: #5F5D5D;/*#006fe0;*/
|
|
131
|
+
color: #fff;
|
|
132
|
+
}
|
|
133
|
+
.pdp-default .dow {
|
|
134
|
+
font: bold 14px 'helvetica';
|
|
135
|
+
border: 1px solid #5F5D5D;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.pdp-default .days{
|
|
139
|
+
background-color: #ffffff;
|
|
140
|
+
border: 1px solid #999;
|
|
141
|
+
border-top: none;
|
|
142
|
+
font: normal 12px Tahoma;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.pdp-default .day{
|
|
146
|
+
border: 1px solid #f1f1f1;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.pdp-default .day:hover{
|
|
150
|
+
background: #f3f3f3;
|
|
151
|
+
border: 1px solid #bbb;
|
|
152
|
+
border-radius: 2px;
|
|
153
|
+
}
|
|
154
|
+
.pdp-default .selday, .pdp-default .selday:hover{
|
|
155
|
+
background: #eadaa6;
|
|
156
|
+
border-color: #eb5b04;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.pdp-default .friday{
|
|
160
|
+
color: #f38;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.pdp-default .today{
|
|
164
|
+
color: #fff;
|
|
165
|
+
background: #0073ea;
|
|
166
|
+
}
|
|
167
|
+
.pdp-default .today:hover{
|
|
168
|
+
color: #fff;
|
|
169
|
+
background: #0073ea;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.pdp-default .nul{
|
|
173
|
+
border: 1px solid #f1f1f1;
|
|
174
|
+
background: #f1f1f1;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.pdp-default .footer{
|
|
178
|
+
background: #999;
|
|
179
|
+
font: normal 12px Tahoma;
|
|
180
|
+
text-align: center;
|
|
181
|
+
height: 17px;
|
|
182
|
+
}
|
|
183
|
+
.pdp-default .footer .goToday{
|
|
184
|
+
color: #f0f0f0;
|
|
185
|
+
text-decoration: none;
|
|
186
|
+
}
|
|
187
|
+
.pdp-default .footer .goToday:hover{
|
|
188
|
+
color: #ffffff;
|
|
189
|
+
text-decoration: overline;
|
|
190
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'behzadi_persian_datepicker/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "behzadi_persian_datepicker"
|
|
8
|
+
spec.version = BehzadiPersianDatepicker::VERSION
|
|
9
|
+
spec.authors = ["Pouya Gharib Pour"]
|
|
10
|
+
spec.email = ["p.gharibpour@gmail.com"]
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{Rails plugin for persianDatepicker JS library.}
|
|
13
|
+
spec.description = %q{Rails plugin for persianDatepicker JS library.}
|
|
14
|
+
spec.homepage = "https://github.com/psparabara/behzadi_persian_datepicker"
|
|
15
|
+
spec.license = "MIT"
|
|
16
|
+
|
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
18
|
+
spec.bindir = "exe"
|
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
20
|
+
spec.require_paths = ["lib"]
|
|
21
|
+
|
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
24
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: behzadi_persian_datepicker
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Pouya Gharib Pour
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-04-04 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.11'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.11'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
description: Rails plugin for persianDatepicker JS library.
|
|
42
|
+
email:
|
|
43
|
+
- p.gharibpour@gmail.com
|
|
44
|
+
executables: []
|
|
45
|
+
extensions: []
|
|
46
|
+
extra_rdoc_files: []
|
|
47
|
+
files:
|
|
48
|
+
- ".gitignore"
|
|
49
|
+
- Gemfile
|
|
50
|
+
- LICENSE.txt
|
|
51
|
+
- README.md
|
|
52
|
+
- Rakefile
|
|
53
|
+
- app/assets/javascripts/persianDatepicker.min.js
|
|
54
|
+
- app/assets/stylesheets/persianDatepicker-dark.css
|
|
55
|
+
- app/assets/stylesheets/persianDatepicker-default.css
|
|
56
|
+
- behzadi_persian_datepicker.gemspec
|
|
57
|
+
- lib/behzadi_persian_datepicker.rb
|
|
58
|
+
- lib/behzadi_persian_datepicker/engine.rb
|
|
59
|
+
- lib/behzadi_persian_datepicker/version.rb
|
|
60
|
+
homepage: https://github.com/psparabara/behzadi_persian_datepicker
|
|
61
|
+
licenses:
|
|
62
|
+
- MIT
|
|
63
|
+
metadata: {}
|
|
64
|
+
post_install_message:
|
|
65
|
+
rdoc_options: []
|
|
66
|
+
require_paths:
|
|
67
|
+
- lib
|
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
|
+
requirements:
|
|
70
|
+
- - ">="
|
|
71
|
+
- !ruby/object:Gem::Version
|
|
72
|
+
version: '0'
|
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
|
+
requirements:
|
|
75
|
+
- - ">="
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: '0'
|
|
78
|
+
requirements: []
|
|
79
|
+
rubyforge_project:
|
|
80
|
+
rubygems_version: 2.5.1
|
|
81
|
+
signing_key:
|
|
82
|
+
specification_version: 4
|
|
83
|
+
summary: Rails plugin for persianDatepicker JS library.
|
|
84
|
+
test_files: []
|