note 79302 added to ref.calendar

From: Date: Tue, 20 Nov 2007 08:20:07 +0000
Subject: note 79302 added to ref.calendar
Groups: php.notes 
Request: Send a blank email to php-notes+get-132424@lists.php.net to get a copy of this message
<?php // You need to replace this section in Function EgyptianCalendar // As well as Function MayanTihkalCalendar $revolutionsperyear = $ttl_num / $i; $numyears = floor((ceil($roun) / $revolutionsperyear)); $avg_num_month = $ttl_num_months/$i; $jtl = abs(abs($roun) - ceil($revolutionsperyear*($numyears+1))); while($month==0){ $day=0; $u=0; foreach($monthusage as $key => $item){ $t=0; foreach($item as $numdays){ $t++; $tt=0; for($sh=1;$sh<=$numdays;$sh++){ $ii=$ii+1; $tt++; if ($ii==floor($jtl)){ if ($roun<0){ $daynum = $tt; $month = $t; } else { $daynum = $numdays-($tt-1); $month = $avg_num_month-($t-1); } $sequence = $key; $nodaycount=true; } } if ($nodaycount==false) $day++; } $u++; } } ?> This section of code need to be changed in the calculation I noticed today in our RounCalendar we had a zero day this function will calculate the month and day correctly for the calendars, it is a pretty universe piece of code, I am sorry it wasn't properly tested and need some refactoring. ---- Server IP: 203.202.10.60 Probable Submitter: 125.253.8.126 ---- Manual Page -- http://www.php.net/manual/en/ref.calendar.php Edit -- https://master.php.net/note/edit/79302 Del: integrated -- https://master.php.net/note/delete/79302/integrated Del: useless -- https://master.php.net/note/delete/79302/useless Del: bad code -- https://master.php.net/note/delete/79302/bad+code Del: spam -- https://master.php.net/note/delete/79302/spam Del: non-english -- https://master.php.net/note/delete/79302/non-english Del: in docs -- https://master.php.net/note/delete/79302/in+docs Del: other reasons-- https://master.php.net/note/delete/79302 Reject -- https://master.php.net/note/reject/79302 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#132424) next »