CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
gregorian_calendar_utils.h
1
2#pragma once
3
4#include <memory>
5#include <defines.h>
6#include <system/date_time.h>
7#include <system/details/icu_namespace.h>
8
10ASPOSECPP_3RD_PARTY_ICU_NAMESPACE_START {
12 ASPOSECPP_3RD_PARTY_CLASS(Calendar);
13}
14
15namespace System { namespace Globalization { namespace Details {
16
19{
20public:
22 static constexpr int MinYear = 1;
24 static constexpr int MaxYear = 9999;
25
29 static int GetDaysInYear(int year);
30
35 static int GetDaysInMonth(int year, int month);
36
40 static bool IsLeapYear(int year);
41
47 static bool IsLeapDay(int year, int month, int day);
48
51 static std::unique_ptr<codeporting_icu::Calendar> CreateCalendar();
52
55 static codeporting_icu::Calendar& GetCalendar();
56
58 static double ConvertDateTimeToUDate(DateTime time);
59
61 static DateTime ConvertUDateToDateTime(const double time);
62};
63
64}}} // namespace System::Globalization::Details
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
Gregorian calendar utility functions.
Definition: gregorian_calendar_utils.h:19
static codeporting_icu::Calendar & GetCalendar()
Gets thread-local gregorian ICU calendar.
static int GetDaysInMonth(int year, int month)
Gets number of days in specific month.
static DateTime ConvertUDateToDateTime(const double time)
Convert ICU UDate to DateTime.
static bool IsLeapDay(int year, int month, int day)
Checks if the day is leap.
static int GetDaysInYear(int year)
Gets number of days in specific year.
static std::unique_ptr< codeporting_icu::Calendar > CreateCalendar()
Create gregorian ICU calendar.
static bool IsLeapYear(int year)
Checks if the year is leap.
static double ConvertDateTimeToUDate(DateTime time)
Convert DateTime to ICU UDate.
static constexpr int MinYear
Min supported Gregorian year.
Definition: gregorian_calendar_utils.h:22
static constexpr int MaxYear
Max supported Gregorian year.
Definition: gregorian_calendar_utils.h:24
Definition: db_command.h:9