azuyalabs / yasumi

The easy PHP Library for calculating holidays
https://www.yasumi.dev
Other
1.04k stars 152 forks source link

A Naming Convention Issue on Australian States #210

Closed hugowebtools closed 4 years ago

hugowebtools commented 4 years ago

I was trying to create two objects for Victoria and New South Wales in Australia and I realised the the holiday providers for these two states were using different naming conventions.

$provider = Yasumi::create('Australia/NSW', 2020);
$provider = Yasumi::create('Australia/Victoria', 2020);

If we check the list of providers, we can easily see there are 5 states in Australia using their abbreviations as the class name against the others. Screen Shot 2020-03-12 at 16 04 08 I don't think it is correct. Based on the naming conventions used for states in Germany, maybe we can simply align Australia states to reduce confusion.

   NSW  =>  NewSouthWales
   ACT  =>  AustralianCapitalTerritory
   WA => WesternAustralia
   SA => SouthAustralia
   NT => NorthernTerritory
Milamber33 commented 4 years ago

As the guy who actually built all of the Australian providers, my apologies. :) Personally, I'm using Yasumi::createByISO3166_2 rather than just Yasumi::create, so if someone feels like changing this I am not opposed.

hugowebtools commented 4 years ago

Ah, it is. I can see Yasumi::createByISO3166_2 a cool feature and it is very useful. I must miss it in the documentation. Thank you.

stelgenhof commented 4 years ago

To have consistency, renaming them would be good indeed. I can make that change if you like, other otherwise feel free to submit a PR :)

Cheers! Sacha