Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetLunarMonthDay()

static int System.Globalization.HebrewCalendar.GetLunarMonthDay ( int gregorianYear,
DateBuffer lunarDate )
inlinestaticpackage

Definition at line 255 of file HebrewCalendar.cs.

256 {
257 int num = gregorianYear - 1583;
258 if (num < 0 || num > 656)
259 {
260 throw new ArgumentOutOfRangeException("gregorianYear");
261 }
262 num *= 2;
263 lunarDate.day = HebrewTable[num];
264 int result = HebrewTable[num + 1];
265 switch (lunarDate.day)
266 {
267 case 0:
268 lunarDate.month = 5;
269 lunarDate.day = 1;
270 break;
271 case 30:
272 lunarDate.month = 3;
273 break;
274 case 31:
275 lunarDate.month = 5;
276 lunarDate.day = 2;
277 break;
278 case 32:
279 lunarDate.month = 5;
280 lunarDate.day = 3;
281 break;
282 case 33:
283 lunarDate.month = 3;
284 lunarDate.day = 29;
285 break;
286 default:
287 lunarDate.month = 4;
288 break;
289 }
290 return result;
291 }
static ReadOnlySpan< byte > HebrewTable

References System.Globalization.HebrewCalendar.DateBuffer.day, and System.Globalization.HebrewCalendar.HebrewTable.

Referenced by System.Globalization.HebrewCalendar.GetDatePart(), and System.Globalization.HebrewCalendar.HebrewToGregorian().