Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57358 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41419 invoked from network); 13 Jan 2012 16:41:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jan 2012 16:41:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=shminoach@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=shminoach@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: shminoach@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:39942] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/35-14190-7BE501F4 for ; Fri, 13 Jan 2012 11:41:29 -0500 Received: by yenq1 with SMTP id q1so352635yen.29 for ; Fri, 13 Jan 2012 08:41:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=TjaBpxgwaEagZz2ahFvGaprSgjntLQbfdzn1T0I0ARc=; b=oVwl4IpHxMvYAgF1y1dg37uoNIlhTzn5iwf0jm57WN4RTJpBv4XME/dkYHB7ucJuZw RoDgEc9vRF3zM7ZFP9SeRRd7r4ip1NCU1x/Zd1EE8/RqdLX9rBHKnThGESbIMOkCP20o 3VF1z9H2u4W+LzXWOlFDH8R9lyY1gXBNdPdkI= Received: by 10.236.136.200 with SMTP id w48mr2708937yhi.22.1326472885156; Fri, 13 Jan 2012 08:41:25 -0800 (PST) MIME-Version: 1.0 Sender: shminoach@gmail.com Received: by 10.147.39.11 with HTTP; Fri, 13 Jan 2012 08:41:04 -0800 (PST) Date: Fri, 13 Jan 2012 11:41:04 -0500 X-Google-Sender-Auth: _tOGPt6vgM7SehVk0agr5cTRnzM Message-ID: To: internals@lists.php.net Content-Type: multipart/mixed; boundary=20cf303b3fed1fbcf504b66b89e4 Subject: [PATCH] Fix cal_from_jd() for Jewish calendar From: eitan@mosenkis.net (Eitan Mosenkis) --20cf303b3fed1fbcf504b66b89e4 Content-Type: text/plain; charset=UTF-8 This didn't seem to get much notice the first time I sent it, so as per the suggestion at (http://php.net/svn-php.php), I'm resending it. It would be great if someone could commit it to the source tree so this bug can be closed. Please let me know if I need to do something differently or if you have questions or objections. This is a patch to fix the main issue in bug #54254 (the other issue mentioned would require some structural changes in how calendars are handled and is more of a feature request), cal_from_jd(CAL_JEWISH) returns month=6 for Adar when there is only one Adar, (it should return 7, since if there is only one Adar it's AdarII). This will clear up an issue where cal_from_jd() returns a month that cal_days_in_month() reports to have 0 days due to an inconsistency in how dates are converted to and from the Jewish calendar. This patch should create the correct behavior. Thanks, Eitan https://bugs.php.net/bug.php?id=54254 --20cf303b3fed1fbcf504b66b89e4 Content-Type: text/x-patch; charset=windows-1255; name="jewish_calendar_bug_54254.patch" Content-Disposition: attachment; filename="jewish_calendar_bug_54254.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gxdfk7090 SW5kZXg6IGV4dC9jYWxlbmRhci90ZXN0cy9qZHRvamV3aXNoLnBocHQKPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g ZXh0L2NhbGVuZGFyL3Rlc3RzL2pkdG9qZXdpc2gucGhwdAkocmV2aXNpb24gMzIyMDMwKQorKysg ZXh0L2NhbGVuZGFyL3Rlc3RzL2pkdG9qZXdpc2gucGhwdAkod29ya2luZyBjb3B5KQpAQCAtMTQs MTAgKzE0LDExIEBACiAJamR0b2pld2lzaChncmVnb3JpYW50b2pkKDEwLDgsMjAwMiksdHJ1ZSwg Q0FMX0pFV0lTSF9BRERfR0VSRVNIQVlJTSkuIlxyXG4iL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