From a5e9253fe0a018a2503013ca96e7728703bf0b56 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 12 Feb 2019 20:26:50 -0500 Subject: [PATCH] BHoliday: Remove, unused. There isn't much use for a class that can only compute the dates of two minor and one major holiday. Probably in the future the Locale Kit could be extended to expose ICU holiday APIs, but seeing as that is a less-used functionality, this can just be removed altogether for now at least. Change-Id: I18be044be7d5c6896295ed85d294abeea90b8bb0 Reviewed-on: https://review.haiku-os.org/c/1037 Reviewed-by: Adrien Destugues --- headers/private/shared/Holiday.h | 85 -------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 headers/private/shared/Holiday.h diff --git a/headers/private/shared/Holiday.h b/headers/private/shared/Holiday.h deleted file mode 100644 index 85a4f9f2cf..0000000000 --- a/headers/private/shared/Holiday.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2010, Haiku, Inc. All Rights Reserved. - * Distributed under the terms of the MIT License. - */ -#ifndef _HOLIDAY_H_ -#define _HOLIDAY_H_ - - -#include - - -namespace BPrivate { - - -class BHoliday { -public: - virtual ~BHoliday() { }; -}; - - -class BEasterHoliday : public BHoliday { -public: - static BDate EasterSunday(int32 year); - static BDate AscensionDay(int32 year); - static BDate PentecostDay(int32 year); -}; - - -/*! - Returns the date for easter sunday for the \c year. -*/ -/*static*/ BDate -BEasterHoliday::EasterSunday(int32 year) -{ - // http://bloggingabout.net/blogs/jschreuder/archive/2005/06/24/7019.aspx - int32 gold = year % 19; - int32 century = year / 100; - int32 h = (century - (int32)(century / 4) - - (int32)((century * 8 + 13) / 25) + 19 * gold + 15) % 30; - int32 i = h - (int32)(h / 28) * (1 - (int32)(h / 28) - * (int32)(29 / (h + 1)) * (int32)((21 - gold) / 11)); - - int32 day = i - ((year + (int32)(year / 4) + i + 2 - century - + (int32)(century / 4)) % 7) + 28; - BDate date; - if (day > 31) - date.SetDate(year, 4, day - 31); - else - date.SetDate(year, 3, day); - return date; -} - - -/*! - Returns the date for ascension day for the \c year. -*/ -/*static*/ BDate -BEasterHoliday::AscensionDay(int32 year) -{ - BDate date = EasterSunday(year); - date.AddDays(39); - return date; -} - - -/*! - Returns the date for pentecost day for the \c year. -*/ -/*static*/ BDate -BEasterHoliday::PentecostDay(int32 year) -{ - BDate date = EasterSunday(year); - date.AddDays(49); - return date; -} - - -} // namespace BPrivate - - -using BPrivate::BHoliday; -using BPrivate::BEasterHoliday; - - -#endif // _HOLIDAY_H_