|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-11-20 09:55 UTC] php at kriegt dot es
Description: ------------ Hi, I expected some problem with Locale ar_SA (since this was one of the examples on http://www.php.net/manual/fr/intlcalendar.isweekend.php). I wanted to check since sunday is not a weekend day for Saudi Arabia, which day is. So I started with monday and finished with saturday, everytime I got false. So actually, I checked on google what days are weekends for Saudi Arabia and I found the following: http://en.wikipedia.org/wiki/Workweek_and_weekend#Friday.E2.80.93Saturday_weekend There you can see, that Saudi Arabia should return true on "friday" and "saturday". Test script: --------------- <?php $cal = IntlCalendar::createInstance('Asia/Riyadh', 'ar_SA'); $cal->set(2013,11,22); // friday var_dump( $cal->isWeekend() ); $cal->set(2013,11,23); // saturday var_dump( $cal->isWeekend() ); $cal->set(2013,11,24); // sunday var_dump( $cal->isWeekend() ); Expected result: ---------------- bool(true) bool(true) bool(false) Actual result: -------------- bool(false) bool(false) bool(false) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 10:00:02 2025 UTC |
Hi, i've repeated your snipped today as follows (the fun thing is that the day of month is the same :)) <?php $cal = IntlCalendar::createInstance('Asia/Riyadh', 'ar_SA'); $cal->set(2016,4,22); // friday var_dump( $cal->isWeekend() ); $cal->set(2016,4,23); // saturday var_dump( $cal->isWeekend() ); $cal->set(2016,4,24); // sunday var_dump( $cal->isWeekend() ); The output is as follows: bool(false) bool(true) bool(true) This is produced with ICU 57.1. It still doesn't look correct as it shows not the correct days for the weekend. But, for sure is - it is something coming from ICU. PHP doesn't interpret these data, it just wraps the corresponding ICU functionality and a boolean in this case. Certanly, it needs to be reported mainstream and you should do that, i currently don't see this as an issue in PHP. Thanks.