-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Similar Project #14
Comments
Hi @tinohager - yes, what's the project? |
Hi Martin This is my project https://github.com/tinohager/Nager.Date Our two libraries have the first two places in the nuget charts for public holidays... I have collected the public holidays for over 50 countries |
Impressive number of countries! I like the idea of a demo website too. Nager.Date has some issues with the weekend-shifting, which is mostly done by Anglophone countries.
Your library shows 4 July always, while this library shows the weekday holiday. Both are strictly correct... (You do the adjustment for Veteran's Day, but not others). There are some interesting differences in approach- you pass in a country-code enum and have private country providers, which I instantiate specific public country providers (new FrancePublicHoliday()). How would you like to collaborate? I guess we could merge the two by replacing Nader.Date country providers with PublicHoliday country instances? |
My consideration is to continue just one project. We can also start a completely new one but then we lose the previous spread. I think we would have to modify the providers of "Nager.Date" only a little bit to incorporate your logic. You have a very good documentation and good tests. What could you imagine for a co-operation? |
Here are some things the differences between PublicHoliday and Nager.Date.
I quickly tried to put the two projects together, simply by making ND dependent on PH. it works, but there's a nasty naming collision ("PublicHoliday"). Here's USA: namespace Nager.Date.PublicHolidays
{
using PublicHoliday = Model.PublicHoliday;
public class UnitedStatesProvider : IPublicHolidayProvider
{
public IEnumerable<PublicHoliday> Get(int year)
{
var usa = new global::PublicHoliday.USAPublicHoliday();
var hols = usa.PublicHolidayNames(year);
var items = new List<PublicHoliday>();
var countryCode = CountryCode.US;
foreach (var hol in hols)
{
var dt = hol.Key;
var name = hol.Value;
items.Add(new PublicHoliday(year, dt.Month, dt.Day, name, name, countryCode));
}
return items.OrderBy(o => o.Date);
} Based on this, I think the first thing to do is to refactor the projects rather than immediately put them into one project. Specifically, come up with common contracts - your PublicHoliday class v2. Sounds good? |
Hi
I've also thought about it to add a type enum to the holidays (bankholiday, school, ...) but is not easy to set the type |
Hi @tinohager @martinjw - I am looking at both of these libraries for something we may be working on in the next couple of weeks. I see that both have had recent updates - did you all come to an agreement on merging this work into one project? We are still deciding whether to build our own implementation and store these dates in a database so our customers could modify or use a library like one of these. |
First stage is to make the libraries compatible. This library will have a refactor (v2) so it's contracts are compatible with Nager.Date, and it can function as a lower level library. I haven't had the time to do this, but I will get back to it eventually. |
I have compared the two projects country support again, in the current state, PH have two countries supported there are not available in ND (Kazakhstan and Japan). I think the the great idea is not merge Code, but rather the more people work on one project. It is very much work to create a new country and write tests, every year check whether something has changed... @jcron if you start again a new project all of the hard work, is lost again... you are welcome to work on a existing project My goal is a blue world https://date.nager.at/ |
Hi Martin, What does the idea actually look like? I have in the meantime moved my project to an organization you would like to join here? |
Hi Martin
We have a similar project you are interested on a collaboration?
Best regards
Tino
The text was updated successfully, but these errors were encountered: