mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-24 14:58:43 +01:00
Calendar now has a little support for Arabic calendars.
This commit is contained in:
parent
ec58a63c0f
commit
325831f748
@ -220,8 +220,9 @@ class calendar extends calendar_
|
|||||||
global $phpgw_info;
|
global $phpgw_info;
|
||||||
|
|
||||||
$weekday = $this->day_of_week($year,$month,$day);
|
$weekday = $this->day_of_week($year,$month,$day);
|
||||||
if ($phpgw_info['user']['preferences']['calendar']['weekdaystarts'] == 'Monday')
|
switch($phpgw_info['user']['preferences']['calendar']['weekdaystarts'])
|
||||||
{
|
{
|
||||||
|
case 'Monday':
|
||||||
$days = Array(
|
$days = Array(
|
||||||
0 => 'Mon',
|
0 => 'Mon',
|
||||||
1 => 'Tue',
|
1 => 'Tue',
|
||||||
@ -243,9 +244,8 @@ class calendar extends calendar_
|
|||||||
$sday = mktime(2,0,0,$month,$day - ($weekday - 1),$year);
|
$sday = mktime(2,0,0,$month,$day - ($weekday - 1),$year);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
else
|
case 'Sunday':
|
||||||
{
|
|
||||||
$days = Array(
|
$days = Array(
|
||||||
0 => 'Sun',
|
0 => 'Sun',
|
||||||
1 => 'Mon',
|
1 => 'Mon',
|
||||||
@ -256,6 +256,31 @@ class calendar extends calendar_
|
|||||||
6 => 'Sat'
|
6 => 'Sat'
|
||||||
);
|
);
|
||||||
$sday = mktime(2,0,0,$month,$day - $weekday,$year);
|
$sday = mktime(2,0,0,$month,$day - $weekday,$year);
|
||||||
|
break;
|
||||||
|
// The following is for Arabic support.....
|
||||||
|
case 'Saturday':
|
||||||
|
$days = Array(
|
||||||
|
0 => 'Sat',
|
||||||
|
1 => 'Sun',
|
||||||
|
2 => 'Mon',
|
||||||
|
3 => 'Tue',
|
||||||
|
4 => 'Wed',
|
||||||
|
5 => 'Thu',
|
||||||
|
6 => 'Fri'
|
||||||
|
);
|
||||||
|
switch($weekday)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
$sday = mktime(2,0,0,$month,$day - 1,$year);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
$sday = mktime(2,0,0,$month,$day,$year);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$sday = mktime(2,0,0,$month,$day - ($weekday + 1),$year);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->days = $days;
|
$this->days = $days;
|
||||||
|
@ -120,6 +120,8 @@
|
|||||||
$str = '<select name="weekdaystarts">'
|
$str = '<select name="weekdaystarts">'
|
||||||
. '<option value="Monday"'.$t_weekday['Monday'].'>'.lang('Monday').'</option>'
|
. '<option value="Monday"'.$t_weekday['Monday'].'>'.lang('Monday').'</option>'
|
||||||
. '<option value="Sunday"'.$t_weekday['Sunday'].'>'.lang('Sunday').'</option>'
|
. '<option value="Sunday"'.$t_weekday['Sunday'].'>'.lang('Sunday').'</option>'
|
||||||
|
// The following is for Arabic support.....
|
||||||
|
. '<option value="Saturday"'.$t_weekday['Saturday'].'>'.lang('Saturday').'</option>'
|
||||||
. '</select>';
|
. '</select>';
|
||||||
display_item(lang('weekday starts on'),$str);
|
display_item(lang('weekday starts on'),$str);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user