রস-আলো

জানুয়ারি
ফেব্রুয়ারি
মার্চ
এপ্রিল
মে
জুন
জুলাই
আগস্ট
সেপ্টেম্বর
অক্টোবর
নভেম্বর
ডিসেম্বর
২০০৭
২০০৮
২০০৯
২০১০
২০১১
২০১২
২০১৩
২০১৪
২০১৫
২০১৬
শুক্র
শনি
রোব
সোম
মঙ্গল
বুধ
বৃহ

 

// <![CDATA[
var jUrlPrefix = '/home/date/';
var currentDate = '2011-12-19';
var lastPublished = '2011-12-19';

var dayOffset = 3;
var mDays = new Array(13);
mDays[1] = 31;
mDays[2] = 29;
mDays[3] = 31;
mDays[4] = 30;
mDays[5] = 31;
mDays[6] = 30;
mDays[7] = 31;
mDays[8] = 31;
mDays[9] = 30;
mDays[10] = 31;
mDays[11] = 30;
mDays[12] = 31;

var bDays = new Array(11);
bDays[0] = '০';
bDays[1] = '১';
bDays[2] = '২';
bDays[3] = '৩';
bDays[4] = '৪';
bDays[5] = '৫';
bDays[6] = '৬';
bDays[7] = '৭';
bDays[8] = '৮';
bDays[9] = '৯';

function banglaNumber(v){
return bDays[v[0]] + bDays[v[1]];
}

function jFillDay(month_length,startDay,y,m){
var day = 1
var tBox = 42;
var html = "";
var curDate = new Date(currentDate);
var lDate = new Date(lastPublished);
var d = y+"-"+( m < 10 ? '0' : '' )+m+"-";
// pad boxs
for (var i=1;i<startDay;i++){
html += '

 

‘;
tBox–;
}

// fill days
tmp2 = new Date(d + “01”);

while( day <= month_length && ( tmp2.getFullYear() == lDate.getFullYear() && tmp2.getMonth() <= lDate.getMonth() || tmp2.getFullYear() < lDate.getFullYear() ) ){
t = ( day < 10 ? '0' : '' ) + day;
tmp = d + t;

tmp2 = new Date(tmp);

if( tmp2.getFullYear() == lDate.getFullYear() && tmp2.getMonth() == lDate.getMonth() && lDate.getDate() < tmp2.getDate() ) break;

classs = '';
if( tmp2.getFullYear() == curDate.getFullYear() && tmp2.getMonth() == curDate.getMonth() && curDate.getDate() == tmp2.getDate() ) classs = "active";

html += '

‘ + banglaNumber(t) + ‘

‘;
day++
tBox–;
}

// fill disabled days
while(day <= month_length) {
t = ( day < 10 ? '0' : '' ) + day;
html += '

‘+banglaNumber(t)+’

‘;
day++
tBox–;
}

//remaining box
while(tBox){
html += ‘

 

‘;
tBox–;
}
return html;
}

function calenderRender(o){
var month;
var year;

if( o == ‘init’ ){
var d = new Date(currentDate);
month = d.getMonth();
year = d.getFullYear();

$(‘.monthSelector’).val(month+1);
$(‘.yearSelector’).val(year);
}

month = $(‘.monthSelector’).val();
year = $(‘.yearSelector’).val();

tmpD = new Date(year,month-1,1);
var startDay = tmpD.getDay()+dayOffset;

var tDays = mDays[month];

if( year % 4 && month == 2 ){
tDays = 28;
}

if( startDay > 7 ){
startDay = startDay % 7;
}

$(‘.dayHolder’).html(jFillDay(tDays,startDay,year,month));

}
calenderRender(‘init’);

//cAjaxRequest({url:’/ajax/calender/true/date/2011-12-19′,data:’date=1324252801&curPage=/detail/news/209728′,method:’post’,onSuccess:function(msg,s){ $(‘#jCalender’).html(msg);} });
// ]]>

মন্তব্য করুন

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / পরিবর্তন )

Twitter picture

You are commenting using your Twitter account. Log Out / পরিবর্তন )

Facebook photo

You are commenting using your Facebook account. Log Out / পরিবর্তন )

Google+ photo

You are commenting using your Google+ account. Log Out / পরিবর্তন )

Connecting to %s

%d bloggers like this: