My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 1530: create regional date for FullCalendar jquery
1 person starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Merged:  issue 47
Owner:  ----
Closed:  Aug 2013


Sign in to add a comment
 
Reported by mk136...@gmail.com, Sep 7, 2012
how i can create regional date for FullCalendar jquery like this code:
(it's use datepicker in jquery)

jQuery(function(a){a.datepicker.regional.fa={calendar:JalaliDate,closeText:"بستن",prevText:"قبل",nextText:"بعد",currentText:"امروز",monthNames:["فروردين","ارديبهشت","خرداد","تير","مرداد","شهريور","مهر","آبان","آذر","دي","بهمن","اسفند"],monthNamesShort:["فروردين","ارديبهشت","خرداد","تير","مرداد","شهريور","مهر","آبان","آذر","دي","بهمن","اسفند"],dayNames:["يکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],dayNamesShort:["يک","دو","سه","چهار","پنج","جمعه","شنبه"],dayNamesMin:["ي","د","س","چ","پ","ج","ش"],weekHeader:"ه",dateFormat:"dd/mm/yy",firstDay:6,isRTL:true,showMonthAfterYear:false,yearSuffix:"",calculateWeek:function(b){var c=new JalaliDate(b.getFullYear(),b.getMonth(),b.getDate()+(b.getDay()||7)-3);return Math.floor(Math.round((c.getTime()-new JalaliDate(c.getFullYear(),0,1).getTime())/86400000)/7)+1}};a.datepicker.setDefaults(a.datepicker.regional.fa)});function JalaliDate(i,h,f){var d;var a;if(!isNaN(parseInt(i))&&!isNaN(parseInt(h))&&!isNaN(parseInt(f))){var c=j([parseInt(i,10),parseInt(h,10),parseInt(f,10)]);e(new Date(c[0],c[1],c[2]))}else{e(i)}function j(l){var k=0;if(l[1]<0){k=leap_persian(l[0]-1)?30:29;l[1]++}var g=jd_to_gregorian(persian_to_jd(l[0],l[1]+1,l[2])-k);g[1]--;return g}function b(k){var g=jd_to_persian(gregorian_to_jd(k[0],k[1]+1,k[2]));g[1]--;return g}function e(g){if(g&&g.getGregorianDate){g=g.getGregorianDate()}d=new Date(g);d.setHours(d.getHours()>12?d.getHours()+2:0);if(!d||d=="Invalid Date"||isNaN(d||!d.getDate())){d=new Date()}a=b([d.getFullYear(),d.getMonth(),d.getDate()]);return this}this.getGregorianDate=function(){return d};this.setFullDate=e;this.setMonth=function(l){a[1]=l;var k=j(a);d=new Date(k[0],k[1],k[2]);a=b([k[0],k[1],k[2]])};this.setDate=function(l){a[2]=l;var k=j(a);d=new Date(k[0],k[1],k[2]);a=b([k[0],k[1],k[2]])};this.getFullYear=function(){return a[0]};this.getMonth=function(){return a[1]};this.getDate=function(){return a[2]};this.toString=function(){return a.join(",").toString()};this.getDay=function(){return d.getDay()};this.getHours=function(){return d.getHours()};this.getMinutes=function(){return d.getMinutes()};this.getSeconds=function(){return d.getSeconds()};this.getTime=function(){return d.getTime()};this.getTimeZoneOffset=function(){return d.getTimeZoneOffset()};this.getYear=function(){return a[0]%100};this.setHours=function(g){d.setHours(g)};this.setMinutes=function(g){d.setMinutes(g)};this.setSeconds=function(g){d.setSeconds(g)};this.setMilliseconds=function(g){d.setMilliseconds(g)}};

Aug 18, 2013
Project Member #1 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 47
Sign in to add a comment

Powered by Google Project Hosting