Comments (4)
Hello,
As of now, alternative calendars (Hijri/Jewish/Lunar) are not compatible with conditional syntax.
I started a fix, you can try it by requiring:
"require": {
...
"cmixin/business-day": "dev-fix/issue-84-support-alt-calendar-with-conditions as 1.14.0"
}
As it involves one more RegExp parsing, it might cost some performance so I still have to find a more optimized way.
from business-day.
Wow that was quick! Just did some test with it and working good so far. Nice work!
Then went on to test another holiday - Hari Raya Haji(aka Eid al-Adha) which falls on the 10th day of the 12th month in the Islamic calendar.
return [
'hari-raya-haji' => '= 10 dhu al-hijjah if sunday then next monday',
]
I tried from year 2000-2021, the following years gave me error in test cases.
2004-02-01
, 2007-12-27
, 2008-12-08
, 2009-11-27
, 2011-11-06
, 2016-09-12
, 2019-08-11
I am referencing this source for the particular holiday I am testing Singapore Public Holidays
and this for the hijri/gregorian calendar Islamic/Gregorian Calendar
Any idea why this happens?
from business-day.
Can you please add '= 10 dhu al-hijjah'
in your config and check: Carbon::getYearHolidays()
for each year and for each day what day of week it is, so I can see if either 10 dhu al-hijjah
(based on Hijri calendar) is the mismatch or if the if-then rule fails. Thanks 🙏
from business-day.
Hari Raya Haji: 16/03/2000 Thursday
Hari Raya Haji: 06/03/2001 Tuesday
Hari Raya Haji: 23/02/2002 Saturday
Hari Raya Haji: 12/02/2003 Wednesday
Hari Raya Haji: 02/02/2004 Monday // this should be observed, actual is 01/02/2004 Sunday
Hari Raya Haji: 21/01/2005 Friday
Hari Raya Haji: 10/01/2006 Tuesday
Unknown: 31/12/2006 Sunday // No idea about this, the id is hari-raya-haji-oc-2
Hari Raya Haji: 20/12/2007 Thursday // actual should be is 27/12/2007 Thursday
Hari Raya Haji: 09/12/2008 Tuesday // actual should be is 08/12/2008 Monday
Hari Raya Haji: 28/11/2009 Saturday // actual should be is 27/11/2008 Friday
Hari Raya Haji: 17/11/2010 Wednesday
Hari Raya Haji: 07/11/2011 Monday // this should be observed, actual is 06/11/2011 Thursday
Hari Raya Haji: 26/10/2012 Friday
Hari Raya Haji: 15/10/2013 Tuesday
Hari Raya Haji: 05/10/2014 Sunday
Hari Raya Haji (observed): 06/10/2014 Monday
Hari Raya Haji: 24/09/2015 Thursday
Hari Raya Haji: 13/09/2016 Tuesday // actual should be is 12/09/2016 Monday
Hari Raya Haji: 02/09/2017 Saturday
Hari Raya Haji: 22/08/2018 Wednesday
Hari Raya Haji: 12/08/2019 Monday // this should be observed, actual is 11/08/2019 Thursday
Hari Raya Haji: 31/07/2020 Friday
Hari Raya Haji: 20/07/2021 Tuesday
The above data(2000 - 2021) is based on the following config:
return [
'hari-raya-haji' => '= 10 dhu al-hijjah',
'hari-raya-haji-observed' => '= 10 dhu al-hijjah if sunday then next monday',
];
Year 2014 works correctly with both holiday and observed holiday.
from business-day.
Related Issues (20)
- Problem with polish holidays HOT 1
- Unknown holiday name in pl HOT 2
- if Sunday then next Tuesday does not work as expected HOT 1
- Bug in italian calculation HOT 1
- Programatically get a list of available regions HOT 1
- Relative logic not working on January 1st HOT 4
- Add Juneteenth to US national holidays HOT 3
- Getting a list of holidays in parsable carbon format HOT 1
- The demo is broken HOT 1
- Possible to add alternative holiday name of the same id? HOT 1
- Request for update: south africa (ZA) holidays
- Undefined method parse HOT 4
- How can I make a day of the week a non-business day? HOT 1
- Business days are not accurate for some countries HOT 1
- Incorrect public holiday for South Africa HOT 1
- Find out if it's a public holiday but still open
- Prayer day is no longer a holiday in Denmark HOT 1
- Carbon 3: Method diffInBusinessdays does not exist HOT 2
- No Indonesian Holidays? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from business-day.