[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: calendar/inc class.holidaycalc_JP.inc.php,1.1.2.
From: |
Yoshihiro Kamimura <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: calendar/inc class.holidaycalc_JP.inc.php,1.1.2.3,1.1.2.4 |
Date: |
Fri, 13 Sep 2002 03:55:14 -0400 |
Update of /cvsroot/phpgroupware/calendar/inc
In directory subversions:/tmp/cvs-serv4252/inc
Modified Files:
Tag: Version-0_9_14-branch
class.holidaycalc_JP.inc.php
Log Message:
The correspondence of Bug #1195.
Index: class.holidaycalc_JP.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.holidaycalc_JP.inc.php,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** class.holidaycalc_JP.inc.php 24 Aug 2002 10:08:11 -0000 1.1.2.3
--- class.holidaycalc_JP.inc.php 13 Sep 2002 07:55:12 -0000 1.1.2.4
***************
*** 18,40 ****
function calculate_date($holiday, &$holidays, $year, &$i)
{
! if($holiday['day'] == 0 && $holiday['dow'] != 0 &&
$holiday['occurence'] != 0)
{
! // for Coming of Age Day and Health and Sports Day
// Happy monday law.
! if ($year >= 2000)
{
! $dow =
$GLOBALS['phpgw']->datetime->day_of_week($year, $holiday['month'], 1);
! $dayshift = (($holiday['dow'] + 7) - $dow) % 7;
! $day = ($holiday['occurence'] - 1) * 7 +
$dayshift + 1;
}
! else
{
! // non Happy monday law.
! if ($holiday['month'] == 1)
{
$day = 15;
}
! elseif ($holiday['month'] == 10)
{
$day = 10;
--- 18,56 ----
function calculate_date($holiday, &$holidays, $year, &$i)
{
+ static $cached_month;
+ static $cached_day;
+ static $cached_observance_rule;
! if ($holiday['day'] == 0 && $holiday['dow'] != 0 &&
$holiday['occurence'] != 0)
{
! $dow = $GLOBALS['phpgw']->datetime->day_of_week($year,
$holiday['month'], 1);
! $dayshift = (($holiday['dow'] + 7) - $dow) % 7;
! $day = ($holiday['occurence'] - 1) * 7 + $dayshift + 1;
!
// Happy monday law.
! if ($holiday['month'] == 1)
{
! if ($year < 2000)
! {
! $day = 15;
! }
}
! elseif ($holiday['month'] == 7)
{
! if ($year < 2003)
! {
! $day = 20;
! }
! }
! elseif ($holiday['month'] == 9)
! {
! if ($year < 2003)
{
$day = 15;
}
! }
! elseif ($holiday['month'] == 10)
! {
! if ($year < 2000)
{
$day = 10;
***************
*** 80,84 ****
}
! if($holiday['observance_rule'] == True)
{
$dow =
$GLOBALS['phpgw']->datetime->day_of_week($year,$holiday['month'],$day);
--- 96,125 ----
}
! if ($year >= 1985 && $holiday['month'] == $cached_month && $day
== $cached_day + 2 && $cached_observance_rule == True &&
$holiday['observance_rule'] == True)
! {
! $pdow =
$GLOBALS['phpgw']->datetime->day_of_week($year,$holiday['month'],$day-1);
! if ($pdow != 0)
! {
! $addcnt = count($holidays) + 1;
! $holidays[$addcnt]['locale'] =
$holiday['locale'];
! $holidays[$addcnt]['name'] = lang('people
holiday');
! $holidays[$addcnt]['day'] = $day - 1;
! $holidays[$addcnt]['month'] = $holiday['month'];
! $holidays[$addcnt]['occurence'] = 0;
! $holidays[$addcnt]['dow'] = 0;
! $holidays[$addcnt]['date'] =
mktime(0,0,0,$holiday['month'],$day-1,$year);
! $holidays[$addcnt]['observance_rule'] = 0;
! }
! }
!
! $cached_month = $holiday['month'];
! $cached_day = $day;
! $cached_observance_rule = $holiday['observance_rule'];
!
! if ($year >= 1985 && $holiday['month'] == 5 && $day == 3)
! {
! ;
! }
! elseif ($holiday['observance_rule'] == True)
{
$dow =
$GLOBALS['phpgw']->datetime->day_of_week($year,$holiday['month'],$day);
***************
*** 89,98 ****
$holidays[$addcnt]['locale'] =
$holiday['locale'];
$holidays[$addcnt]['name'] = lang('overlap
holiday');
! $holidays[$addcnt]['day'] = $holiday['day'] + 1;
$holidays[$addcnt]['month'] = $holiday['month'];
$holidays[$addcnt]['occurence'] =
$holiday['occurence'];
$holidays[$addcnt]['dow'] = $holiday['dow'];
$holidays[$addcnt]['date'] =
mktime(0,0,0,$holiday['month'],$day+1,$year);
! $holidays[$addcnt]['obervance_rule'] = 0;
}
}
--- 130,139 ----
$holidays[$addcnt]['locale'] =
$holiday['locale'];
$holidays[$addcnt]['name'] = lang('overlap
holiday');
! $holidays[$addcnt]['day'] = $day + 1;
$holidays[$addcnt]['month'] = $holiday['month'];
$holidays[$addcnt]['occurence'] =
$holiday['occurence'];
$holidays[$addcnt]['dow'] = $holiday['dow'];
$holidays[$addcnt]['date'] =
mktime(0,0,0,$holiday['month'],$day+1,$year);
! $holidays[$addcnt]['observance_rule'] = 0;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: calendar/inc class.holidaycalc_JP.inc.php,1.1.2.3,1.1.2.4,
Yoshihiro Kamimura <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: calendar/setup holidays.JP,1.2,1.2.2.1 phpgw_ja.lang,1.4.2.1,1.4.2.2
- Next by Date:
[Phpgroupware-cvs] CVS: calendar/inc class.holidaycalc_JP.inc.php,1.1.2.4,1.1.2.5
- Previous by thread:
[Phpgroupware-cvs] CVS: calendar/setup holidays.JP,1.2,1.2.2.1 phpgw_ja.lang,1.4.2.1,1.4.2.2
- Next by thread:
[Phpgroupware-cvs] CVS: calendar/inc class.holidaycalc_JP.inc.php,1.1.2.4,1.1.2.5
- Index(es):